Browse Source

更新版本

lex-xin 4 months ago
parent
commit
1453caa6b2

+ 1 - 1
dev-dist/sw.js

@@ -82,7 +82,7 @@ define(['./workbox-88bf3160'], (function (workbox) { 'use strict';
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.do2tqkj2vn"
+    "revision": "0.e2ao6l3d16"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 25 - 26
postcss.config.js

@@ -1,26 +1,25 @@
-module.exports = {
-  plugins: {
-    'postcss-px-to-viewport': {
-      unitToConvert: 'px', // 需要转换的单位,默认为"px"
-      viewportWidth: 1920,
-      viewportHeight: 1188, // 设计稿的视口宽度
-      unitPrecision: 8, // 单位转换后保留的精度
-      propList: ['*'], // 能转化为vw的属性列表
-      viewportUnit: 'vw', // 希望使用的视口单位
-      fontViewportUnit: 'rem', // 字体使用的视口单位
-      selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
-      minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
-      mediaQuery: true, // 媒体查询里的单位是否需要转换单位
-      replace: true, //  是否直接更换属性值,而不添加备用属性
-      exclude: [
-        /src\/components\/layout\/guide-section/,
-        /node_modules\/driver.js/
-      ], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
-      include: undefined, // 如果设置了include,那将只有匹配到的文件才会被转换
-      landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
-      landscapeUnit: 'vw', // 横屏时使用的单位
-      landscapeWidth: 1920 // 横屏时使用的视口宽度
-    }
-  }
-};
-
+module.exports = {
+  plugins: {
+    'postcss-px-to-viewport': {
+      unitToConvert: 'px', // 需要转换的单位,默认为"px"
+      viewportWidth: 1920,
+      viewportHeight: 1188, // 设计稿的视口宽度
+      unitPrecision: 8, // 单位转换后保留的精度
+      propList: ['*'], // 能转化为vw的属性列表
+      viewportUnit: 'vw', // 希望使用的视口单位
+      fontViewportUnit: 'rem', // 字体使用的视口单位
+      selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
+      minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
+      mediaQuery: true, // 媒体查询里的单位是否需要转换单位
+      replace: true, //  是否直接更换属性值,而不添加备用属性
+      exclude: [
+        /src\/components\/layout\/guide-section/,
+        /node_modules\/driver.js/
+      ], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
+      include: undefined, // 如果设置了include,那将只有匹配到的文件才会被转换
+      landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
+      landscapeUnit: 'vw', // 横屏时使用的单位
+      landscapeWidth: 1920 // 横屏时使用的视口宽度
+    }
+  }
+};

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1736687065873}
+{"version":1736995255462}

+ 9 - 11
src/App.tsx

@@ -1,18 +1,18 @@
-import { computed, defineComponent, onMounted, ref, onUnmounted } from 'vue';
+import { computed, defineComponent, onMounted, onUnmounted } from 'vue';
 import { NConfigProvider, zhCN, dateZhCN, NModal } from 'naive-ui';
 import { AppProvider } from './components/Application';
-import { RouterView, useRouter } from 'vue-router';
+import { RouterView } from 'vue-router';
 import setting from './settings/designSetting';
 import { lighten } from './utils';
 import RouterError from './components/RouterError';
 import { useRegisterSW } from 'virtual:pwa-register/vue';
 import { useUserStore } from './store/modules/users';
-import { modalClickMask } from './state';
-import ScreenTips from './screen-tips';
+import UpdateTips from './update-tips';
 
 export default defineComponent({
   name: 'App',
   setup() {
+    const upload = true;
     const { needRefresh, offlineReady, updateServiceWorker } = useRegisterSW({
       onRegistered(r: any) {
         console.log(r, 'registered');
@@ -214,7 +214,7 @@ export default defineComponent({
     });
 
     return () => (
-      <>
+      <div>
         <NConfigProvider
           locale={zhCN}
           themeOverrides={getThemeOverrides.value}
@@ -226,11 +226,9 @@ export default defineComponent({
             <RouterError />
           </AppProvider>
         </NConfigProvider>
-        {/* <NModal
-          maskClosable={modalClickMask}
-          v-model:show={showModalMask.value}>
-          <ScreenTips />
-        </NModal> */}
+        <NModal maskClosable={false} v-model:show={needRefresh.value}>
+          <UpdateTips onConfirm={() => updateServiceWorker(true)} />
+        </NModal>
 
         <span style={{ display: 'none' }}>
           {needRefresh.value ? '新内容可用,点击刷新页面' : '没有新内容'}
@@ -248,7 +246,7 @@ export default defineComponent({
           content={showModalMsg.value}
           positive-text="确认"
           onPositiveClick={submitCallback}></NModal> */}
-      </>
+      </div>
     );
   }
 });

+ 2 - 2
src/components/layout/guide-section/index.tsx

@@ -286,8 +286,8 @@ export default defineComponent({
                       <TheSearch
                         round={false}
                         v-model:value={opInfo.searchValue}
-                        onSearch={async (val: any) => {
-                          await getTeacherManual(val);
+                        onSearch={async () => {
+                          await getTeacherManual();
                           if (windowInfo.windowType === 'LARGE') {
                             const id = opInfo.dataList[0]?.children[0]?.id;
                             id && getTeacherManualDetail(id);

BIN
src/update-tips/images/tip-bg.png


BIN
src/update-tips/images/tip-dang.png


+ 62 - 0
src/update-tips/index.module.less

@@ -0,0 +1,62 @@
+.commonWork {
+  width: 400px;
+  background: #ffffff;
+  border-radius: 18px;
+  position: relative;
+  padding: 0 30px 35px;
+
+  .downMoveBg {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 400px;
+    height: 104px;
+  }
+
+  .dingPng {
+    width: 159px;
+    height: 159px;
+    position: absolute;
+    left: 50%;
+    margin-left: -81px;
+    top: -57px;
+    z-index: 100;
+  }
+
+  h2 {
+    margin-top: 120px;
+    font-weight: 600;
+    font-size: 24px;
+    color: #131415;
+    line-height: 33px;
+    text-align: center;
+  }
+
+  .header {
+    text-align: center;
+    padding: 20px 0 30px;
+    font-size: 18px;
+    color: #777777;
+    line-height: 30px;
+
+    span {
+      color: #2784ff;
+    }
+  }
+
+  .btn {
+    cursor: pointer;
+    width: 256px;
+    border-radius: 50px;
+    text-align: center;
+    font-weight: 600;
+    font-size: 18px;
+    color: #ffffff;
+    line-height: 25px;
+    line-height: 47px;
+    margin: 0 auto;
+    --n-color: #40c8ff !important;
+    background: linear-gradient(305deg, #40c8ff 0%, #3192ff 100%);
+  }
+}
+

+ 24 - 0
src/update-tips/index.tsx

@@ -0,0 +1,24 @@
+import { defineComponent } from 'vue';
+import styles from './index.module.less';
+import commentBg from './images/tip-bg.png';
+import commentTop from './images/tip-dang.png';
+
+export default defineComponent({
+  name: 'screen-tips',
+  emits: ['confirm'],
+  setup(props, { emit }) {
+    return () => (
+      <div class={styles.commonWork}>
+        <img src={commentTop} class={styles.dingPng} alt="" />
+        <img src={commentBg} class={styles.downMoveBg} alt="" />
+        <h2>发现新版本</h2>
+
+        <div class={styles.header}>系统已更新版本,请刷新界面后继续使用</div>
+
+        <div class={styles.btn} onClick={() => emit('confirm')}>
+          立即刷新
+        </div>
+      </div>
+    );
+  }
+});