lrf402788946 пре 5 година
родитељ
комит
db315f3d05

+ 270 - 252
src/router/index.js

@@ -5,7 +5,197 @@ import { Notification } from 'element-ui';
 
 Vue.use(VueRouter);
 
+const system = [
+  // 缺少培训批次
+  {
+    path: '/train/batch/index',
+    name: 'train_batch_index',
+    meta: { title: '培训批次管理' },
+    component: () => import('@/views/train-batch/index.vue'),
+  },
+  {
+    path: '/dept/index',
+    name: 'dept_index',
+    meta: { title: '部门', sub: '管理' },
+    component: () => import('@/views/dept/index.vue'),
+  },
+  {
+    path: '/dept/detail',
+    name: 'dept_detail',
+    meta: { title: '部门', sub: '详情' },
+    component: () => import('@/views/dept/detail.vue'),
+  },
+  {
+    path: '/director/index',
+    name: 'director_index',
+    meta: { title: '班主任', sub: '管理' },
+    component: () => import('@/views/director/index.vue'),
+  },
+  {
+    path: '/director/detail',
+    name: 'director_detail',
+    meta: { title: '班主任', sub: '详情' },
+    component: () => import('@/views/director/detail.vue'),
+  },
+  {
+    path: '/teacher/detail',
+    name: 'teacher_detail',
+    meta: { title: '教师', sub: '详情' },
+    component: () => import('@/views/teacher/detail.vue'),
+  },
+  {
+    path: '/teacher/index',
+    name: 'teacher_index',
+    meta: { title: '教师', sub: '管理' },
+    component: () => import('@/views/teacher/index.vue'),
+  },
+  {
+    path: '/teacher/means',
+    name: 'teacher_means',
+    component: () => import('@/views/teacher/means.vue'),
+  },
+  {
+    path: '/teacher/verify',
+    name: 'teacher_verify',
+    meta: { title: '教师', sub: '审核页' },
+    component: () => import('@/views/teacher/verify.vue'),
+  },
+  {
+    path: '/school/index',
+    name: 'school_index',
+    meta: { title: '学校管理', sub: '' },
+    component: () => import('@/views/school/index.vue'),
+  },
+  {
+    path: '/school/detail',
+    name: 'school_detail',
+    meta: { title: '学校信息', sub: '' },
+    component: () => import('@/views/school/detail.vue'),
+  },
+  {
+    path: '/location/index',
+    name: 'location_index',
+    meta: { title: '地点', sub: '管理' },
+    component: () => import('@/views/location/index.vue'),
+  },
+  {
+    path: '/location/detail',
+    name: 'location_detail',
+    meta: { title: '地点', sub: '详情' },
+    component: () => import('@/views/location/detail.vue'),
+  },
+  {
+    path: '/bedroom/index',
+    name: 'bedroom_index',
+    meta: { title: '寝室', sub: '管理' },
+    component: () => import('@/views/bedroom/index.vue'),
+  },
+  {
+    path: '/bedroom/detail',
+    name: 'bedroom_detail',
+    meta: { title: '寝室', sub: '详情' },
+    component: () => import('@/views/bedroom/detail.vue'),
+  },
+  {
+    path: '/subject/index',
+    name: 'subject_index',
+    meta: { title: '科目', sub: '管理' },
+    component: () => import('@/views/subject/index.vue'),
+  },
+  {
+    path: '/subject/detail',
+    name: 'subject_detail',
+    meta: { title: '科目', sub: '详情' },
+    component: () => import('@/views/subject/detail.vue'),
+  },
+  {
+    path: '/work/detail',
+    name: 'work_detail',
+    meta: { title: '作业', sub: '详情' },
+    component: () => import('@/views/work/detail.vue'),
+  },
+  {
+    path: '/work/index',
+    name: 'work_index',
+    meta: { title: '作业', sub: '管理' },
+    component: () => import('@/views/work/index.vue'),
+  },
+  {
+    path: '/work/look',
+    name: 'work_look',
+    meta: { title: '作业题', sub: '管理' },
+    component: () => import('@/views/work/look.vue'),
+  },
+  {
+    path: '/duty/index',
+    name: 'duty_index',
+    meta: { title: '职责', sub: '说明' },
+    component: () => import('@/views/duty/index.vue'),
+  },
+  {
+    path: '/lesson/index',
+    name: 'lesson_index',
+    meta: { title: '课程模板管理', sub: '' },
+    component: () => import('@/views/lesson/index.vue'),
+  },
+  {
+    path: '/lesson/detail',
+    name: 'lesson_detail',
+    meta: { title: '课程模板', sub: '' },
+    component: () => import('@/views/lesson/detail.vue'),
+  },
+  {
+    path: '/questionnaire/index',
+    name: 'questionnaire_index',
+    meta: { title: '问卷', sub: '管理' },
+    component: () => import('@/views/questionnaire/index.vue'),
+  },
+  {
+    path: '/questionnaire/detail',
+    name: 'questionnaire_detail',
+    meta: { title: '问卷', sub: '详情' },
+    component: () => import('@/views/questionnaire/detail.vue'),
+  },
+
+  {
+    path: '/questionstate/index',
+    name: 'questionstate_index',
+    meta: { title: '问卷进度管理', sub: '' },
+    component: () => import('@/views/questionstate/index.vue'),
+  },
+  {
+    path: '/itembank/detail',
+    name: 'itembank_detail',
+    meta: { title: '题库', sub: '详情' },
+    component: () => import('@/views/Itembank/detail.vue'),
+  },
+  {
+    path: '/itembank/index',
+    name: 'itembank_index',
+    meta: { title: '题库', sub: '管理' },
+    component: () => import('@/views/Itembank/index.vue'),
+  },
+  // {
+  //   path: '/classes/index',
+  //   name: 'classes_index',
+  //   meta: { title: '班级', sub: '管理' },
+  //   component: () => import('@/views/classes/index.vue'),
+  // },
+  // {
+  //   path: '/classes/detail',
+  //   name: 'classes_detail',
+  //   meta: { title: '班级', sub: '详情' },
+  //   component: () => import('@/views/classes/detail.vue'),
+  // },
+  {
+    path: '/setting',
+    name: 'setting',
+    meta: { title: '系统邮箱设置' },
+    component: () => import('@/views/setting/system-setting.vue'),
+  },
+];
 const newPlan = [
+  //缺少:当前计划日历;班主任全年安排;学校总人数设置;学校发参培时间;培训计划详表
   {
     path: '/newPlan/index',
     name: 'newPlan_index',
@@ -67,6 +257,49 @@ const newPlan = [
     component: () => import('@/views/new-plan/class/quest.vue'),
   },
 ];
+
+const train = [
+  //班级设置需要处理,课表管理(按魏老师给的图片做), 通知,学生管理(拿出来,加上searchBar)缺少考勤,学生成绩
+  {
+    path: '/student/index',
+    name: 'student_index',
+    meta: { title: '学生', sub: '管理' },
+    component: () => import('@/views/student/index.vue'),
+  },
+  {
+    path: '/student/detail',
+    name: 'student_detail',
+    meta: { title: '学生', sub: '详情' },
+    component: () => import('@/views/student/detail.vue'),
+  },
+  //报表打印(部分)
+  {
+    path: '/certificaate/index',
+    name: 'certificaate_index',
+    meta: { title: '证书', sub: '管理' },
+    component: () => import('@/views/certificaate/index.vue'),
+  },
+  {
+    path: '/certificaate/detail',
+    name: 'certificaate_detail',
+    meta: { title: '证书', sub: '详情' },
+    component: () => import('@/views/certificaate/detail.vue'),
+  },
+  {
+    path: '/certificaate/look',
+    name: 'certificaate_look',
+    meta: { title: '证书', sub: '打印' },
+    component: () => import('@/views/certificaate/look.vue'),
+  },
+  //报表打印结束
+  {
+    path: '/leave/index',
+    name: 'leave_index',
+    meta: { title: '请假及其退出', sub: '管理' },
+    component: () => import('@/views/leave/index.vue'),
+  },
+];
+
 const statistics = [
   {
     path: '/statistics/question/index',
@@ -84,8 +317,7 @@ const statistics = [
 
 const routes = [
   {
-    path: '/',
-    name: 'frame',
+    path: '',
     component: () => import('@/views/index.vue'),
     children: [
       {
@@ -93,7 +325,9 @@ const routes = [
         name: 'home',
         component: () => import('@/views/home.vue'),
       },
+      ...system,
       ...newPlan,
+      ...train,
       ...statistics,
       {
         path: '/list',
@@ -106,258 +340,42 @@ const routes = [
         component: () => import('@/views/test/detail.vue'),
       },
 
-      {
-        path: '/itembank/detail',
-        name: 'itembank_detail',
-        meta: { title: '题库', sub: '详情' },
-        component: () => import('@/views/Itembank/detail.vue'),
-      },
-      {
-        path: '/itembank/index',
-        name: 'itembank_index',
-        meta: { title: '题库', sub: '管理' },
-        component: () => import('@/views/Itembank/index.vue'),
-      },
-      {
-        path: '/leave/index',
-        name: 'leave_index',
-        meta: { title: '请假及其退出', sub: '管理' },
-        component: () => import('@/views/leave/index.vue'),
-      },
       // {
-      //   path: '/questionstate/detail',
-      //   name: 'questionstate_detail',
-      //   meta: { title: '问卷状态', sub: '详情' },
-      //   component: () => import('@/views/questionstate/detail.vue'),
+      //   path: '/plan/index',
+      //   name: 'plan_index',
+      //   meta: { title: '计划', sub: '管理' },
+      //   component: () => import('@/views/plan/index.vue'),
+      // },
+      // {
+      //   path: '/plan/detail',
+      //   name: 'plan_detail',
+      //   meta: { title: '计划', sub: '详情' },
+      //   component: () => import('@/views/plan/detail.vue'),
+      // },
+      // {
+      //   path: '/plan/classes',
+      //   name: 'plan_classes',
+      //   meta: { title: '安排', sub: '班级' },
+      //   component: () => import('@/views/plan/classes.vue'),
+      // },
+      // {
+      //   path: '/plan/lesson',
+      //   name: 'plan_lesson',
+      //   meta: { title: '安排', sub: '课程' },
+      //   component: () => import('@/views/plan/lesson.vue'),
+      // },
+      // {
+      //   path: '/plan/msg',
+      //   name: 'plan_msg',
+      //   meta: { title: '发送', sub: '通知' },
+      //   component: () => import('@/views/plan/msg.vue'),
+      // },
+      // {
+      //   path: '/plan/question',
+      //   name: 'plan_question',
+      //   meta: { title: '问卷', sub: '管理' },
+      //   component: () => import('@/views/plan/question.vue'),
       // },
-      {
-        path: '/questionstate/index',
-        name: 'questionstate_index',
-        meta: { title: '问卷状态', sub: '管理' },
-        component: () => import('@/views/questionstate/index.vue'),
-      },
-      {
-        path: '/certificaate/index',
-        name: 'certificaate_index',
-        meta: { title: '证书', sub: '管理' },
-        component: () => import('@/views/certificaate/index.vue'),
-      },
-      {
-        path: '/certificaate/detail',
-        name: 'certificaate_detail',
-        meta: { title: '证书', sub: '详情' },
-        component: () => import('@/views/certificaate/detail.vue'),
-      },
-      {
-        path: '/certificaate/look',
-        name: 'certificaate_look',
-        meta: { title: '证书', sub: '打印' },
-        component: () => import('@/views/certificaate/look.vue'),
-      },
-
-      {
-        path: '/questionnaire/index',
-        name: 'questionnaire_index',
-        meta: { title: '问卷', sub: '管理' },
-        component: () => import('@/views/questionnaire/index.vue'),
-      },
-      {
-        path: '/questionnaire/detail',
-        name: 'questionnaire_detail',
-        meta: { title: '问卷', sub: '详情' },
-        component: () => import('@/views/questionnaire/detail.vue'),
-      },
-      {
-        path: '/teacher/detail',
-        name: 'teacher_detail',
-        meta: { title: '教师', sub: '详情' },
-        component: () => import('@/views/teacher/detail.vue'),
-      },
-      {
-        path: '/teacher/index',
-        name: 'teacher_index',
-        meta: { title: '教师', sub: '管理' },
-        component: () => import('@/views/teacher/index.vue'),
-      },
-      {
-        path: '/teacher/means',
-        name: 'teacher_means',
-        component: () => import('@/views/teacher/means.vue'),
-      },
-      {
-        path: '/teacher/verify',
-        name: 'teacher_verify',
-        meta: { title: '教师', sub: '审核页' },
-        component: () => import('@/views/teacher/verify.vue'),
-      },
-      {
-        path: '/work/detail',
-        name: 'work_detail',
-        meta: { title: '作业', sub: '详情' },
-        component: () => import('@/views/work/detail.vue'),
-      },
-      {
-        path: '/work/index',
-        name: 'work_index',
-        meta: { title: '作业', sub: '管理' },
-        component: () => import('@/views/work/index.vue'),
-      },
-      {
-        path: '/work/look',
-        name: 'work_look',
-        meta: { title: '作业题', sub: '管理' },
-        component: () => import('@/views/work/look.vue'),
-      },
-      {
-        path: '/subject/index',
-        name: 'subject_index',
-        meta: { title: '科目', sub: '管理' },
-        component: () => import('@/views/subject/index.vue'),
-      },
-      {
-        path: '/subject/detail',
-        name: 'subject_detail',
-        meta: { title: '科目', sub: '详情' },
-        component: () => import('@/views/subject/detail.vue'),
-      },
-      {
-        path: '/director/index',
-        name: 'director_index',
-        meta: { title: '班主任', sub: '管理' },
-        component: () => import('@/views/director/index.vue'),
-      },
-      {
-        path: '/director/detail',
-        name: 'director_detail',
-        meta: { title: '班主任', sub: '详情' },
-        component: () => import('@/views/director/detail.vue'),
-      },
-      {
-        path: '/dept/index',
-        name: 'dept_index',
-        meta: { title: '部门', sub: '管理' },
-        component: () => import('@/views/dept/index.vue'),
-      },
-      {
-        path: '/dept/detail',
-        name: 'dept_detail',
-        meta: { title: '部门', sub: '详情' },
-        component: () => import('@/views/dept/detail.vue'),
-      },
-      {
-        path: '/duty/index',
-        name: 'duty_index',
-        meta: { title: '职责', sub: '说明' },
-        component: () => import('@/views/duty/index.vue'),
-      },
-      {
-        path: '/location/index',
-        name: 'location_index',
-        meta: { title: '地点', sub: '管理' },
-        component: () => import('@/views/location/index.vue'),
-      },
-      {
-        path: '/location/detail',
-        name: 'location_detail',
-        meta: { title: '地点', sub: '详情' },
-        component: () => import('@/views/location/detail.vue'),
-      },
-      {
-        path: '/bedroom/index',
-        name: 'bedroom_index',
-        meta: { title: '寝室', sub: '管理' },
-        component: () => import('@/views/bedroom/index.vue'),
-      },
-      {
-        path: '/bedroom/detail',
-        name: 'bedroom_detail',
-        meta: { title: '寝室', sub: '详情' },
-        component: () => import('@/views/bedroom/detail.vue'),
-      },
-      {
-        path: '/classes/index',
-        name: 'classes_index',
-        meta: { title: '班级', sub: '管理' },
-        component: () => import('@/views/classes/index.vue'),
-      },
-      {
-        path: '/classes/detail',
-        name: 'classes_detail',
-        meta: { title: '班级', sub: '详情' },
-        component: () => import('@/views/classes/detail.vue'),
-      },
-      {
-        path: '/student/index',
-        name: 'student_index',
-        meta: { title: '学生', sub: '管理' },
-        component: () => import('@/views/student/index.vue'),
-      },
-      {
-        path: '/student/detail',
-        name: 'student_detail',
-        meta: { title: '学生', sub: '详情' },
-        component: () => import('@/views/student/detail.vue'),
-      },
-      {
-        path: '/plan/index',
-        name: 'plan_index',
-        meta: { title: '计划', sub: '管理' },
-        component: () => import('@/views/plan/index.vue'),
-      },
-      {
-        path: '/plan/detail',
-        name: 'plan_detail',
-        meta: { title: '计划', sub: '详情' },
-        component: () => import('@/views/plan/detail.vue'),
-      },
-      {
-        path: '/plan/classes',
-        name: 'plan_classes',
-        meta: { title: '安排', sub: '班级' },
-        component: () => import('@/views/plan/classes.vue'),
-      },
-      {
-        path: '/plan/lesson',
-        name: 'plan_lesson',
-        meta: { title: '安排', sub: '课程' },
-        component: () => import('@/views/plan/lesson.vue'),
-      },
-      {
-        path: '/plan/msg',
-        name: 'plan_msg',
-        meta: { title: '发送', sub: '通知' },
-        component: () => import('@/views/plan/msg.vue'),
-      },
-      {
-        path: '/plan/question',
-        name: 'plan_question',
-        meta: { title: '问卷', sub: '管理' },
-        component: () => import('@/views/plan/question.vue'),
-      },
-      {
-        path: '/lesson/index',
-        name: 'lesson_index',
-        meta: { title: '课程模板管理', sub: '' },
-        component: () => import('@/views/lesson/index.vue'),
-      },
-      {
-        path: '/lesson/detail',
-        name: 'lesson_detail',
-        meta: { title: '课程模板', sub: '' },
-        component: () => import('@/views/lesson/detail.vue'),
-      },
-      {
-        path: '/school/index',
-        name: 'school_index',
-        meta: { title: '学校管理', sub: '' },
-        component: () => import('@/views/school/index.vue'),
-      },
-      {
-        path: '/school/detail',
-        name: 'school_detail',
-        meta: { title: '学校信息', sub: '' },
-        component: () => import('@/views/school/detail.vue'),
-      },
     ],
   },
   {

+ 7 - 1
src/views/new-plan/class/index-class.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="index">
     <list-frame :title="pageTitle" @query="search" :total="total" :needFilter="false" :needAdd="false">
+      <searchBar :allow="['planBatch', 'plan', 'term', 'batch', 'classes']"></searchBar>
       <data-table
         :fields="fields"
         :data="list"
@@ -21,6 +22,7 @@
 var moment = require('moment');
 import _ from 'lodash';
 import Vue from 'vue';
+import searchBar from '@frame/components/search-bar';
 import listFrame from '@frame/layout/admin/list-frame';
 import dataTable from '@frame/components/data-table';
 import { mapState, createNamespacedHelpers } from 'vuex';
@@ -29,7 +31,11 @@ const { mapActions: classes } = createNamespacedHelpers('classes');
 export default {
   name: 'index',
   props: {},
-  components: { listFrame, dataTable },
+  components: {
+    listFrame,
+    dataTable,
+    searchBar,
+  },
   data: () => {
     return {
       dialog: false,

+ 44 - 0
src/views/setting/system-setting.vue

@@ -0,0 +1,44 @@
+<template>
+  <div id="system-setting">
+    <detail-frame :title="pageTitle">
+      <data-form :data="form" :fields="fields" :rules="rules" @save="handleSave" :isNew="isNew"> </data-form>
+    </detail-frame>
+  </div>
+</template>
+
+<script>
+import detailFrame from '@frame/layout/admin/detail-frame';
+import dataForm from '@frame/components/form';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'system-setting',
+  props: {},
+  components: { dataForm, detailFrame },
+  data: function() {
+    return {
+      form: {},
+      fields: [
+        { label: '系统邮箱', required: true, model: 'email' },
+        { label: '邮箱密码', required: true, model: 'emailpw', type: 'password' },
+      ],
+      rules: {
+        email: [{ required: true, message: '请输入系统邮箱' }],
+        emailpw: [{ required: true, message: '请输入系统邮箱密码' }],
+      },
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 91 - 0
src/views/train-batch/index.vue

@@ -0,0 +1,91 @@
+<template>
+  <div id="index">
+    <listFrame :title="pageTitle">
+      <el-card v-if="view == 'list'">
+        <el-row type="flex" align="middle" justify="end">
+          <el-col :span="2">
+            <el-button type="primary" size="mini" @click="toAdd" icon="el-icon-plus">添加</el-button>
+          </el-col>
+        </el-row>
+        <data-table :fields="fields" :data="list" :opera="opera" :total="total" @edit="toEdit" @query="search"></data-table>
+      </el-card>
+      <el-card v-else>
+        <template #header>
+          <el-button icon="el-icon-arrow-left" type="text" @click="toBack">返回</el-button>
+        </template>
+        <data-form :data="form" :fields="formFields" :rules="rules" @save="handleSave" :isNew="form.id"> </data-form>
+      </el-card>
+    </listFrame>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import listFrame from '@frame/layout/admin/detail-frame';
+import dataForm from '@frame/components/form';
+import dataTable from '@frame/components/filter-page-table';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: { dataTable, listFrame, dataForm },
+  data: function() {
+    return {
+      view: 'list',
+      list: [],
+      opera: [
+        {
+          label: '修改',
+          icon: 'el-icon-edit',
+          method: 'edit',
+        },
+      ],
+      fields: [
+        { label: '标题', prop: 'title' },
+        { label: '状态', prop: 'status' },
+      ],
+      formFields: [{ label: '标题', model: 'title', required: true }],
+      rules: {},
+      total: 0,
+      form: {},
+    };
+  },
+  created() {},
+  methods: {
+    async search({ skip = 0, limit = 10, ...info } = {}) {},
+    toAdd() {
+      this.view = 'detail';
+    },
+    toEdit({ data }) {
+      this.$set(this, `form`, _.cloneDeep(data));
+      this.toAdd();
+    },
+    toBack() {
+      this.view = 'list';
+      this.form = {};
+    },
+    async handleSave({ data, isNew }) {
+      let duplicate = _.cloneDeep(data);
+      let res, msg;
+      if (isNew) (res = await this.create(data)), (msg = '添加');
+      else (res = await this.update(data)), (msg = '修改');
+      if (this.$checkRes(res, msg, res.errmsg)) this.toBack();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.el-row {
+  margin: 15px 0;
+}
+</style>