瀏覽代碼

feat:对首页进行完善,对auto-login进行完善,对viteconfig进行完善解决上线路径问题

coder 2 年之前
父節點
當前提交
9f19a03f71
共有 5 個文件被更改,包括 212 次插入203 次删除
  1. 146 148
      public/auto-login.html
  2. 二進制
      src/assets/index/myjsjxkh.png
  3. 19 15
      src/pages/index.vue
  4. 46 39
      src/pages/menuData.js
  5. 1 1
      vite.config.ts

+ 146 - 148
public/auto-login.html

@@ -3,165 +3,163 @@
 <html>
 
 <head>
-    <title>景宁教育魔方</title>
-    <!-- 这个必须引入的啊,钉钉的前端js SDK, 使用框架的请自行参照开发文档 -->
-    <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.7.13/dingtalk.open.js"></script>
-    <!-- 这个jquery 想不想引入自己决定,没什么影响 -->
-    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
-    <style type="text/css">
-        .loading {
-            position: fixed;
-            left: 0;
-            top: 0;
-            width: 100%;
-            height: 100%;
-            z-index: 100;
-            background: url("loading.gif") center no-repeat rgba(255, 255, 255, .55);
-        }
-    </style>
+  <title>景宁教育魔方</title>
+  <!-- 这个必须引入的啊,钉钉的前端js SDK, 使用框架的请自行参照开发文档 -->
+  <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.7.13/dingtalk.open.js"></script>
+  <!-- 这个jquery 想不想引入自己决定,没什么影响 -->
+  <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
+  <style type="text/css">
+    .loading {
+      position: fixed;
+      left: 0;
+      top: 0;
+      width: 100%;
+      height: 100%;
+      z-index: 100;
+      background: url("loading.gif") center no-repeat rgba(255, 255, 255, .55);
+    }
+  </style>
 </head>
 
 <body>
 
