diff --git a/package.json b/package.json index 1cf809c..9648486 100755 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "babel-core": "^6.22.1", "babel-loader": "^7.1.1", "babel-eslint": "^10.1.0", + "babel-polyfill": "^6.26.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", "extract-text-webpack-plugin": "^3.0.0", diff --git a/src/assets/css/base.css b/src/assets/css/base.css new file mode 100644 index 0000000..ca347da --- /dev/null +++ b/src/assets/css/base.css @@ -0,0 +1,20 @@ +* { + margin: 0px; + padding: 0px; +} +html, +body { + height:100%; + overflow: hidden; + background-color: #fff; + font-size: 14px; + color: #333333; +} + +li { + list-style: none; +} + +a { + text-decoration: none; +} \ No newline at end of file diff --git a/src/assets/nav/analysis.png b/src/assets/nav/analysis.png new file mode 100644 index 0000000..1d96646 --- /dev/null +++ b/src/assets/nav/analysis.png diff --git a/src/assets/nav/ask.png b/src/assets/nav/ask.png new file mode 100644 index 0000000..1d96646 --- /dev/null +++ b/src/assets/nav/ask.png diff --git a/src/assets/nav/card.png b/src/assets/nav/card.png new file mode 100644 index 0000000..615c6cc --- /dev/null +++ b/src/assets/nav/card.png diff --git a/src/assets/nav/device.png b/src/assets/nav/device.png new file mode 100644 index 0000000..230629e --- /dev/null +++ b/src/assets/nav/device.png diff --git a/src/assets/nav/down.png b/src/assets/nav/down.png new file mode 100644 index 0000000..618d034 --- /dev/null +++ b/src/assets/nav/down.png diff --git a/src/assets/nav/examinationPaper.png b/src/assets/nav/examinationPaper.png new file mode 100644 index 0000000..5fd7b09 --- /dev/null +++ b/src/assets/nav/examinationPaper.png diff --git a/src/assets/nav/portrait.png b/src/assets/nav/portrait.png new file mode 100644 index 0000000..230629e --- /dev/null +++ b/src/assets/nav/portrait.png diff --git a/src/assets/nav/setUpAccount.png b/src/assets/nav/setUpAccount.png new file mode 100644 index 0000000..5fd7b09 --- /dev/null +++ b/src/assets/nav/setUpAccount.png diff --git a/src/assets/nav/setUpConglomerate.png b/src/assets/nav/setUpConglomerate.png new file mode 100644 index 0000000..5fd7b09 --- /dev/null +++ b/src/assets/nav/setUpConglomerate.png diff --git a/src/assets/nav/setUpSchool.png b/src/assets/nav/setUpSchool.png new file mode 100644 index 0000000..7f10e85 --- /dev/null +++ b/src/assets/nav/setUpSchool.png diff --git a/src/assets/nav/test.png b/src/assets/nav/test.png new file mode 100644 index 0000000..7f10e85 --- /dev/null +++ b/src/assets/nav/test.png diff --git a/src/components/ECharts/lineEcharts.vue b/src/components/ECharts/lineEcharts.vue index 173da34..c89f16e 100644 --- a/src/components/ECharts/lineEcharts.vue +++ b/src/components/ECharts/lineEcharts.vue @@ -96,7 +96,20 @@ export default { } ] }) - } + + this.selfAdaption() + }, + // echart自适应 + selfAdaption() { + let that = this; + setTimeout(() => { + window.onresize = function () { + if (that.$refs.echarts) { + that.$refs.echarts.chart.resize(); + } + }; + }, 10); + }, } } diff --git a/src/components/backBox.vue b/src/components/backBox.vue new file mode 100644 index 0000000..2d3a4bc --- /dev/null +++ b/src/components/backBox.vue @@ -0,0 +1,52 @@ + + + + + \ No newline at end of file diff --git a/src/components/globalComponents.js b/src/components/globalComponents.js new file mode 100644 index 0000000..0f68d39 --- /dev/null +++ b/src/components/globalComponents.js @@ -0,0 +1,21 @@ +import Vue from "vue"; +/** + * require.context(directory .useSubdirectories ,regExp ) + * directory :-读取文件路径 + * useSubdirectories :-是够遍历文件子目录 + * regExp :匹配文件正则 + */ + +function changeStr(str) { + return str.charAt(str).toUpperCase() + str.slice(1) +} +const requireComponent = require.context("./", false, /\.vue$/); + +requireComponent.keys().forEach((fileName) => { + let config = requireComponent(fileName); + let componentName = changeStr( + fileName.replace(/\.\//, "").replace(/\.\w+$/, "") + ); + Vue.component(componentName, config.default || config); +}); + diff --git a/src/main.js b/src/main.js index 51fd014..fb0c9bc 100755 --- a/src/main.js +++ b/src/main.js @@ -9,11 +9,15 @@ import i18n from "./i18n/i18n" import globalPlugin from "./utils/global" import permission from "./directive/permission/button" import NProgress from "nprogress" +import "babel-polyfill" +import '@/components/globalComponents.js' + import "nprogress/nprogress.css" import "element-ui/lib/theme-chalk/index.css" import "font-awesome/css/font-awesome.css" import "@/router/permission" +import "@/assets/css/base.css" Vue.config.productionTip = false Vue.use(ElementUI) @@ -30,6 +34,4 @@ new Vue({ store, i18n, render: h => h(App), - components: {App}, - template: "" }) diff --git a/src/router/permission.js b/src/router/permission.js index 592b68a..4b82f18 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -17,6 +17,7 @@ const TestAnalysis = () => import("@/views/test/analysis") const DataSync = () => import("@/views/dataSync/index") const Portrait = () => import("@/views/portrait/index") const Card = () => import("@/views/card/index") +const Analysis = () => import("@/views/analysis/index") const Device = () => import("@/views/device/index") const Down = () => import("@/views/down/index") const DownClient = () => import("@/views/down/client") @@ -127,42 +128,45 @@ let addrouters = [ //测试用,后续后端获取 } ] }, + { - path: "/dataSync", - iconCls: "fa fa-random", // 图标样式class - name: "数据同步", + path: "/setUpConglomerate", + iconCls: "fa fa-building", // 图标样式class + name: "学校管理", component: Layout, alone: true, children: [ { - path: "/dataSync", - iconCls: "fa fa-random", // 图标样式class - name: "", - component: DataSync, + path: "/setUpConglomerate", + iconCls: "fa fa-building", + name: '集团管理', + component: SetUpConglomerate, children: [] - } + }, ] }, { - path: "/", - iconCls: "fa fa-cog", - name: '信息管理', + path: "/setUpAccount", + iconCls: "fa fa-id-card-o", // 图标样式class + name: "账号管理", component: Layout, + alone: true, children: [ { path: "/setUpAccount", iconCls: "fa fa-id-card-o", - name: '账号管理', + name: '', component: SetUpAccount, children: [] }, - { - path: "/setUpConglomerate", - iconCls: "fa fa-building", - name: '集团管理', - component: SetUpConglomerate, - children: [] - }, + ] + }, + { + path: "/", + iconCls: "fa fa-cog", + name: '学校管理', + component: Layout, + children: [ { path: "/setUpSchool", iconCls: "fa fa-calculator", @@ -219,6 +223,22 @@ let addrouters = [ //测试用,后续后端获取 ] }, { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "使用分析", + component: Layout, + alone: true, + children: [ + { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "", + component: Analysis, + children: [] + } + ] + }, + { path: "/down", iconCls: "fa fa-download", // 图标样式class name: "软件下载", @@ -241,7 +261,22 @@ let addrouters = [ //测试用,后续后端获取 } ] }, - + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "数据同步", + component: Layout, + alone: true, + children: [ + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "", + component: DataSync, + children: [] + } + ] + }, { path: "*", redirect: "/404", @@ -268,7 +303,7 @@ router.beforeEach((to, from, next) => { roleName: "超级管理员" } ], - name: "张老师", + name: "李老师", // avatar: data.avatar ? data.avatar : "", // uid: data.id, // authorityRouter:[], @@ -276,7 +311,6 @@ router.beforeEach((to, from, next) => { }) await store.commit("setRouters", addrouters) let newAddRouters = store.getters.addRouters - // await router.addRoutes(newAddRouters) newAddRouters.forEach(res => { router.addRoute(res) }) diff --git a/src/store/index.js b/src/store/index.js index 70126cd..a6a2304 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -20,6 +20,7 @@ const TestAnalysis = () => import("@/views/test/analysis") const DataSync = () => import("@/views/dataSync/index") const Portrait = () => import("@/views/portrait/index") const Card = () => import("@/views/card/index") +const Analysis = () => import("@/views/analysis/index") const Device = () => import("@/views/device/index") const Down = () => import("@/views/down/index") const DownClient = () => import("@/views/down/client") @@ -130,42 +131,45 @@ let addrouters = [ //测试用,后续后端获取 } ] }, + { - path: "/dataSync", - iconCls: "fa fa-random", // 图标样式class - name: "数据同步", + path: "/setUpConglomerate", + iconCls: "fa fa-building", // 图标样式class + name: "学校管理", component: Layout, alone: true, children: [ { - path: "/dataSync", - iconCls: "fa fa-random", // 图标样式class - name: "", - component: DataSync, + path: "/setUpConglomerate", + iconCls: "fa fa-building", + name: '集团管理', + component: SetUpConglomerate, children: [] - } + }, ] }, { - path: "/", - iconCls: "fa fa-cog", - name: '信息管理', + path: "/setUpAccount", + iconCls: "fa fa-id-card-o", // 图标样式class + name: "账号管理", component: Layout, + alone: true, children: [ { path: "/setUpAccount", iconCls: "fa fa-id-card-o", - name: '账号管理', + name: '', component: SetUpAccount, children: [] }, - { - path: "/setUpConglomerate", - iconCls: "fa fa-building", - name: '集团管理', - component: SetUpConglomerate, - children: [] - }, + ] + }, + { + path: "/", + iconCls: "fa fa-cog", + name: '学校管理', + component: Layout, + children: [ { path: "/setUpSchool", iconCls: "fa fa-calculator", @@ -222,6 +226,22 @@ let addrouters = [ //测试用,后续后端获取 ] }, { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "使用分析", + component: Layout, + alone: true, + children: [ + { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "", + component: Analysis, + children: [] + } + ] + }, + { path: "/down", iconCls: "fa fa-download", // 图标样式class name: "软件下载", @@ -244,7 +264,22 @@ let addrouters = [ //测试用,后续后端获取 } ] }, - + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "数据同步", + component: Layout, + alone: true, + children: [ + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "", + component: DataSync, + children: [] + } + ] + }, { path: "*", redirect: "/404", @@ -301,8 +336,6 @@ const store = new Vuex.Store({ // authorityRouter:[], }); commit("setRouters", addrouters) - // let newAddRouters = getters.addRouters; - // await router.addRoutes(newAddRouters) addrouters.forEach((res) => { that.$router.addRoute(res); }); @@ -327,8 +360,6 @@ const store = new Vuex.Store({ // authorityRouter:[], }); commit("setRouters", addrouters) - // let newAddRouters = getters.addRouters; - // await router.addRoutes(newAddRouters) addrouters.forEach((res) => { that.$router.addRoute(res); }); diff --git a/src/utils/global.js b/src/utils/global.js index 209ff0b..d9d4423 100644 --- a/src/utils/global.js +++ b/src/utils/global.js @@ -7,98 +7,5 @@ export default { Vue.prototype.$echarts = echarts Vue.prototype.$request = request Vue.prototype.$rules = rules - /** 时间字符串 - * @method $getDateDiff - * @param timespan - */ - Vue.prototype.$getDateDiff = function (timespan) { - var dateTime = new Date(timespan) - var year = dateTime.getFullYear() - var month = (dateTime.getMonth() + 1) < 10 ? "0" + (dateTime.getMonth() + 1) : (dateTime.getMonth() + 1) - var day = dateTime.getDate() < 10 ? "0" + dateTime.getDate() : dateTime.getDate() - var hour = dateTime.getHours() < 10 ? "0" + dateTime.getHours() : dateTime.getHours() - var minute = dateTime.getMinutes() < 10 ? "0" + dateTime.getMinutes() : dateTime.getMinutes() - var seconds = dateTime.getSeconds() < 10 ? "0" + dateTime.getSeconds() : dateTime.getSeconds() - var now = new Date() - var nowNew = now.getTime() - var milliseconds = 0 - var timeSpanStr - milliseconds = nowNew - dateTime - - if (milliseconds <= 1000 * 60 * 1) { - timeSpanStr = "刚刚" - } else if (1000 * 60 * 1 < milliseconds && milliseconds <= 1000 * 60 * 60) { - timeSpanStr = Math.round((milliseconds / (1000 * 60))) + "分钟前" - } else if (1000 * 60 * 60 * 1 < milliseconds && milliseconds <= 1000 * 60 * 60 * 24) { - timeSpanStr = Math.round(milliseconds / (1000 * 60 * 60)) + "小时前" - } else if (1000 * 60 * 60 * 24 < milliseconds && milliseconds <= 1000 * 60 * 60 * 24 * 3) { - timeSpanStr = Math.round(milliseconds / (1000 * 60 * 60 * 24)) + "天前" - } else if (milliseconds > 1000 * 60 * 60 * 24 * 3 && year === now.getFullYear()) { - timeSpanStr = month + "-" + day + " " + hour + ":" + minute + ":" + seconds - } else { - timeSpanStr = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + seconds - } - return timeSpanStr - } - - /** 当前地址ip - * @method $path - * @param {} - */ - Vue.prototype.$path = process.env.API_HOST - - /** 传入路径转换成完整连接 - * @method $getPath - * @param {url: 路径} - */ - Vue.prototype.$getPath = function (url) { - const base = process.env.API_HOST - if (/^http/.test(url)) return url - return base + url - } - /** 是否开发模式 - * @method $env - * @param {} - */ - Vue.prototype.$env = process.env.NODE_ENV - - /** 导出,下载处理文件流 - * @method $exportClick - * @param {res:文件流,name : 下载文件名} - */ - Vue.prototype.$exportClick = function (res, name = "下载.zip") { - const content = res - const blob = new Blob([content]) - const fileName = name - if ("download" in document.createElement("a")) { // 非IE下载 - const elink = document.createElement("a") - elink.download = fileName - elink.style.display = "none" - elink.href = URL.createObjectURL(blob) - document.body.appendChild(elink) - elink.click() - URL.revokeObjectURL(elink.href) // 释放URL 对象 - document.body.removeChild(elink) - } else { // IE10+下载 - navigator.msSaveBlob(blob, fileName) - } - } - - /** 当res.code === 200 时 - * @method $restBack - * @param res - * @param fn - * @param message - * @param type - */ - Vue.prototype.$restBack = function (res, fn = () => {}, message, type = "success") { - if (res.code === 200) { - this.$message({ - message: message || res.message, - type: type - }) - fn() - } - } } } diff --git a/src/views/analysis/index.vue b/src/views/analysis/index.vue new file mode 100644 index 0000000..217956a --- /dev/null +++ b/src/views/analysis/index.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue index 760f495..c310df1 100644 --- a/src/views/examinationPaper/index.vue +++ b/src/views/examinationPaper/index.vue @@ -1,18 +1,29 @@ - \ No newline at end of file diff --git a/src/views/index/mainIndex.vue b/src/views/index/mainIndex.vue index 982e4c6..2cd695e 100644 --- a/src/views/index/mainIndex.vue +++ b/src/views/index/mainIndex.vue @@ -1,137 +1,296 @@ diff --git a/src/views/layout/aside/aside.vue b/src/views/layout/aside/aside.vue index 46aefd8..42ea568 100644 --- a/src/views/layout/aside/aside.vue +++ b/src/views/layout/aside/aside.vue @@ -2,9 +2,16 @@
- -

中天易教

- + +
@@ -120,13 +127,13 @@ $right: right; align-items: center; width: 100%; height: 50px; - padding:0 16px; + padding: 0 16px; box-sizing: border-box; @extend %w100; - .logo{ - width:24px; - height:24px; - margin-right:10px; + .logo { + width: 24px; + height: 24px; + margin-right: 10px; } p { line-height: 50px; diff --git a/src/views/layout/header/header.vue b/src/views/layout/header/header.vue index b974a34..c090f47 100644 --- a/src/views/layout/header/header.vue +++ b/src/views/layout/header/header.vue @@ -2,8 +2,8 @@
+ > +