chenmy 6 anni fa
parent
commit
04f66299b8

+ 0 - 2
TEAMModelOS.SmartTeach/ClientApp/app.js

@@ -1,5 +1,4 @@
 import Vue from 'vue'
-//import axios from 'axios'
 import i18n from '@/locale';
 import router from './router/index'
 import store from './store'
@@ -13,7 +12,6 @@ import apiTools from '@/api/api.js';
 import { fetch, post } from '@/filters/http.js';
 import VideoPlayer from 'vue-video-player';
 import jwtDecode from 'jwt-decode';
-
 require('video.js/dist/video-js.css');
 require('vue-video-player/src/custom-theme.css');
 Vue.use(VideoPlayer);

+ 27 - 0
TEAMModelOS.SmartTeach/ClientApp/components/app-root.vue

@@ -0,0 +1,27 @@
+<template>
+    <div id="app" class="container-fluid">
+        <router-view/>
+    </div>
+</template>
+
+<script>
+    import NavMenu from './nav-menu'
+
+    export default {
+      components: {
+        'nav-menu': NavMenu
+      },
+
+      data () {
+        return {}
+      }
+    }
+</script>
+
+<style>
+#app, body, html{
+  width: 100%;
+  height: 100%;
+  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI','Microsoft JhengHei';
+}
+</style>

+ 26 - 0
TEAMModelOS.SmartTeach/ClientApp/components/nav-menu.vue

@@ -0,0 +1,26 @@
+<template>
+    <div class="main-nav">
+    </div>
+</template>
+
+<script>
+    import { routes } from '../router/routes'
+
+    export default {
+      data () {
+        return {
+          routes,
+          collapsed: true
+        }
+      },
+      methods: {
+        toggleCollapsed: function (event) {
+          this.collapsed = !this.collapsed
+        }
+      }
+    }
+</script>
+
+<style scoped>
+  
+</style>

+ 3 - 31
TEAMModelOS.SmartTeach/ClientApp/router/routes.js

@@ -1,37 +1,9 @@
-import Login from '@/view/login'
-import ServerSideLogin from '@/view/serverside/login'
+//import Login from '@/view/login'
+//import ServerSideLogin from '@/view/serverside/login'
 // import HTTP404 from '@/view/404'
 import Index from '@/view/index'
 import { resolve } from 'url';
 