-    <!--TODO...替换成之前亲亲云的一个登录中转过度loading-->
-    <div class="loading"></div>
-    <!--<div id="user_info" style="color: #000;font-size: 15px;position: fixed;left: 0;top: 0;width: 100%;height: 100%;z-index: 150"></div>-->
-    <!--<hr>-->
-    <!--<h1>教育魔方-免登验证-线上环境</h1>-->
-    <!--<p>当前页面的url:</p>-->
-    <!--<p id="url"></p>-->
-    <!--<br>-->
-    <!--<p>解析url,获取的corpID:</p>-->
-    <!--<p id="corpId"></p>-->
-    <!--<br>-->
-    <!--<p>SDK初始化获取的code:</p>-->
-    <!--<p id="code"></p>-->
-    <!--<br>-->
-    <!--<p>请求我们服务端,登录返回的结果:</p>-->
-    <p id="myresponse"></p>
-
-    <script type="text/javascript">
-        let login_obj = {
-            url: '',
-            code: '',
-            api: ''
-        };
-        if (location.href.includes('.bozedu.')) {
-            login_obj = {
-                url: 'https://daily-cube.zjedu.com',
-                code: 'suitemie4qeftvmhnufp1',
-                api: 'http://jnjymf_api.bozedu.top'
-            }
-        } else {
-            login_obj = {
-                url: 'https://cube.zjedu.com',
-                code: 'suiteecoywfohhm68lkix',
-                api: 'http://60.188.226.44:8090'
-            }
-        }
-        $(function () {
-            var params = new Object();
-            params = GetRequest();
-            if (localStorage.getItem('userInfo')) {
-                localStorage.removeItem('userInfo');
-            }
-            // {
-            //     var corpId = params.corpId ? params.corpId : '';
-            //     var tag = params.tag ? params.tag : '';
-            //     let follow = '';
-            //     const t = tag.split('_');
-            //     if (t.length > 1) {
-            //         tag = t.splice(0, 1)[0];
-            //         follow = t.join('/');
-            //     }
-            //     console.log(' href : ', '/app/' + tag + '/' + (follow ? ('#/' + follow) : ''))
-            //     return
-            // }
-            //钉钉sdk 初始化
-            // dd.ready参数为回调函数,在环境准备就绪时触发,jsapi的调用需要保证在该回调函数触发后调用,否则无效。
-            dd.ready(function () {
-                var corpId = params.corpId ? params.corpId : '';
-                var tag = params.tag ? params.tag : '';
-                let follow = '';
-                const t = tag.split('_');
-                if (t.length > 1) {
-                    tag = t.splice(0, 1)[0];
-                    follow = t.join('/');
-                }
-                // console.log(' href : ', '/app/' + tag + '/' + (follow ? ('#/' + follow) : ''))
-
-                //使用SDK 获取免登授权码
-                dd.runtime.permission.requestAuthCode({
-                    corpId: corpId,
-                    onSuccess: function (result) {
-                        var code = result.code;
+  <!--TODO...替换成之前亲亲云的一个登录中转过度loading-->
+  <div class="loading"></div>
+  <!--<div id="user_info" style="color: #000;font-size: 15px;position: fixed;left: 0;top: 0;width: 100%;height: 100%;z-index: 150"></div>-->
+  <!--<hr>-->
+  <!--<h1>教育魔方-免登验证-线上环境</h1>-->
+  <!--<p>当前页面的url:</p>-->
+  <!--<p id="url"></p>-->
+  <!--<br>-->
+  <!--<p>解析url,获取的corpID:</p>-->
+  <!--<p id="corpId"></p>-->
+  <!--<br>-->
+  <!--<p>SDK初始化获取的code:</p>-->
+  <!--<p id="code"></p>-->
+  <!--<br>-->
+  <!--<p>请求我们服务端,登录返回的结果:</p>-->
+  <p id="myresponse"></p>
 
-                        $.ajax({
-                            type: "POST",
-                            //TODO...下面的域名要从配置文件中获取,不写死
-                            url: login_obj.url + '/user/api/v1/login/autoLogin',
-                            contentType: "application/json;charset=utf-8",
-                            data: JSON.stringify({ code: code, accessKey: login_obj.code, corpId: corpId }),
-                            dataType: "json",
-                            success: function (response) {
-                                // $('#user_info').html('22222'+ JSON.stringify(response.data));
-                                if (response.success == false) {
-                                    alert(JSON.stringify(response.msg) + JSON.stringify(response.code));
-                                } else {
-                                    //TODO...开始
-                                    $.ajax({
-                                        type: 'POST',
-                                        url: login_obj.api + '/user/main/login',
-                                        // contentType: "application/json;charset=utf-8",
-                                        data: {
-                                            cubeinfo: JSON.stringify(response.data)
-                                        },
-                                        dataType: "json",
-                                        success: (res) => {
-                                            if (res.code == 1) {
-                                                localStorage.setItem('userInfo', JSON.stringify(res.data));
-                                                location.href = '/app/' + tag + '/' + (follow ? ('#/' + follow) : '');
-                                                // location.href = 'test.html';
-                                            } else {
-                                                alert(res.msg);
-                                            }
-                                        },
-                                        error: function (re) {
-                                            alert("失败" + JSON.stringify(res));
-                                        }
-                                    })
-                                    //TODO...结束
-                                }
-                                // alert("成功" + JSON.stringify(response));
-                                //成功以后将response.data的信息提交给 本地用户获取接口(开发中),初始化登录用户信息
+  <script type="text/javascript">
+    let login_obj = {
+      url: '',
+      code: '',
+      api: ''
+    };
+    if (location.href.includes('.bozedu.')) {
+      login_obj = {
+        url: 'https://daily-cube.zjedu.com',
+        code: 'suitemie4qeftvmhnufp1',
+        api: 'http://jnjymf_api.bozedu.top'
+      }
+    } else {
+      login_obj = {
+        url: 'https://cube.zjedu.com',
+        code: 'suiteecoywfohhm68lkix',
+        api: 'http://60.188.226.44:8090'
+      }
+    }
+    $(function () {
+      var params = new Object();
+      params = GetRequest();
+      if (localStorage.getItem('userInfo')) {
+        localStorage.removeItem('userInfo');
+      }
+      // {
+      //     var corpId = params.corpId ? params.corpId : '';
+      //     var tag = params.tag ? params.tag : '';
+      //     let follow = '';
+      //     const t = tag.split('_');
+      //     if (t.length > 1) {
+      //         tag = t.splice(0, 1)[0];
+      //         follow = t.join('/');
+      //     }
+      //     console.log(' href : ', '/app/' + tag + '/' + (follow ? ('#/' + follow) : ''))
+      //     return
+      // }
+      //钉钉sdk 初始化
+      // dd.ready参数为回调函数,在环境准备就绪时触发,jsapi的调用需要保证在该回调函数触发后调用,否则无效。
+      dd.ready(function () {
+        var corpId = params.corpId ? params.corpId : '';
+        var tag = params.tag ? params.tag : '';
+        // const t = tag.split('_');
+        // if (t.length > 1) {
+        //   tag = t.splice(0, 1)[0];
+        //   follow = t.join('/');
+        // }
+        // console.log(' href : ', '/app/' + tag + '/' + (follow ? ('#/' + follow) : ''))
 
+        //使用SDK 获取免登授权码
+        dd.runtime.permission.requestAuthCode({
+          corpId: corpId,
+          onSuccess: function (result) {
+            var code = result.code;
 
-                            },
-                            error: function (response) {
-                                alert("失败" + JSON.stringify(response));
-                            }
-                        });
+            $.ajax({
+              type: "POST",
+              //TODO...下面的域名要从配置文件中获取,不写死
+              url: login_obj.url + '/user/api/v1/login/autoLogin',
+              contentType: "application/json;charset=utf-8",
+              data: JSON.stringify({ code: code, accessKey: login_obj.code, corpId: corpId }),
+              dataType: "json",
+              success: function (response) {
+                // $('#user_info').html('22222'+ JSON.stringify(response.data));
+                if (response.success == false) {
+                  alert(JSON.stringify(response.msg) + JSON.stringify(response.code));
+                } else {
+                  //TODO...开始
+                  $.ajax({
+                    type: 'POST',
+                    url: login_obj.api + '/user/main/login',
+                    // contentType: "application/json;charset=utf-8",
+                    data: {
+                      cubeinfo: JSON.stringify(response.data)
                     },
-                    onFail: function (err) {
-                        // 调用失败时回调
-                        alert("requestAuthCode失败" + JSON.stringify(err));
+                    dataType: "json",
+                    success: (res) => {
+                      if (res.code == 1) {
+                        localStorage.setItem('userInfo', JSON.stringify(res.data));
+                        location.href = '/app/mobile/' + (tag ? ('#/?tag=' + tag) : '');
+                      } else {
+                        alert(res.msg);
+                      }
+                    },
+                    error: function (re) {
+                      alert("失败" + JSON.stringify(res));
                     }
-                });
-            });
-        })
-        function GetRequest() {
-            var url = location.search;
-            var theRequest = new Object();
-            if (url.indexOf("?") != -1) {
-                var str = url.substr(1);
-                strs = str.split("&");
-                for (var i = 0; i < strs.length; i++) {
-                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
+                  })
+                  //TODO...结束
                 }
-            }
-            return theRequest;
+                // alert("成功" + JSON.stringify(response));
+                //成功以后将response.data的信息提交给 本地用户获取接口(开发中),初始化登录用户信息
+
+
+              },
+              error: function (response) {
+                alert("失败" + JSON.stringify(response));
+              }
+            });
+          },
+          onFail: function (err) {
+            // 调用失败时回调
+            alert("requestAuthCode失败" + JSON.stringify(err));
+          }
+        });
+      });
+    })
+    function GetRequest() {
+      var url = location.search;
+      var theRequest = new Object();
+      if (url.indexOf("?") != -1) {
+        var str = url.substr(1);
+        strs = str.split("&");
+        for (var i = 0; i < strs.length; i++) {
+          theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
         }
-    </script>
+      }
+      return theRequest;
+    }
+  </script>
 </body>
 
 </html>

二進制
src/assets/index/myjsjxkh.png


+ 19 - 15
src/pages/index.vue

@@ -4,26 +4,30 @@ import { menuList } from './menuData.js'
 defineOptions({
   name: 'IndexPage',
 })
-const menuListData = menuList
+const router = useRouter()
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const tag = route.query.tag
+let menuListData = {}
+for (const item of menuList) {
+  if (item.tag === tag)
+    menuListData = item
+}
+
 function linkTo(path) {
+  router.push(path)
 }
 </script>
 
 <template>
   <div class="IndexPage">
-    <div class="header">
-      <p>校端办公管理系统</p>
-    </div>
     <div class="bodyContainer">
-      <div
-        v-for="(item, index) of menuListData" :key="item.title" class="card"
-        :style="index === 0 ? 'margin-top:0vh;' : ''"
-      >
+      <div class="card">
         <div class="titleCard">
-          <p>{{ item.title }}</p>
+          <p>{{ menuListData.title }}</p>
         </div>
         <div class="funcIconCard">
-          <div v-for="child of item.list" :key="child.menuName" class="funcIcon" @click="linkTo(child.path)">
+          <div v-for="child of menuListData.list" :key="child.menuName" class="funcIcon" @click="linkTo(child.path)">
             <img :src="child.icon">
             <p>{{ child.menuName }}</p>
           </div>
@@ -39,7 +43,7 @@ function linkTo(path) {
     width: 100vw;
     position: fixed;
     font-weight: bold;
-    font-size: 0.36rem;
+    font-size: 20px;
     height: 11vw;
     line-height: 11vw;
     padding-left: 2vw;
@@ -48,11 +52,11 @@ function linkTo(path) {
   }
 
   .bodyContainer {
-    margin-top: 11.5vw;
+    // margin-top: 2.5vw;
     padding: 2vw;
 
     .titleCard {
-      font-size: 0.32rem;
+      font-size: 18px;
       height: 6.7vw;
       line-height: 6.7vw;
       font-weight: bold;
@@ -67,7 +71,7 @@ function linkTo(path) {
 
       .funcIcon {
         width: 25%;
-        font-size: 0.20rem;
+        font-size: 15px;
         text-align: center;
         display: flex;
         flex-direction: column;
@@ -90,7 +94,7 @@ function linkTo(path) {
       background: white;
       border-radius: 10px;
       padding: 3vw;
-      margin-top: 2vw;
+      // margin-top: 2vw;
     }
   }
 }

+ 46 - 39
src/pages/menuData.js

@@ -2,72 +2,79 @@ import { getAssetsImages } from '../utils/getAssets'
 
 export const menuList = [
   {
+    tag: 'gwgl',
     title: '公文管理系统',
     list: [
-      { icon: getAssetsImages('index/wdfw.png'), menuName: '我的发文' },
-      { icon: getAssetsImages('index/dbfw.png'), menuName: '待办发文' },
-      { icon: getAssetsImages('index/dygw.png'), menuName: '待阅公文' },
-      { icon: getAssetsImages('index/gwk.png'), menuName: '公文库' },
+      { icon: getAssetsImages('index/wdfw.png'), menuName: '我的发文', path: '/officialDocumentManager/myOfficialDocument' },
+      { icon: getAssetsImages('index/dbfw.png'), menuName: '待办发文', path: '/officialDocumentManager/todoOffcialDoucument' },
+      { icon: getAssetsImages('index/dygw.png'), menuName: '待阅公文', path: '/officialDocumentManager/todoReadDoucument' },
+      { icon: getAssetsImages('index/gwk.png'), menuName: '公文库', path: '/officialDocumentManager/documentLibrary' },
     ],
   },
   {
+    tag: 'szyd',
     title: '三重一大申报',
     list: [
-      { icon: getAssetsImages('index/xmsq.png'), menuName: '项目申请' },
-      { icon: getAssetsImages('index/xmhp.png'), menuName: '项目获批' },
-      { icon: getAssetsImages('index/xmds.png'), menuName: '项目待审' },
+      { icon: getAssetsImages('index/xmsq.png'), menuName: '项目申请', path: '/sanZhongYiDa/projectApply' },
+      { icon: getAssetsImages('index/xmhp.png'), menuName: '项目获批', path: '/sanZhongYiDa/projectReceiveApproval' },
+      { icon: getAssetsImages('index/xmds.png'), menuName: '项目待审', path: '/sanZhongYiDa/projectWaitAudit' },
     ],
   },
   {
+    tag: 'jsldgl',
     title: '教师流动管理系统',
     list: [
-      { icon: getAssetsImages('index/bwrygl.png'), menuName: '编外人员管理' },
-      { icon: getAssetsImages('index/ndkhhz.png'), menuName: '年度考核汇总' },
-      { icon: getAssetsImages('index/myjsqkhz.png'), menuName: '名优教师情况汇总' },
-      { icon: getAssetsImages('index/txjstx.png'), menuName: '退休教师提醒' },
+      { icon: getAssetsImages('index/bwrygl.png'), menuName: '编外人员管理', path: '/techerFlowManager/exteriorPersonManger' },
+      { icon: getAssetsImages('index/ndkhhz.png'), menuName: '年度考核汇总', path: '/techerFlowManager/annualAssessmentSum' },
+      { icon: getAssetsImages('index/myjsqkhz.png'), menuName: '名优教师情况汇总', path: '/techerFlowManager/techerSituationSum' },
+      { icon: getAssetsImages('index/txjstx.png'), menuName: '退休教师提醒', path: '/techerFlowManager/retireTeacherRemind' },
+      { icon: getAssetsImages('index/myjsjxkh.png'), menuName: '名优教师绩效考核', path: '/techerFlowManager/teacherPerformanceAssessment' },
     ],
   },
   {
+    tag: 'jbcb',
     title: '加班餐费补贴',
     list: [
-      { icon: getAssetsImages('index/gzt.png'), menuName: '工作台' },
+      { icon: getAssetsImages('index/gzt.png'), menuName: '工作台', path: '/overtimeMealFeeSubsidy/workbench' },
     ],
   },
   {
+    tag: 'sbcg',
     title: '设备采购申请',
     list: [
-      { icon: getAssetsImages('index/sbys.png'), menuName: '设备预算' },
-      { icon: getAssetsImages('index/sbxmk.png'), menuName: '设备项目库' },
-    ],
-  },
-  {
-    title: '会议预定管理',
-    list: [
-      { icon: getAssetsImages('index/hysyd.png'), menuName: '会议室预定' },
-      { icon: getAssetsImages('index/hyjy.png'), menuName: '会议纪要' },
-      { icon: getAssetsImages('index/hyjyk.png'), menuName: '会议纪要库' },
-      { icon: getAssetsImages('index/hysgl.png'), menuName: '会议室管理' },
+      { icon: getAssetsImages('index/sbys.png'), menuName: '设备预算', path: '/equipmentPurchaseApply/budgetOfPlant' },
+      { icon: getAssetsImages('index/sbxmk.png'), menuName: '设备项目库', path: '/equipmentPurchaseApply/equipmentItemLibrary' },
     ],
   },
+  // {
+  //   title: '会议预定管理',
+  //   list: [
+  //     { icon: getAssetsImages('index/hysyd.png'), menuName: '会议室预定' },
+  //     { icon: getAssetsImages('index/hyjy.png'), menuName: '会议纪要' },
+  //     { icon: getAssetsImages('index/hyjyk.png'), menuName: '会议纪要库' },
+  //     { icon: getAssetsImages('index/hysgl.png'), menuName: '会议室管理' },
+  //   ],
+  // },
   {
+    tag: 'xmgl',
     title: '项目管理',
     list: [
-      { icon: getAssetsImages('index/xmlcgl.png'), menuName: '项目流程管理' },
-      { icon: getAssetsImages('index/xmgkt.png'), menuName: '项目管控台' },
-      { icon: getAssetsImages('index/xmzlk.png'), menuName: '项目资料库' },
-    ],
-  },
-  {
-    title: '学生竞赛管理',
-    list: [
-      { icon: getAssetsImages('index/cjbs.png'), menuName: '创建比赛' },
-      { icon: getAssetsImages('index/zsdy.png'), menuName: '证书打印' },
-    ],
-  },
-  {
-    title: '学校工作检查',
-    list: [
-      { icon: getAssetsImages('index/tjtj.png'), menuName: '提交统计' },
+      { icon: getAssetsImages('index/xmlcgl.png'), menuName: '项目流程管理', path: '/projectManager/projectFlowManger' },
+      { icon: getAssetsImages('index/xmgkt.png'), menuName: '项目管控台', path: '/projectManager/projectManageControl' },
+      { icon: getAssetsImages('index/xmzlk.png'), menuName: '项目资料库', path: '/projectManager/projectDatabase' },
     ],
   },
+  // {
+  //   title: '学生竞赛管理',
+  //   list: [
+  //     { icon: getAssetsImages('index/cjbs.png'), menuName: '创建比赛' },
+  //     { icon: getAssetsImages('index/zsdy.png'), menuName: '证书打印' },
+  //   ],
+  // },
+  // {
+  //   title: '学校工作检查',
+  //   list: [
+  //     { icon: getAssetsImages('index/tjtj.png'), menuName: '提交统计' },
+  //   ],
+  // },
 ]

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ import VueMacros from 'unplugin-vue-macros/vite'
 import { VantResolver } from 'unplugin-vue-components/resolvers'
 
 export default defineConfig({
-  base: '/',
+  base: '',
   resolve: {
     alias: {
       '~/': `${path.resolve(__dirname, 'src')}/`,