|
@@ -1,445 +1,478 @@
|
|
|
<template>
|
|
|
- <div id="main">
|
|
|
- <Loading v-if="isLoading" :top="300"></Loading>
|
|
|
- <BaseLayout>
|
|
|
- <!-- 头部右侧个人中心部分 -->
|
|
|
- <div class="header-right-box fl-around" slot="header-content">
|
|
|
- <Icon style="display:block" custom="iconfont icon-home" :color="isHomeLight ? '#1CC0F3':'#d0d0d0'" @click="toHome" :title="$t('system.goHome')" />
|
|
|
- <Icon type="md-open" @click="changePlatform" :title="$t('system.changePlat')" v-if="hasArea" />
|
|
|
- <BaseNotification :msgs="msgs"></BaseNotification>
|
|
|
- <span class="header-split"></span>
|
|
|
- <BaseUserPoptip @logout="basicMenu('quit')"></BaseUserPoptip>
|
|
|
- </div>
|
|
|
- <div id="content" slot="content">
|
|
|
- <router-view v-if="!$route.meta.isKeep && isRouterAlive" :key="this.$route.name"></router-view>
|
|
|
- <keep-alive>
|
|
|
- <router-view v-if="$route.meta.isKeep && isRouterAlive" :key="this.$route.name"></router-view>
|
|
|
- </keep-alive>
|
|
|
- </div>
|
|
|
- </BaseLayout>
|
|
|
- <!-- 平台更新提示 -->
|
|
|
- <Modal v-model="updStatus" footer-hide :width="800" class-name="upd-modal" :closable="false" :mask-closable="false">
|
|
|
- <div slot="header" class="upd-header">
|
|
|
- <img src="@/assets/loading/logo_loading.png" alt="" class="tm-logo">
|
|
|
- <p class="upd-title">
|
|
|
- {{$t('system.updTitle')}}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="upd-content">
|
|
|
- <p v-show="add.length" class="upd-block-title" style="margin-top:0px">
|
|
|
- {{$t('system.add')}}
|
|
|
- </p>
|
|
|
- <p v-for="(item,index) in add" :key="'add' + index">
|
|
|
- {{item.content}}
|
|
|
- </p>
|
|
|
- <p v-show="opt.length" class="upd-block-title">
|
|
|
- {{$t('system.opt')}}
|
|
|
- </p>
|
|
|
- <p v-for="(item,index) in opt" :key="'opt' + index">
|
|
|
- {{item.content}}
|
|
|
- </p>
|
|
|
- <p v-show="bug.length" class="upd-block-title">
|
|
|
- {{$t('system.bug')}}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="close-btn">
|
|
|
- <Button type="primary" :disabled="countDown > 0" @click="iKnow">
|
|
|
- {{$t('system.iKnow')}}
|
|
|
- <span v-show="countDown > 0">
|
|
|
- {{`(${countDown}S)`}}
|
|
|
- </span>
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
- </div>
|
|
|
+ <div id="main">
|
|
|
+ <Loading v-if="isLoading" :top="300"></Loading>
|
|
|
+ <BaseLayout>
|
|
|
+ <!-- 头部右侧个人中心部分 -->
|
|
|
+ <div class="header-right-box fl-around" slot="header-content">
|
|
|
+ <Icon style="display:block" custom="iconfont icon-home" :color="isHomeLight ? '#1CC0F3':'#d0d0d0'"
|
|
|
+ @click="toHome" :title="$t('system.goHome')" />
|
|
|
+ <Icon type="md-open" @click="changePlatform" :title="$t('system.changePlat')" v-if="hasArea" />
|
|
|
+ <BaseNotification :msgs="msgs"></BaseNotification>
|
|
|
+ <span class="header-split"></span>
|
|
|
+ <BaseUserPoptip @logout="basicMenu('quit')"></BaseUserPoptip>
|
|
|
+ </div>
|
|
|
+ <div id="content" slot="content">
|
|
|
+ <router-view v-if="!$route.meta.isKeep && isRouterAlive" :key="this.$route.name"></router-view>
|
|
|
+ <keep-alive>
|
|
|
+ <router-view v-if="$route.meta.isKeep && isRouterAlive" :key="this.$route.name"></router-view>
|
|
|
+ </keep-alive>
|
|
|
+ </div>
|
|
|
+ </BaseLayout>
|
|
|
+ <!-- 平台更新提示 -->
|
|
|
+ <Modal v-model="updStatus" footer-hide :width="800" class-name="upd-modal" :closable="false"
|
|
|
+ :mask-closable="false">
|
|
|
+ <div slot="header" class="upd-header">
|
|
|
+ <img src="@/assets/loading/logo_loading.png" alt="" class="tm-logo">
|
|
|
+ <p class="upd-title">
|
|
|
+ {{$t('system.updTitle')}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="upd-content">
|
|
|
+ <p v-show="add.length" class="upd-block-title" style="margin-top:0px">
|
|
|
+ {{$t('system.add')}}
|
|
|
+ </p>
|
|
|
+ <p v-for="(item,index) in add" :key="'add' + index">
|
|
|
+ {{item.content}}
|
|
|
+ </p>
|
|
|
+ <p v-show="opt.length" class="upd-block-title">
|
|
|
+ {{$t('system.opt')}}
|
|
|
+ </p>
|
|
|
+ <p v-for="(item,index) in opt" :key="'opt' + index">
|
|
|
+ {{item.content}}
|
|
|
+ </p>
|
|
|
+ <p v-show="bug.length" class="upd-block-title">
|
|
|
+ {{$t('system.bug')}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="close-btn">
|
|
|
+ <Button type="primary" :disabled="countDown > 0" @click="iKnow">
|
|
|
+ {{$t('system.iKnow')}}
|
|
|
+ <span v-show="countDown > 0">
|
|
|
+ {{`(${countDown}S)`}}
|
|
|
+ </span>
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import excel from '@/utils/excel.js'
|
|
|
-export default {
|
|
|
- name: 'headers',
|
|
|
- props: ['parentToChild', 'identityselect'],
|
|
|
- components: {},
|
|
|
- provide() {
|
|
|
- return {
|
|
|
- reload: this.reload
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- updStatus: false,
|
|
|
- isRouterAlive: true,
|
|
|
- msgs: [],
|
|
|
- isShowMock: false,
|
|
|
- isOpenDrawer: false,
|
|
|
- routerName: '',
|
|
|
- isLoading: false,
|
|
|
- curPlatform: '',
|
|
|
- location: '',
|
|
|
- countDown: 5,
|
|
|
- add: [],//新增功能
|
|
|
- opt: [],//优化功能
|
|
|
- bug: []//bug
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getVersionInfo()
|
|
|
- this.$Message.config({
|
|
|
- duration: 3
|
|
|
- });
|
|
|
- // 检查超时操作页面,清空缓存数据
|
|
|
- let webEndTime = localStorage.getItem('webEndTime')
|
|
|
- let time_now = new Date().getTime()
|
|
|
- if (webEndTime && time_now > webEndTime) {
|
|
|
- console.log('长时间未操作,清空storage,重新登录')
|
|
|
- this.loginOut()
|
|
|
- }
|
|
|
- this.$store.dispatch('user/checkSchoolCode');// 設定登入成功的學校簡碼
|
|
|
- this.$store.dispatch('user/checkUserProfile');// 檢查使用者個人詳細資訊
|
|
|
- this.$store.dispatch('user/checkStudentProfile');// 檢查學生的詳細資訊
|
|
|
+ import excel from '@/utils/excel.js'
|
|
|
+ export default {
|
|
|
+ name: 'headers',
|
|
|
+ props: ['parentToChild', 'identityselect'],
|
|
|
+ components: {},
|
|
|
+ provide() {
|
|
|
+ return {
|
|
|
+ reload: this.reload
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ updStatus: false,
|
|
|
+ isRouterAlive: true,
|
|
|
+ msgs: [],
|
|
|
+ isShowMock: false,
|
|
|
+ isOpenDrawer: false,
|
|
|
+ routerName: '',
|
|
|
+ isLoading: false,
|
|
|
+ curPlatform: '',
|
|
|
+ location: '',
|
|
|
+ countDown: 5,
|
|
|
+ add: [], //新增功能
|
|
|
+ opt: [], //优化功能
|
|
|
+ bug: [] //bug
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getVersionInfo()
|
|
|
+ this.$Message.config({
|
|
|
+ duration: 3
|
|
|
+ });
|
|
|
+ // 检查超时操作页面,清空缓存数据
|
|
|
+ let webEndTime = localStorage.getItem('webEndTime')
|
|
|
+ let time_now = new Date().getTime()
|
|
|
+ if (webEndTime && time_now > webEndTime) {
|
|
|
+ console.log('长时间未操作,清空storage,重新登录')
|
|
|
+ this.loginOut()
|
|
|
+ }
|
|
|
+ this.$store.dispatch('user/checkSchoolCode'); // 設定登入成功的學校簡碼
|
|
|
+ this.$store.dispatch('user/checkUserProfile'); // 檢查使用者個人詳細資訊
|
|
|
+ this.$store.dispatch('user/checkStudentProfile'); // 檢查學生的詳細資訊
|
|
|
|
|
|
- let user = JSON.parse(decodeURIComponent(localStorage.userInfo, "utf-8"))
|
|
|
- let user_profile = JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8"))
|
|
|
- this.location = user_profile.location
|
|
|
- if (user_profile.schools) {
|
|
|
- user_profile.schools = user_profile.schools.filter((item) => {
|
|
|
- return item.status == 'join'
|
|
|
- })
|
|
|
- } else {
|
|
|
- user_profile.schools = []
|
|
|
- }
|
|
|
- if (user_profile.schools.length) {
|
|
|
- this.$store.commit('setUserInfo', {
|
|
|
- TEAMModelId: user.id || user.sub,
|
|
|
- name: user.name,
|
|
|
- schoolCode: user_profile.defaultschool || user_profile.schools[0].schoolId
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$store.commit('setUserInfo', {
|
|
|
- TEAMModelId: user.id || user.sub,
|
|
|
- name: user.name,
|
|
|
- schoolCode: this.$GLOBAL.DEFAULT_SCHOOL_CODE
|
|
|
- })
|
|
|
- }
|
|
|
- this.$store.commit('setPrivateSpace', user_profile.total || 0)
|
|
|
- this.getAllNotice(user_profile, user.id)
|
|
|
- this.curPlatform = localStorage.getItem('platform') || 'school'
|
|
|
+ let user = JSON.parse(decodeURIComponent(localStorage.userInfo, "utf-8"))
|
|
|
+ let user_profile = JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8"))
|
|
|
+ this.location = user_profile.location
|
|
|
+ if (user_profile.schools) {
|
|
|
+ user_profile.schools = user_profile.schools.filter((item) => {
|
|
|
+ return item.status == 'join'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ user_profile.schools = []
|
|
|
+ }
|
|
|
+ if (user_profile.schools.length) {
|
|
|
+ this.$store.commit('setUserInfo', {
|
|
|
+ TEAMModelId: user.id || user.sub,
|
|
|
+ name: user.name,
|
|
|
+ schoolCode: user_profile.defaultschool || user_profile.schools[0].schoolId
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$store.commit('setUserInfo', {
|
|
|
+ TEAMModelId: user.id || user.sub,
|
|
|
+ name: user.name,
|
|
|
+ schoolCode: this.$GLOBAL.DEFAULT_SCHOOL_CODE
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$store.commit('setPrivateSpace', user_profile.total || 0)
|
|
|
+ this.getAllNotice(user_profile, user.id)
|
|
|
+ this.curPlatform = localStorage.getItem('platform') || 'school'
|
|
|
|
|
|
- //处理平台更新功能
|
|
|
- let timer = setInterval(() => {
|
|
|
- if (this.countDown > 0) {
|
|
|
- this.countDown--
|
|
|
- } else {
|
|
|
- clearInterval(timer)
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
+ //处理平台更新功能
|
|
|
+ let timer = setInterval(() => {
|
|
|
+ if (this.countDown > 0) {
|
|
|
+ this.countDown--
|
|
|
+ } else {
|
|
|
+ clearInterval(timer)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
|
|
|
- },
|
|
|
- methods: {
|
|
|
- iKnow(){
|
|
|
- this.updStatus = false
|
|
|
- let version = localStorage.getItem('version')
|
|
|
- let data = {
|
|
|
- [version]: true
|
|
|
- }
|
|
|
- localStorage.setItem('versionFlag',JSON.stringify(data))
|
|
|
- },
|
|
|
- readBuffer(data) {
|
|
|
- const { header, results } = excel.read(data, 'array')
|
|
|
- this.add = results.filter(item => item.type === 'add')
|
|
|
- this.opt = results.filter(item => item.type === 'opt')
|
|
|
- this.bug = results.filter(item => item.type === 'bug')
|
|
|
- this.updStatus = true
|
|
|
- },
|
|
|
- async getVersionInfo() {
|
|
|
- let version = localStorage.getItem('version')
|
|
|
- let versionFlag = localStorage.getItem('versionFlag') || '{}'
|
|
|
- let d = JSON.parse(versionFlag)
|
|
|
- if (d && d[version]) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (version) {
|
|
|
- try {
|
|
|
- let blobHost = this.$evTools.getBlobHost()
|
|
|
- let local = localStorage.getItem('local') || ''
|
|
|
- let lang = local.includes('en') ? 'en' : local.includes('tw') ? 'tw' : 'cn'
|
|
|
- let xlsx = await this.$tools.getFile(`${blobHost}/0-public/version/${lang}/${version}.xlsx`, 'arraybuffer')
|
|
|
- this.readBuffer(xlsx)
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- loginOut() {
|
|
|
- let login_schoolCode = localStorage.getItem('login_schoolCode')
|
|
|
- let srvAdr = localStorage.getItem('srvAdr')
|
|
|
- let versionFlag = localStorage.getItem('versionFlag')
|
|
|
- localStorage.clear()
|
|
|
- localStorage.setItem('srvAdr', srvAdr)
|
|
|
- localStorage.setItem('versionFlag', versionFlag)
|
|
|
- localStorage.setItem('login_schoolCode', login_schoolCode)
|
|
|
- window.location.href = window.location.origin + '/login'
|
|
|
- },
|
|
|
- reload() {
|
|
|
- this.isRouterAlive = false
|
|
|
- this.$nextTick(() => {
|
|
|
- this.isRouterAlive = true
|
|
|
- })
|
|
|
- },
|
|
|
- changePlatform() {
|
|
|
- let goPlatform = this.curPlatform === 'area' ? 'school' : 'area'
|
|
|
- let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
|
|
|
- this.$router.push({
|
|
|
- name: goPlatform === 'area' ? 'area' : homePath
|
|
|
- })
|
|
|
- localStorage.setItem('platform', this.curPlatform === 'area' ? 'school' : 'area')
|
|
|
- this.curPlatform = goPlatform
|
|
|
- },
|
|
|
- async getAllNotice(user_profile, userId) {
|
|
|
- let schoolNotice = await this.getSchoolNotice(user_profile, userId)
|
|
|
- let privateNotice = await this.getPrivateNotice(userId)
|
|
|
- this.msgs = schoolNotice.concat(privateNotice)
|
|
|
- if (this.msgs.length) {
|
|
|
- this.msgs.forEach(i => {
|
|
|
- i.body = JSON.parse(this.getBodyJson(i.body))
|
|
|
- })
|
|
|
- }
|
|
|
- localStorage.setItem('msgs', JSON.stringify(this.msgs))
|
|
|
- console.log('端外通知', this.msgs)
|
|
|
- },
|
|
|
- getBodyJson(str) {
|
|
|
- let reg = /\\/g;
|
|
|
- //使用replace方法将全部匹配正则表达式的转义符替换为空
|
|
|
- let replaceAfter = str.replace(reg, '').replace(/=/g, ':');
|
|
|
- return replaceAfter
|
|
|
- },
|
|
|
- getSchoolNotice(user_profile, userId) {
|
|
|
- return new Promise((r, j) => {
|
|
|
- if (this.hasSchool) {
|
|
|
- let srvAdr = this.$store.state.config.srvAdr
|
|
|
- let host = srvAdr == 'Global' ? this.$store.state.config.Global.coreAPIUrl : this.$store.state.config.China.coreAPIUrl
|
|
|
- this.$api.service.getNotification(host, {
|
|
|
- "from": "ies5:" + this.location + ':' + (user_profile.defaultschool || user_profile.schools[0].schoolId),
|
|
|
- "receiver": userId
|
|
|
- }).then(res => {
|
|
|
- r(res.msgs)
|
|
|
- })
|
|
|
- } else {
|
|
|
- r([])
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getPrivateNotice(userId) {
|
|
|
- return new Promise((r, j) => {
|
|
|
- let srvAdr = this.$store.state.config.srvAdr
|
|
|
- let host = srvAdr == 'Global' ? this.$store.state.config.Global.coreAPIUrl : this.$store.state.config.China.coreAPIUrl
|
|
|
- this.$api.service.getNotification(host, {
|
|
|
- "from": "ies5:" + this.location + ":private",
|
|
|
- "receiver": userId
|
|
|
- }).then(res => {
|
|
|
- r(res.msgs)
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- toHome() {
|
|
|
- let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
|
|
|
- this.$router.push({ name: homePath })
|
|
|
- },
|
|
|
- toSettings() {
|
|
|
- this.$router.push({ path: '/home/settings' })
|
|
|
- },
|
|
|
- toFeedback() {
|
|
|
- this.$router.push({ path: '/home/feedback' })
|
|
|
- },
|
|
|
- closeMenu() {
|
|
|
- this.isOpenDrawer = false
|
|
|
- },
|
|
|
- basicMenu(name) {
|
|
|
- if (name == 'quit') {
|
|
|
- this.$store.commit('user/resetSchoolProfile')
|
|
|
- this.$User.logout()
|
|
|
- this.$router.push({
|
|
|
- path: '/login'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ iKnow() {
|
|
|
+ this.updStatus = false
|
|
|
+ let version = localStorage.getItem('version')
|
|
|
+ let data = {
|
|
|
+ [version]: true
|
|
|
+ }
|
|
|
+ localStorage.setItem('versionFlag', JSON.stringify(data))
|
|
|
+ },
|
|
|
+ readBuffer(data) {
|
|
|
+ const {
|
|
|
+ header,
|
|
|
+ results
|
|
|
+ } = excel.read(data, 'array')
|
|
|
+ this.add = results.filter(item => item.type === 'add')
|
|
|
+ this.opt = results.filter(item => item.type === 'opt')
|
|
|
+ this.bug = results.filter(item => item.type === 'bug')
|
|
|
+ this.updStatus = true
|
|
|
+ },
|
|
|
+ async getVersionInfo() {
|
|
|
+ let version = localStorage.getItem('version')
|
|
|
+ let versionFlag = localStorage.getItem('versionFlag') || '{}'
|
|
|
+ let d = JSON.parse(versionFlag)
|
|
|
+ if (d && d[version]) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (version) {
|
|
|
+ try {
|
|
|
+ let blobHost = this.$evTools.getBlobHost()
|
|
|
+ let local = localStorage.getItem('local') || ''
|
|
|
+ let lang = local.includes('en') ? 'en' : local.includes('tw') ? 'tw' : 'cn'
|
|
|
+ let xlsx = await this.$tools.getFile(`${blobHost}/0-public/version/${lang}/${version}.xlsx`,
|
|
|
+ 'arraybuffer')
|
|
|
+ this.readBuffer(xlsx)
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ loginOut() {
|
|
|
+ let login_schoolCode = localStorage.getItem('login_schoolCode')
|
|
|
+ let srvAdr = localStorage.getItem('srvAdr')
|
|
|
+ let versionFlag = localStorage.getItem('versionFlag')
|
|
|
+ localStorage.clear()
|
|
|
+ localStorage.setItem('srvAdr', srvAdr)
|
|
|
+ localStorage.setItem('versionFlag', versionFlag)
|
|
|
+ localStorage.setItem('login_schoolCode', login_schoolCode)
|
|
|
+ window.location.href = window.location.origin + '/login'
|
|
|
+ },
|
|
|
+ reload() {
|
|
|
+ this.isRouterAlive = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.isRouterAlive = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changePlatform() {
|
|
|
+ let goPlatform = this.curPlatform === 'area' ? 'school' : 'area'
|
|
|
+ let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
|
|
|
+ this.$router.push({
|
|
|
+ name: goPlatform === 'area' ? 'area' : homePath
|
|
|
+ })
|
|
|
+ localStorage.setItem('platform', this.curPlatform === 'area' ? 'school' : 'area')
|
|
|
+ this.curPlatform = goPlatform
|
|
|
+ },
|
|
|
+ async getAllNotice(user_profile, userId) {
|
|
|
+ let schoolNotice = await this.getSchoolNotice(user_profile, userId)
|
|
|
+ let privateNotice = await this.getPrivateNotice(userId)
|
|
|
+ this.msgs = schoolNotice.concat(privateNotice)
|
|
|
+ if (this.msgs.length) {
|
|
|
+ this.msgs.forEach(i => {
|
|
|
+ i.body = JSON.parse(this.getBodyJson(i.body))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ localStorage.setItem('msgs', JSON.stringify(this.msgs))
|
|
|
+ console.log('端外通知', this.msgs)
|
|
|
+ },
|
|
|
+ getBodyJson(str) {
|
|
|
+ let reg = /\\/g;
|
|
|
+ //使用replace方法将全部匹配正则表达式的转义符替换为空
|
|
|
+ let replaceAfter = str.replace(reg, '').replace(/=/g, ':');
|
|
|
+ return replaceAfter
|
|
|
+ },
|
|
|
+ getSchoolNotice(user_profile, userId) {
|
|
|
+ return new Promise((r, j) => {
|
|
|
+ if (this.hasSchool) {
|
|
|
+ let srvAdr = this.$store.state.config.srvAdr
|
|
|
+ let host = srvAdr == 'Global' ? this.$store.state.config.Global.coreAPIUrl : this.$store
|
|
|
+ .state.config.China.coreAPIUrl
|
|
|
+ this.$api.service.getNotification(host, {
|
|
|
+ "from": "ies5:" + this.location + ':' + (user_profile.defaultschool ||
|
|
|
+ user_profile.schools[0].schoolId),
|
|
|
+ "receiver": userId
|
|
|
+ }).then(res => {
|
|
|
+ r(res.msgs)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ r([])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getPrivateNotice(userId) {
|
|
|
+ return new Promise((r, j) => {
|
|
|
+ let srvAdr = this.$store.state.config.srvAdr
|
|
|
+ let host = srvAdr == 'Global' ? this.$store.state.config.Global.coreAPIUrl : this.$store.state
|
|
|
+ .config.China.coreAPIUrl
|
|
|
+ this.$api.service.getNotification(host, {
|
|
|
+ "from": "ies5:" + this.location + ":private",
|
|
|
+ "receiver": userId
|
|
|
+ }).then(res => {
|
|
|
+ r(res.msgs)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toHome() {
|
|
|
+ let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
|
|
|
+ this.$router.push({
|
|
|
+ name: homePath
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toSettings() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/home/settings'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toFeedback() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/home/feedback'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeMenu() {
|
|
|
+ this.isOpenDrawer = false
|
|
|
+ },
|
|
|
+ basicMenu(name) {
|
|
|
+ if (name == 'quit') {
|
|
|
+ this.$store.commit('user/resetSchoolProfile')
|
|
|
+ this.$User.logout()
|
|
|
+ this.$router.push({
|
|
|
+ path: '/login'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
|
|
|
- if (localStorage.getItem('noSave') && JSON.parse(localStorage.getItem('noSave')).length) {
|
|
|
- this.$tools.deleteNoSave(JSON.parse(localStorage.getItem('noSave')))
|
|
|
- } else {
|
|
|
- localStorage.setItem('noSave', '[]')
|
|
|
- }
|
|
|
+ if (localStorage.getItem('noSave') && JSON.parse(localStorage.getItem('noSave')).length) {
|
|
|
+ this.$tools.deleteNoSave(JSON.parse(localStorage.getItem('noSave')))
|
|
|
+ } else {
|
|
|
+ localStorage.setItem('noSave', '[]')
|
|
|
+ }
|
|
|
|
|
|
- this.$EventBus.$off('noSave')
|
|
|
- this.$EventBus.$on('noSave', val => {
|
|
|
- let curNoSaveArr = JSON.parse(localStorage.getItem('noSave'))
|
|
|
- curNoSaveArr.push(val)
|
|
|
- localStorage.setItem('noSave', JSON.stringify(curNoSaveArr))
|
|
|
- })
|
|
|
- },
|
|
|
- computed: {
|
|
|
- hasSchool() {
|
|
|
- return this.$store.state.userInfo.hasSchool;
|
|
|
- },
|
|
|
- hasArea() {
|
|
|
- return this.$store.state.user.userProfile.areas.length > 0
|
|
|
- },
|
|
|
- isHomeLight() {
|
|
|
- return this.routerName == 'homePage' || (this.$store.state.config.srvAdr == 'Global' && this.routerName == 'myCourse')
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- $route: {
|
|
|
- handler(val, oldval) {
|
|
|
- this.routerName = val.name
|
|
|
- },
|
|
|
- // 深度观察监听
|
|
|
- deep: true,
|
|
|
- //立即执行
|
|
|
- immediate: true
|
|
|
- }
|
|
|
- },
|
|
|
-}
|
|
|
+ this.$EventBus.$off('noSave')
|
|
|
+ this.$EventBus.$on('noSave', val => {
|
|
|
+ let curNoSaveArr = JSON.parse(localStorage.getItem('noSave'))
|
|
|
+ curNoSaveArr.push(val)
|
|
|
+ localStorage.setItem('noSave', JSON.stringify(curNoSaveArr))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ hasSchool() {
|
|
|
+ return this.$store.state.userInfo.hasSchool;
|
|
|
+ },
|
|
|
+ hasArea() {
|
|
|
+ return this.$store.state.user.userProfile.areas.length > 0
|
|
|
+ },
|
|
|
+ isHomeLight() {
|
|
|
+ return this.routerName == 'homePage' || (this.$store.state.config.srvAdr == 'Global' && this.routerName ==
|
|
|
+ 'myCourse')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route: {
|
|
|
+ handler(val, oldval) {
|
|
|
+ this.routerName = val.name
|
|
|
+ // 指定几个模块页面 需要监听页面关闭和页面刷新
|
|
|
+ if (this.$GLOBAL.WATCH_ROUTE_CLOSE.includes(val.name)) {
|
|
|
+ window.onbeforeunload = function(e) {
|
|
|
+ var e = window.event || e;
|
|
|
+ e.returnValue = ("");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ window.onbeforeunload = function(){};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 深度观察监听
|
|
|
+ deep: true,
|
|
|
+ //立即执行
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.upd-block-title {
|
|
|
- font-weight: 600;
|
|
|
- font-size: 14px;
|
|
|
- color: #2d8cf0;
|
|
|
- margin-top: 20px;
|
|
|
- margin-bottom: 5px;
|
|
|
-}
|
|
|
-.upd-content {
|
|
|
- width: 100%;
|
|
|
- padding: 0px 30px;
|
|
|
-}
|
|
|
-.close-btn {
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- padding: 30px 0px 20px 0px;
|
|
|
-}
|
|
|
-.upd-title {
|
|
|
- width: fit-content;
|
|
|
- font-size: 20px;
|
|
|
- margin-left: 10px;
|
|
|
- font-weight: 600;
|
|
|
- color: black;
|
|
|
-}
|
|
|
-.tm-logo {
|
|
|
- width: 30px;
|
|
|
-}
|
|
|
-.upd-header {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- padding-top: 30px;
|
|
|
-}
|
|
|
-.header-split {
|
|
|
- display: block;
|
|
|
- width: 0;
|
|
|
- background: #636363;
|
|
|
- height: 25px;
|
|
|
- margin: 0 15px;
|
|
|
-}
|
|
|
-.header-right-box {
|
|
|
- margin: 12px 0;
|
|
|
- line-height: 1.5;
|
|
|
- float: right;
|
|
|
- height: 25px;
|
|
|
- padding-right: 20px;
|
|
|
-}
|
|
|
+ .upd-block-title {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #2d8cf0;
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
|
|
|
-.header-right-box .ivu-icon {
|
|
|
- font-size: 20px;
|
|
|
- margin-right: 20px;
|
|
|
- color: #d0d0d0;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
+ .upd-content {
|
|
|
+ width: 100%;
|
|
|
+ padding: 0px 30px;
|
|
|
+ }
|
|
|
|
|
|
-.header-right-box img {
|
|
|
- width: 40px;
|
|
|
- border-radius: 50%;
|
|
|
- border: 2px solid #595959;
|
|
|
-}
|
|
|
+ .close-btn {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ padding: 30px 0px 20px 0px;
|
|
|
+ }
|
|
|
|
|
|
-.fl-around {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-around;
|
|
|
-}
|
|
|
+ .upd-title {
|
|
|
+ width: fit-content;
|
|
|
+ font-size: 20px;
|
|
|
+ margin-left: 10px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tm-logo {
|
|
|
+ width: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upd-header {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding-top: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-split {
|
|
|
+ display: block;
|
|
|
+ width: 0;
|
|
|
+ background: #636363;
|
|
|
+ height: 25px;
|
|
|
+ margin: 0 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-right-box {
|
|
|
+ margin: 12px 0;
|
|
|
+ line-height: 1.5;
|
|
|
+ float: right;
|
|
|
+ height: 25px;
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-right-box .ivu-icon {
|
|
|
+ font-size: 20px;
|
|
|
+ margin-right: 20px;
|
|
|
+ color: #d0d0d0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-right-box img {
|
|
|
+ width: 40px;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 2px solid #595959;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fl-around {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-around;
|
|
|
+ }
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
-html,
|
|
|
-body {
|
|
|
- height: 100%;
|
|
|
- width: 100%;
|
|
|
- margin: 0px;
|
|
|
- padding: 0px;
|
|
|
-}
|
|
|
+ html,
|
|
|
+ body {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ margin: 0px;
|
|
|
+ padding: 0px;
|
|
|
+ }
|
|
|
|
|
|
-#main {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
-}
|
|
|
+ #main {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
|
|
|
-#main .layout {
|
|
|
- border: none;
|
|
|
- border-radius: 0px;
|
|
|
-}
|
|
|
+ #main .layout {
|
|
|
+ border: none;
|
|
|
+ border-radius: 0px;
|
|
|
+ }
|
|
|
|
|
|
-#content {
|
|
|
- height: 100%;
|
|
|
- /* background: #242328; */
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
+ #content {
|
|
|
+ height: 100%;
|
|
|
+ /* background: #242328; */
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
|
|
|
-/*重绘滚动条样式*/
|
|
|
-.scrollstyle::-webkit-scrollbar {
|
|
|
- width: 5px;
|
|
|
-}
|
|
|
+ /*重绘滚动条样式*/
|
|
|
+ .scrollstyle::-webkit-scrollbar {
|
|
|
+ width: 5px;
|
|
|
+ }
|
|
|
|
|
|
-.ivu-drawer-body::-webkit-scrollbar-track {
|
|
|
- display: none;
|
|
|
-}
|
|
|
+ .ivu-drawer-body::-webkit-scrollbar-track {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
|
|
|
-.scrollstyle::-webkit-scrollbar-thumb {
|
|
|
- border-radius: 10px;
|
|
|
- background: #94998a;
|
|
|
-}
|
|
|
+ .scrollstyle::-webkit-scrollbar-thumb {
|
|
|
+ border-radius: 10px;
|
|
|
+ background: #94998a;
|
|
|
+ }
|
|
|
|
|
|
-.scrollstyle::-webkit-scrollbar-button {
|
|
|
- display: none;
|
|
|
-}
|
|
|
-.upd-modal .ivu-modal-header {
|
|
|
- border: none;
|
|
|
-}
|
|
|
+ .scrollstyle::-webkit-scrollbar-button {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upd-modal .ivu-modal-header {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
</style>
|
|
|
|
|
|
<style lang="less">
|
|
|
-@import "../css/dark-iview-modal.less";
|
|
|
-@import "../css/dark-iview-tabs.less";
|
|
|
-@import "../css/dark-iview-collapse.less";
|
|
|
-@import "../css/dark-iview-form.less";
|
|
|
-@import "../css/dark-iview-upload.less";
|
|
|
-@import "../css/dark-iview-table.less";
|
|
|
-@import "../css/dark-iview-split.less";
|
|
|
-@import "../css/dark-iview-page.less";
|
|
|
-@import "../css/custom-animate.less";
|
|
|
-@import "../css/dark-wang-editor.less";
|
|
|
-@import "../css/dark-iview-loading.less";
|
|
|
-@import "../css/disabled-iview-form.less";
|
|
|
-@import "../css/common-style.less";
|
|
|
-@import "../css/dark-iview-drawer.less";
|
|
|
-@import "../css/dark-iview-card.less";
|
|
|
-@import "../css/dark-iview-poptip.less";
|
|
|
-@import "../css/dark-iview-checkbox.less";
|
|
|
-@import "../css/dark-el-cascader.less";
|
|
|
-@import "../css/dark-iview-style.less";
|
|
|
-@import "../css/custom-iview.less";
|
|
|
-@import "../css/light-iview-form.less";
|
|
|
-</style>
|
|
|
+ @import "../css/dark-iview-modal.less";
|
|
|
+ @import "../css/dark-iview-tabs.less";
|
|
|
+ @import "../css/dark-iview-collapse.less";
|
|
|
+ @import "../css/dark-iview-form.less";
|
|
|
+ @import "../css/dark-iview-upload.less";
|
|
|
+ @import "../css/dark-iview-table.less";
|
|
|
+ @import "../css/dark-iview-split.less";
|
|
|
+ @import "../css/dark-iview-page.less";
|
|
|
+ @import "../css/custom-animate.less";
|
|
|
+ @import "../css/dark-wang-editor.less";
|
|
|
+ @import "../css/dark-iview-loading.less";
|
|
|
+ @import "../css/disabled-iview-form.less";
|
|
|
+ @import "../css/common-style.less";
|
|
|
+ @import "../css/dark-iview-drawer.less";
|
|
|
+ @import "../css/dark-iview-card.less";
|
|
|
+ @import "../css/dark-iview-poptip.less";
|
|
|
+ @import "../css/dark-iview-checkbox.less";
|
|
|
+ @import "../css/dark-el-cascader.less";
|
|
|
+ @import "../css/dark-iview-style.less";
|
|
|
+ @import "../css/custom-iview.less";
|
|
|
+ @import "../css/light-iview-form.less";
|
|
|
+</style>
|