-export const routes = [
-  { name: 'login', path: '/login', component: Login },
-  { name: 'ServerSideLogin', path: '/serverside/login', component: ServerSideLogin },
-  { name: 'SmartClassDashBoard', path: '/smartclassdashboard', component: resolve => require(['@/view/smart-dashboard/class/smart-class-dashboard'], resolve), },
-  { name: 'SmartIOTDashBoard', path: '/smartiotdashboard', component: resolve => require(['@/view/smart-dashboard/IOT/smart-iot-dashboard'], resolve), },
-  { name: 'SmartTALDashBoard', path: '/smarttaldashboard', component: resolve => require(['@/view/smart-dashboard/TAL/smart-tal-dashboard'], resolve), },
+export const routes = [  
   { name: 'index', path: '', component: Index },
-  //学情分析
-  {
-    name: 'saindex',
-    path: '/saindex',
-    component: resolve => require(['@/view/student-analysis/index/SAindex.vue'], resolve),
-  },
-  {
-    name: 'teach',
-    path: '/teach',
-    component: resolve => require(['@/view/student-analysis/index/SAteach.vue'], resolve),
-  },
-  {
-    name:'total',
-    path: '/total',
-    component: resolve => require(['@/view/student-analysis/total-analysis/SAtotal.vue'],resolve),
-  },
-  // { name: 'HTTP404', path: '/*', component: HTTP404, display: 'Home', icon: 'home' },
-
-
-  {
-    path: '/syllabus',
-    component: resolve => require(['@/view/syllabus/index/index.vue'], resolve), //路由懒加载
-  }
 ]

+ 5 - 186
TEAMModelOS.SmartTeach/ClientApp/view/index.vue

@@ -1,200 +1,19 @@
 <template>
   <div id="app">
-    <div class="main-content" v-show="preFlag">
-      <img src="../assets/tmd_logo.png" class="logo animated fadeIn" @load="loadImage" />
-
-      <!-- 选择身份 -->
-      <div class="centerCol" v-if="isSelectRole">
-        <span class="title">{{$t('index.chooseRole')}}</span>
-        <div class="select-role-wrap center">
-          <div class="role-item centerCol" v-for="(item,index) in roleInfo" @click="handleRole(item,index)">
-            <Icon type="ios-ribbon" size="60" /><span class="role-name">{{item.role.name}}</span>
-          </div>
-        </div>
-      </div>
-
-      <!-- 选择模块 -->
-      <div class="auth-wrap centerCol" v-else>
-        <Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleLogin('login')" v-show="!isLogin">{{$t('index.login')}}</Button>
-        <Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleLogin('regist')" v-show="!isLogin">{{$t('index.register')}}</Button>
-        <!--<Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleAuth()" v-show="!hasAuthSchool">去授权</Button>
-        <p v-show="isLogin" class="suc-text">{{$t('index.authSchool')}}: {{schoolInfo.schoolName}}</p>-->
-        <div v-show="isLogin" class="suc-text select-role">
-          <span>{{$t('index.currentRole')}}:</span>
-          <Select v-model="currentRole" style="width:200px" @on-change="handleRoleChange">
-            <Option v-for="(item,index) in roleInfo" :value="index" :key="item.role.name">{{ item.role.name }}</Option>
-          </Select>
-        </div>
-        <div v-show="isLogin" class="overlay-wrap center animated fadeIn">
-          <SelectModule :moduleList="moduleList"></SelectModule>
-        </div>
-      </div>
-
-    </div>
-    <!-- 用户信息 -->
-    <div class="user-wrap" v-show="isLogin">
-      <div>
-        <span class="ivu-avatar ivu-avatar-circle ivu-avatar-default ivu-avatar-icon"><i class="ivu-icon ivu-icon-ios-person"></i></span>
-        <span>{{username}}</span>
-        <span class="btn-exit" @click="handleExit">{{$t('index.exit')}}</span>
-      </div>
-    </div>
+   测试测试
   </div>
 </template>
 <script>
-  import animate from 'animate.css'
-  import SelectModule from '@/components/syllabus/SelectModule.vue'
   export default {
-    components: {
-      SelectModule
-    },
     data() {
       return {
-        isLogin: false,
-        isSelectRole: false,
-        username: "",
-        hasAuthSchool: true,
-        schoolInfo: {},
-        preFlag: false,
-        currentRole: "",
-        roleInfo:[],
-        moduleList: [{
-          name: "学情分析",
-          link: "/saindex"
-        }, {
-          name: "课纲管理",
-          link: "/syllabus"
-        }]
-      }
-    },
-    methods: {
-
-      //前往授权
-      handleAuth() {
-        this.$router.replace('/authorization')
-      },
-      //图片加载完成后再展示
-      loadImage() {
-        this.preFlag = true;
-      },
-      //访问TW登录并回调
-      handleLogin(types) {
-        let that = this;
-        that.$api.getLoginLink({ date: "151615156", type: types }).then(res => {
-          let loginUrl = res.result.data;
-          let callback = window.location.href;
-          window.location.href = loginUrl + callback;
-        })
-      },
-      //获取URL地址的指定参数
-      getParamAsCH(paramName) {
-        var paramValue = "";
-        var isFound = false;
-        if (window.location.search.indexOf("?") == 0 && window.location.search.indexOf("=") > 1) {
-          var arrSource = decodeURI(window.location.search).substring(1, window.location.search.length).split("&");
-          var i = 0;
-          while (i < arrSource.length && !isFound) {
-            if (arrSource[i].indexOf("=") > 0) {
-              if (arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase()) {
-                paramValue = arrSource[i].split("=")[1];
-                isFound = true;
-              }
-            }
-            i++;
-          }
-        }
-        paramValue = unescape(paramValue)
-        return paramValue;
-      },
-      //登录回调函数获取参数
-      loginCallback() {
-        let that = this;
-        let bcrypt = require('bcryptjs');
-        let name = this.getParamAsCH("name") ? this.getParamAsCH("name") : localStorage.getItem('username');
-        let teamModelId = this.getParamAsCH("id");
-        let ticket = this.getParamAsCH("ticket");
-        let token = localStorage.getItem('token') ? localStorage.getItem('token') : "";
-        that.$Spin.show();
-        that.$api.checkLogin({  //登录验证
-          name: name,
-          teamModelId: teamModelId,
-          ticket: ticket,
-          token: token,
-          sign: bcrypt.hashSync(ticket + teamModelId)
-        }).then(res => {
-          let token = res.result.data.jwtToken.access_token;
-          if (token) {
-            if (!localStorage.getItem('token')) {
-              that.$Message.success(this.$t('index.loginSuc'));
-            }
-            that.getLoginClaim();//获取身份信息
-            let decode = that.$jwtDecode(res.result.data.jwtToken.access_token);//解析返回的token
-            localStorage.setItem('token', token);
-            localStorage.setItem('username', decode.name);
-            localStorage.setItem('decodeData', JSON.stringify(decode));
-            that.username = decode.name;
-            that.isLogin = true;
-            that.isSelectRole = true;
-            that.$Spin.hide();
-          } else {
-            that.$Message.warning("服务器错误!未返回token");
-          }
-        }).catch(res => {
-          //that.$Message.warning("当前未登录");
-          that.$Spin.hide();
-        })
-      },
-
-      //获取登录用户绑定学校身份信息
-      getLoginClaim() {
-        this.$api.getLoginClaim({}).then(res => {
-          this.roleInfo = res.result.data;
-        })
-      },
-
-      //选择身份跳转到模块选择
-      handleRole(role, index) {
-        localStorage.setItem('c_role_info', JSON.stringify(role));
-        for (let i in role.roleClaim) {
-          if (role.roleClaim[i].claim) {
-            let str = " ";
-            let roleClaim = role.roleClaim[i].claim;
-            for (let j in roleClaim) {
-              str = str + roleClaim[j].claimName
-            }
-            console.log(str);
-          }
-        }
-        this.isSelectRole = false;
-        this.currentRole = this.roleInfo.indexOf(role);
-      },
-      //身份变化
-      handleRoleChange(val) {
-        let role = this.roleInfo[val];
-        localStorage.setItem('c_role_info', JSON.stringify(this.roleInfo[val]));
-        for (let i in role.roleClaim) {
-          if (role.roleClaim[i].claim) {
-            let str = " ";
-            let roleClaim = role.roleClaim[i].claim;
-            for (let j in roleClaim) {
-              str = str + roleClaim[j].claimName
-            }
-            console.log(str);
-          }
-        }
-      },
-
-      //退出操作清除存储数据
-      handleExit() {
-        localStorage.clear();
-        window.location.href = window.location.origin;
-      },
 
+      }
     },
-    mounted() {
-      this.loginCallback();
+      mounted() {
+        
+      }
     }
-  }
 </script>
 <style scoped>
   html, body, #app {