├── static ├── .gitkeep └── img │ └── screenshot.png ├── .eslintignore ├── config ├── prod.env.js ├── test.env.js ├── dev.env.js └── index.js ├── favicon.ico ├── src ├── store │ ├── getters.js │ ├── mutation-types.js │ ├── mutations.js │ ├── actions.js │ ├── index.js │ └── modules │ │ └── account.js ├── assets │ ├── logo.png │ └── common.scss ├── utils │ ├── md5.js │ ├── util.js │ ├── proxy.js │ └── http.js ├── services │ ├── model │ │ ├── AccountVO.js │ │ ├── CommonVO.js │ │ ├── RoleVO.js │ │ ├── CampusVO.js │ │ ├── SchoolVO.js │ │ ├── SubjectVO.js │ │ ├── ClassroomVO.js │ │ └── TeacherVO.js │ ├── role.js │ ├── subject.js │ ├── common.js │ ├── classroom.js │ ├── account.js │ ├── teacher.js │ ├── campus.js │ └── API.js ├── views │ ├── main │ │ ├── Index.vue │ │ ├── RoleManage.vue │ │ ├── CampusManage.vue │ │ ├── ClassroomManage.vue │ │ └── TeacherManage.vue │ ├── NotFound.vue │ ├── Home.vue │ ├── Index.vue │ ├── Login.vue │ └── Regist.vue ├── components │ ├── Breadcrumb.vue │ ├── PageProgress.vue │ ├── Header.vue │ ├── Sidebar.vue │ └── UIComponents.js ├── App.vue ├── main.js ├── filters │ └── index.js └── routes │ └── index.js ├── test ├── unit │ ├── .eslintrc │ ├── specs │ │ └── Hello.spec.js │ ├── index.js │ └── karma.conf.js └── e2e │ ├── specs │ └── test.js │ ├── custom-assertions │ └── elementCount.js │ ├── runner.js │ └── nightwatch.conf.js ├── .editorconfig ├── .postcssrc.js ├── index.html ├── .gitignore ├── mock ├── login.js ├── get_roles.js ├── get_regions.js ├── get_schools.js ├── get_classrooms.js └── get_region_teachers.js ├── .babelrc ├── .eslintrc.js ├── README.md └── package.json /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping6688/vue-spa-project/HEAD/favicon.ico -------------------------------------------------------------------------------- /src/store/getters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 全局getters函数 3 | */ 4 | 5 | export { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping6688/vue-spa-project/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /static/img/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping6688/vue-spa-project/HEAD/static/img/screenshot.png -------------------------------------------------------------------------------- /src/utils/md5.js: -------------------------------------------------------------------------------- 1 | /** 2 | * md5加密(with secretkey) 3 | */ 4 | 5 | import md5 from 'blueimp-md5' 6 | 7 | export default value => md5(value, 'tal') 8 | -------------------------------------------------------------------------------- /test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /src/services/model/AccountVO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 账号信息VO 3 | */ 4 | 5 | export default class AccountVO { 6 | constructor (data) { 7 | this.userId = data || '' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * mutation类型配置 3 | */ 4 | 5 | export const SET_PAGE_PROGRESS = 'SET_PAGE_PROGRESS' 6 | export const RESET_STATE = 'RESET_STATE' 7 | 8 | export const SET_ACCOUNT = 'SET_ACCOUNT' 9 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/services/model/CommonVO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 通用信息VO 3 | */ 4 | 5 | export default class CommonVO { 6 | constructor (data) { 7 | data = data || {} 8 | 9 | this.id = data.id || '' 10 | this.name = data.name || '' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/services/model/RoleVO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 角色信息VO 3 | */ 4 | 5 | export default class RoleVO { 6 | constructor (data) { 7 | data = data || {} 8 | 9 | this.id = data.role_id || '' 10 | this.name = data.role_name || '' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |5 | 显示一些数据统计、分析等图文信息... 6 |
7 |404,没有找到文件!
3 | 4 | 5 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /src/utils/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 工具类、实用函数 3 | * @see lodash 4 | */ 5 | 6 | /** 7 | * 找出第一个符合条件的数组成员 8 | */ 9 | export function findItem (arr, key, value) { 10 | return arr.find(item => item[key] === value) 11 | } 12 | 13 | export function findNameById (arr, id) { 14 | let item = findItem(arr, 'id', id) 15 | return item ? item.name : '' 16 | } 17 | -------------------------------------------------------------------------------- /src/store/mutations.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 全局mutation处理 3 | */ 4 | 5 | import * as types from './mutation-types' 6 | 7 | export const state = { 8 | pageProgress: 0 9 | } 10 | 11 | export const mutations = { 12 | // 设置页面进度 13 | [types.SET_PAGE_PROGRESS] (state, progress) { 14 | state.pageProgress = progress 15 | }, 16 | // 重置state 17 | [types.RESET_STATE] (state) { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/unit/specs/Hello.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Hello from '@/components/Hello' 3 | 4 | describe('Hello.vue', () => { 5 | it('should render correct contents', () => { 6 | const Constructor = Vue.extend(Hello) 7 | const vm = new Constructor().$mount() 8 | expect(vm.$el.querySelector('.hello h1').textContent) 9 | .to.equal('Welcome to Your Vue.js App') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /src/services/model/TeacherVO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 教师信息VO 3 | */ 4 | 5 | export default class TeacherVO { 6 | constructor (data) { 7 | data = data || {} 8 | 9 | this.teacherId = data.teacher_id || '' 10 | this.teacherName = data.teacher_name || '' 11 | this.mobile = data.mobile || '' 12 | this.roleName = data.role_name || '' 13 | this.subjectName = data.subject_name || '' 14 | this.campusName = data.campus_name || '' 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/assets/common.scss: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | background-color: #d2d6de;; 6 | height: 100%; 7 | } 8 | 9 | .textspan { 10 | color: #99a9bf; 11 | padding: 10px 15px; 12 | float: right; 13 | font-size: 14px; 14 | } 15 | 16 | .queryinput { 17 | width: 90%; 18 | } -------------------------------------------------------------------------------- /src/store/actions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 全局action处理 3 | */ 4 | 5 | import * as types from './mutation-types' 6 | 7 | /** 8 | * 设置页面进度 9 | */ 10 | export const setPageProgress = ({ commit }, progress) => { 11 | commit(types.SET_PAGE_PROGRESS, progress) 12 | if (progress === 100) { 13 | setTimeout(() => { 14 | commit(types.SET_PAGE_PROGRESS, 0) 15 | }, 500) 16 | } 17 | } 18 | 19 | /** 20 | * 重置STORE 21 | */ 22 | export const resetStore = ({ commit }) => { 23 | commit(types.RESET_STATE) 24 | } 25 | -------------------------------------------------------------------------------- /mock/get_roles.js: -------------------------------------------------------------------------------- 1 | const faker = require('faker') 2 | faker.locale = 'zh_CN' 3 | 4 | module.exports = { 5 | api: '/mock/edu_rest/acquire_role/:id', 6 | response: function (req, res) { 7 | res.json({ 8 | rlt: 'true', 9 | msg: 'ok', 10 | data: [ 11 | { role_id: faker.random.uuid(), role_name: faker.random.words() }, 12 | { role_id: faker.random.uuid(), role_name: faker.random.words() }, 13 | { role_id: faker.random.uuid(), role_name: faker.random.words() } 14 | ] 15 | }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /mock/get_regions.js: -------------------------------------------------------------------------------- 1 | const faker = require('faker') 2 | faker.locale = 'zh_CN' 3 | 4 | module.exports = { 5 | api: '/mock/edu_rest/acquire_campus/:id', 6 | response: function (req, res) { 7 | res.json({ 8 | rlt: 'true', 9 | msg: 'ok', 10 | data: [ 11 | { campus_id: faker.random.uuid(), campus_name: faker.address.city() }, 12 | { campus_id: faker.random.uuid(), campus_name: faker.address.city() }, 13 | { campus_id: faker.random.uuid(), campus_name: faker.address.city() } 14 | ] 15 | }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": [ 12 | "transform-runtime", 13 | "syntax-dynamic-import", 14 | ["component", [{ 15 | "libraryName": "element-ui", 16 | "styleLibraryName": "theme-default" 17 | }]] 18 | ], 19 | "env": { 20 | "test": { 21 | "presets": ["env", "stage-2"], 22 | "plugins": ["istanbul"] 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /mock/get_schools.js: -------------------------------------------------------------------------------- 1 | const faker = require('faker') 2 | faker.locale = 'zh_CN' 3 | 4 | module.exports = { 5 | api: '/mock/edu_rest/acquire_school/:id', 6 | response: function (req, res) { 7 | res.json({ 8 | rlt: 'true', 9 | msg: 'ok', 10 | data: [ 11 | { school_id: faker.random.uuid(), school_name: faker.address.streetName() }, 12 | { school_id: faker.random.uuid(), school_name: faker.address.streetName() }, 13 | { school_id: faker.random.uuid(), school_name: faker.address.streetName() } 14 | ] 15 | }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /mock/get_classrooms.js: -------------------------------------------------------------------------------- 1 | const faker = require('faker') 2 | faker.locale = 'zh_CN' 3 | 4 | module.exports = { 5 | api: '/mock/edu_rest/acquire_school_room/:id', 6 | response: function (req, res) { 7 | res.json({ 8 | rlt: 'true', 9 | msg: 'ok', 10 | data: [ 11 | { classroom_id: faker.random.uuid(), classroom_name: faker.random.words() }, 12 | { classroom_id: faker.random.uuid(), classroom_name: faker.random.words() }, 13 | { classroom_id: faker.random.uuid(), classroom_name: faker.random.words() } 14 | ] 15 | }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | /** 2 | * 面包屑组件 3 | */ 4 | 5 | 6 |
12 |