浏览代码

完成课程管理基础信息设置API对接

liqk 5 年之前
父节点
当前提交
d2f9588c53

+ 5 - 14
TEAMModelOS.Service/Models/Courses/Course.cs

@@ -86,7 +86,7 @@ namespace TEAMModelOS.Service.Models.Courses
         /// <summary>
         /// <summary>
         /// 上课频率 每日、每周、每月、临时课程
         /// 上课频率 每日、每周、每月、临时课程
         /// </summary>
         /// </summary>
-        public string frequency { get; set; }
+        public string frequencyCode { get; set; }
         /// <summary>
         /// <summary>
         /// 课程开始时间
         /// 课程开始时间
         /// </summary>
         /// </summary>
@@ -98,28 +98,19 @@ namespace TEAMModelOS.Service.Models.Courses
         /// <summary>
         /// <summary>
         /// 上课班级/教室
         /// 上课班级/教室
         /// </summary>
         /// </summary>
-        public List<string> classroomCode { get; set; } // Classroom
+        public string classroomCode { get; set; } // Classroom
         /// <summary>
         /// <summary>
         /// 临时课程
         /// 临时课程
         /// </summary>
         /// </summary>
-        public string interim { get; set; }
+        public string frequencyName { get; set; }
         /// <summary>
         /// <summary>
         /// 每月课程
         /// 每月课程
         /// </summary>
         /// </summary>
-        public string moth { get; set; }
+        //public string month { get; set; }
         /// <summary>
         /// <summary>
         /// 每周课程
         /// 每周课程
         /// </summary>
         /// </summary>
-        public List<Week> weekly { get; set; }
+        //public string weekly { get; set; }
 
 
     }
     }
-
-    /// <summary>
-    /// 每周课程
-    /// </summary>
-    public class Week {
-        public string weekName { get; set; }
-        public string weekCode { get; set; }
-    }
-
 }
 }

+ 12 - 0
TEAMModelOS/ClientApp/src/api/courseMgmt.js

@@ -0,0 +1,12 @@
+import { fetch, post } from '@/filters/http'
+export default {
+  findCourse: function (data) {
+    return post('/api/Course/FindCourse', data)
+  },
+  saveOrUpdateCourse: function (data) {
+    return post('/api/Course/SaveOrUpdateCourse', data)
+  },
+  deleteCourse: function (data) {
+    return post('/api/Course/DeleteCourse', data)
+  }
+}

+ 242 - 240
TEAMModelOS/ClientApp/src/api/index.js

@@ -9,260 +9,262 @@ import syllabus from './syllabus'
 import knowledge from './knowledge'
 import knowledge from './knowledge'
 import teachContent from './teachContent'
 import teachContent from './teachContent'
 import uploadFile from './uploadFile'
 import uploadFile from './uploadFile'
+import courseMgmt from './courseMgmt'
 export default {
 export default {
-    ClassMgmt,
-    stuAccount,
-    syllabus,
-    knowledge,
-    schoolSetting,
-    totalAnalysis,
-    talMgmt,
-    teachContent,
-    cloudApi,
-    uploadFile,
-    // 获取登录跳转链接
-    getLoginLink: function (data) {
-        return post('api/login/login', data)
-    },
-    // 验证登录
-    checkLogin: function (data) {
-        return post('api/login/CheckLogin', data)
-    },
-    // 获取登录人员角色列表
-    getLoginRoles: function (data) {
-        return post('api/role/GetLoginRoles', data)
-    },
-    // 查找地区对应学校列表
-    getSchoolList: function (data) {
-        return post('api/School/getSchool', data)
-    },
-    // 根据当前登录用户获取已授权的AI智慧学校
-    getAuthSchool: function (data) {
-        return post('api/School/AuthorizedAISchool', data)
-    },
-    // 获取全部科目
-    FindSubjectsByDict: function (data) {
-        return post('api/subject/FindSubjectsByDict', data)
-    },
-    // 获取当前学校全部科目
-    FindSchoolSubjectsByDict: function (data) {
-        return post('api/subject/FindSchoolSubjectsByDict', data)
-    },
-    // 获取当前学校全部册别
-    FindSchoolVolumesByDict: function (data) {
-        return post('api/volume/FindSchoolVolumesByDict', data)
-    },
-    // 获取当前学校全部学段
-    FindSchoolPeriodsByDict: function (data) {
-        return post('api/period/FindSchoolPeriodsByDict', data)
-    },
-    // 获取当前学校全部年级
-    FindSchoolGradesByDict: function (data) {
-        return post('api/grade/FindSchoolGradesByDict', data)
-    },
-    // 获取当前学校全部学期
-    FindSchoolTermsByDict: function (data) {
-        return post('api/term/FindSchoolTermsByDict', data)
-    },
+  ClassMgmt,
+  stuAccount,
+  syllabus,
+  knowledge,
+  schoolSetting,
+  totalAnalysis,
+  talMgmt,
+  teachContent,
+  cloudApi,
+  uploadFile,
+  courseMgmt,
+  // 获取登录跳转链接
+  getLoginLink: function (data) {
+    return post('api/login/login', data)
+  },
+  // 验证登录
+  checkLogin: function (data) {
+    return post('api/login/CheckLogin', data)
+  },
+  // 获取登录人员角色列表
+  getLoginRoles: function (data) {
+    return post('api/role/GetLoginRoles', data)
+  },
+  // 查找地区对应学校列表
+  getSchoolList: function (data) {
+    return post('api/School/getSchool', data)
+  },
+  // 根据当前登录用户获取已授权的AI智慧学校
+  getAuthSchool: function (data) {
+    return post('api/School/AuthorizedAISchool', data)
+  },
+  // 获取全部科目
+  FindSubjectsByDict: function (data) {
+    return post('api/subject/FindSubjectsByDict', data)
+  },
+  // 获取当前学校全部科目
+  FindSchoolSubjectsByDict: function (data) {
+    return post('api/subject/FindSchoolSubjectsByDict', data)
+  },
+  // 获取当前学校全部册别
+  FindSchoolVolumesByDict: function (data) {
+    return post('api/volume/FindSchoolVolumesByDict', data)
+  },
+  // 获取当前学校全部学段
+  FindSchoolPeriodsByDict: function (data) {
+    return post('api/period/FindSchoolPeriodsByDict', data)
+  },
+  // 获取当前学校全部年级
+  FindSchoolGradesByDict: function (data) {
+    return post('api/grade/FindSchoolGradesByDict', data)
+  },
+  // 获取当前学校全部学期
+  FindSchoolTermsByDict: function (data) {
+    return post('api/term/FindSchoolTermsByDict', data)
+  },
 
 
 
 
-    // 获取登录人员身份信息
-    getLoginClaim: function (data) {
-        return post('api/role/GetLoginClaim', data)
-    },
+  // 获取登录人员身份信息
+  getLoginClaim: function (data) {
+    return post('api/role/GetLoginClaim', data)
+  },
 
 
-    // 新建习题保存到题库
-    SaveItemBank: function (data) {
-        return post('api/evaluation/ItemBank', data)
-    },
+  // 新建习题保存到题库
+  SaveItemBank: function (data) {
+    return post('api/evaluation/ItemBank', data)
+  },
 
 
-    // 新建试卷到试卷库
-    SaveTestPaper: function (data) {
-        return post('api/Evaluation/testPaper', data)
-    },
+  // 新建试卷到试卷库
+  SaveTestPaper: function (data) {
+    return post('api/Evaluation/testPaper', data)
+  },
 
 
-    // 新建试卷到试卷库
-    SaveAnalyzeHtml: function (data) {
-        return post('api/ImportExercise/AnalyzeHtml', data)
-    },
+  // 新建试卷到试卷库
+  SaveAnalyzeHtml: function (data) {
+    return post('api/ImportExercise/AnalyzeHtml', data)
+  },
 
 
-    // 获取所有学校信息
-    GetAllSchool: function (data) {
-        return post('api/school/GetAllSchool', data)
-    },
+  // 获取所有学校信息
+  GetAllSchool: function (data) {
+    return post('api/school/GetAllSchool', data)
+  },
 
 
-    // 根据条件获取学段
-    FindPeriodsByDict: function (data) {
-        return post('api/period/FindPeriodsByDict', data)
-    },
+  // 根据条件获取学段
+  FindPeriodsByDict: function (data) {
+    return post('api/period/FindPeriodsByDict', data)
+  },
 
 
-    // 根据条件获取年级
-    FindGradesByDict: function (data) {
-        return post('api/grade/FindGradesByDict', data)
-    },
-    // 根据条件获取学科
-    FindSubjectsByDict: function (data) {
-        return post('api/subject/FindSubjectsByDict', data)
-    },
+  // 根据条件获取年级
+  FindGradesByDict: function (data) {
+    return post('api/grade/FindGradesByDict', data)
+  },
+  // 根据条件获取学科
+  FindSubjectsByDict: function (data) {
+    return post('api/subject/FindSubjectsByDict', data)
+  },
 
 
-    // 学情分析API
-    // 查询班年级数据
-    FindGrade: function () {
-        return fetch('/api/class/getGrade?identity=Grade')
-    },
-    // 查询学年期数据
-    FindTerm: function () {
-        return fetch('/api/class/getTerm?identity=term')
-    },
-    // 查询考试情况
-    FindExam: function () {
-        return fetch('/api/class/getExam?identity=Exam')
-    },
-    // 查询基础数据
-    FindBasics: function () {
-        return fetch('/api/class/getBase?identity=Base')
-    },
-    // 查询各校成绩排名(堆叠柱状图)
-    FindBargraph: function () {
-        return fetch('/api/class/getExam?identity=EcharsZ')
-    },
-    // 查询各项科目表现(雷达图)
-    FindRadargraph: function () {
-        return fetch('/api/class/getExam?identity=EcharsL')
-    },
-    // 查询科目表现对比(饼图)
-    FindSubjectsManifestation: function () {
-        return fetch('/api/class/getExam?identity=EcharsY')
-    },
-    // 查询历次总分统计表(折线图)
-    FindLinechart: function () {
-        return fetch('/api/class/getExam?identity=EcharsZx')
-    },
-    // 查询考试类型
-    FindExamtype: function () {
-        return fetch('/api/class/getExam?identity=ExamType')
-    },
+  // 学情分析API
+  // 查询班年级数据
+  FindGrade: function () {
+    return fetch('/api/class/getGrade?identity=Grade')
+  },
+  // 查询学年期数据
+  FindTerm: function () {
+    return fetch('/api/class/getTerm?identity=term')
+  },
+  // 查询考试情况
+  FindExam: function () {
+    return fetch('/api/class/getExam?identity=Exam')
+  },
+  // 查询基础数据
+  FindBasics: function () {
+    return fetch('/api/class/getBase?identity=Base')
+  },
+  // 查询各校成绩排名(堆叠柱状图)
+  FindBargraph: function () {
+    return fetch('/api/class/getExam?identity=EcharsZ')
+  },
+  // 查询各项科目表现(雷达图)
+  FindRadargraph: function () {
+    return fetch('/api/class/getExam?identity=EcharsL')
+  },
+  // 查询科目表现对比(饼图)
+  FindSubjectsManifestation: function () {
+    return fetch('/api/class/getExam?identity=EcharsY')
+  },
+  // 查询历次总分统计表(折线图)
+  FindLinechart: function () {
+    return fetch('/api/class/getExam?identity=EcharsZx')
+  },
+  // 查询考试类型
+  FindExamtype: function () {
+    return fetch('/api/class/getExam?identity=ExamType')
+  },
 
 
-    // 动态数据
-    // 关注年级变化数据
-    FindSelectGrade: function () {
-        return fetch('/api/class/getChange?identity=Changegrade')
-    },
-    // 关注学年期变化数据
-    FindSelectTerm: function () {
-        return fetch('/api/class/getChangeterm?identity=Changeterm')
-    },
-    // 点击某次考试详情 变化数据
-    FindSelectExam: function () {
-        return fetch('/api/class/getChangeExam?identity=Changeexam')
-    },
-    // 筛选考试类型 变化数据
-    FindSelectExamType: function () {
-        return fetch('/api/class/getChangeExamType?identity=Changeexamtype')
-    },
-    // 显示文科数据  变化数据
-    FindSelectArts: function () {
-        return fetch('/api/class/getChangeArts?identity=Changarts')
-    },
-    // 显示理科数据  变化数据
-    FindSelectScience: function () {
-        return fetch('/api/class/getChangeScience?identity=Changscience')
-    },
-    // 点击柱状图 赋值到雷达图
-    // 成都七中
-    Findcdqz: function () {
-        return fetch('/api/class/getExam?identity=cdqz')
-    },
-    // 成都四中
-    Findcdsz: function () {
-        return fetch('/api/class/getExam?identity=cdsz')
-    },
-    // 成都九中
-    Findcdjz: function () {
-        return fetch('/api/class/getExam?identity=cdjz')
-    },
-    // 成都树德
-    Findcdsd: function () {
-        return fetch('/api/class/getExam?identity=cdsd')
-    },
-    // 师大一中
-    Findsdyz: function () {
-        return fetch('/api/class/getExam?identity=sdyz')
-    },
-    // 西川中学
-    Findxczx: function () {
-        return fetch('/api/class/getExam?identity=xczx')
-    },
-    // 石室中学
-    Findsszx: function () {
-        return fetch('/api/class/getExam?identity=sszx')
-    },
+  // 动态数据
+  // 关注年级变化数据
+  FindSelectGrade: function () {
+    return fetch('/api/class/getChange?identity=Changegrade')
+  },
+  // 关注学年期变化数据
+  FindSelectTerm: function () {
+    return fetch('/api/class/getChangeterm?identity=Changeterm')
+  },
+  // 点击某次考试详情 变化数据
+  FindSelectExam: function () {
+    return fetch('/api/class/getChangeExam?identity=Changeexam')
+  },
+  // 筛选考试类型 变化数据
+  FindSelectExamType: function () {
+    return fetch('/api/class/getChangeExamType?identity=Changeexamtype')
+  },
+  // 显示文科数据  变化数据
+  FindSelectArts: function () {
+    return fetch('/api/class/getChangeArts?identity=Changarts')
+  },
+  // 显示理科数据  变化数据
+  FindSelectScience: function () {
+    return fetch('/api/class/getChangeScience?identity=Changscience')
+  },
+  // 点击柱状图 赋值到雷达图
+  // 成都七中
+  Findcdqz: function () {
+    return fetch('/api/class/getExam?identity=cdqz')
+  },
+  // 成都四中
+  Findcdsz: function () {
+    return fetch('/api/class/getExam?identity=cdsz')
+  },
+  // 成都九中
+  Findcdjz: function () {
+    return fetch('/api/class/getExam?identity=cdjz')
+  },
+  // 成都树德
+  Findcdsd: function () {
+    return fetch('/api/class/getExam?identity=cdsd')
+  },
+  // 师大一中
+  Findsdyz: function () {
+    return fetch('/api/class/getExam?identity=sdyz')
+  },
+  // 西川中学
+  Findxczx: function () {
+    return fetch('/api/class/getExam?identity=xczx')
+  },
+  // 石室中学
+  Findsszx: function () {
+    return fetch('/api/class/getExam?identity=sszx')
+  },
 
 
-    // 任教老师页面
-    // 查询关注学年期
-    FindTeachTerm: function () {
-        return fetch('/api/class/getTerm?identity=Teachterm')
-    },
-    // 查询数据对比
-    FindTeachContrast: function () {
-        return fetch('/api/class/getTerm?identity=Teachcontrast')
-    },
-    // 查询考试信息
-    FindTeachExam: function () {
-        return fetch('/api/class/getExam?identity=TeachExam')
-    },
-    // 查询基础数据
-    FindTeachBasics: function () {
-        return fetch('/api/class/getTerm?identity=TeachBase')
-    },
-    // 查询各班平均分数排名(柱状图)
-    FindTeachbargraph: function () {
-        return fetch('/api/class/getExam?identity=TeachEcharsZ')
-    },
-    // 查询及格率比较
-    FindTeachAnnulus: function () {
-        return fetch('/api/class/getExam?identity=TeachAnnulus')
-    },
-    // 查询历次总分统计图
-    FindTeachHistory: function () {
-        return fetch('/api/class/getExam?identity=TeachEcharsZx')
-    },
-    // 查询PR值
-    FindTeachPR: function () {
-        return fetch('/api/class/getExam?identity=TeachPie')
-    },
+  // 任教老师页面
+  // 查询关注学年期
+  FindTeachTerm: function () {
+    return fetch('/api/class/getTerm?identity=Teachterm')
+  },
+  // 查询数据对比
+  FindTeachContrast: function () {
+    return fetch('/api/class/getTerm?identity=Teachcontrast')
+  },
+  // 查询考试信息
+  FindTeachExam: function () {
+    return fetch('/api/class/getExam?identity=TeachExam')
+  },
+  // 查询基础数据
+  FindTeachBasics: function () {
+    return fetch('/api/class/getTerm?identity=TeachBase')
+  },
+  // 查询各班平均分数排名(柱状图)
+  FindTeachbargraph: function () {
+    return fetch('/api/class/getExam?identity=TeachEcharsZ')
+  },
+  // 查询及格率比较
+  FindTeachAnnulus: function () {
+    return fetch('/api/class/getExam?identity=TeachAnnulus')
+  },
+  // 查询历次总分统计图
+  FindTeachHistory: function () {
+    return fetch('/api/class/getExam?identity=TeachEcharsZx')
+  },
+  // 查询PR值
+  FindTeachPR: function () {
+    return fetch('/api/class/getExam?identity=TeachPie')
+  },
 
 
-    // 动态数据
-    // 选择关注学年期
-    FindDynamicTerm: function () {
-        return fetch('/api/class/getExam?identity=TeachChangeterm')
-    },
-    // 选择数据比较
-    FindDatacompare: function () {
-        return fetch('/api/class/getExam?identity=TeachChangeDatacompare')
-    },
-    // 选择考试数据
-    FindClickExam: function () {
-        return fetch('/api/class/getExam?identity=TeachChangeExam')
-    },
-    // 点击班级 联动 RP值
-    FindClickPR: function () {
-        return fetch('/api/class/getExam?identity=TeachClickPR')
-    },
+  // 动态数据
+  // 选择关注学年期
+  FindDynamicTerm: function () {
+    return fetch('/api/class/getExam?identity=TeachChangeterm')
+  },
+  // 选择数据比较
+  FindDatacompare: function () {
+    return fetch('/api/class/getExam?identity=TeachChangeDatacompare')
+  },
+  // 选择考试数据
+  FindClickExam: function () {
+    return fetch('/api/class/getExam?identity=TeachChangeExam')
+  },
+  // 点击班级 联动 RP值
+  FindClickPR: function () {
+    return fetch('/api/class/getExam?identity=TeachClickPR')
+  },
 
 
-    /*
-     *评测
-     */
-    // 上传图片
-    UploadFile: function (data) {
-        return post('/api/file/uploadFile', data)
-    },
+  /*
+   *评测
+   */
+  // 上传图片
+  UploadFile: function (data) {
+    return post('/api/file/uploadFile', data)
+  },
 
 
-    /**
-     * 通用查询接口
-     */
-    FindCollection: function (data) {
-        return post('/api/Common/FindCollection', data)
-    }
+  /**
+   * 通用查询接口
+   */
+  FindCollection: function (data) {
+    return post('/api/Common/FindCollection', data)
+  }
 
 
 }
 }

文件差异内容过多而无法显示
+ 35 - 0
TEAMModelOS/ClientApp/src/common/NoData.vue


+ 3 - 3
TEAMModelOS/ClientApp/src/store/index.js

@@ -48,7 +48,7 @@ export default new Vuex.Store({
     leida: {},
     leida: {},
     // 饼图
     // 饼图
     pie: {},
     pie: {},
-     // 折线图(大)
+    // 折线图(大)
     linechart: {},
     linechart: {},
     // 考试类型选择
     // 考试类型选择
     examtype: {},
     examtype: {},
@@ -73,7 +73,7 @@ export default new Vuex.Store({
     talMgmt,
     talMgmt,
     authorization,
     authorization,
     totalAnalysis,
     totalAnalysis,
-      schoolBaseInfo,
-      courseMgmt
+    schoolBaseInfo,
+    courseMgmt
   }
   }
 })
 })

+ 69 - 89
TEAMModelOS/ClientApp/src/store/module/courseMgmt.js

@@ -1,94 +1,74 @@
-export default {
-    state: {
-        courseList: [
-            {
-                id: 'uuid',
-                teamModelId: '0000#0001',
-                schoolCode:'0101',
-                courseCode: 'T968475',
-                courseName: '一次函数极其图像',
-                periodCode: '',
-                gradeCode: '',
-                subjectCode: '',
-                notice: '',//课程公告
-                scope: 'personal',//personal:私有 school:校本
-                assistTeacher: [//协同教师
-                    {
-                        name: "张飞",
-                        teamModelId:'zhangfei#0101'
-                    }
-                ],
-                courseTime: [//上课时间表
-                    {
-                        frequency: 'day',//上课频率 每日、每周、每月、临时课程
-                        begin: '',//课程开始时间
-                        end: '',//课程结束时间
-                        classroomCode: '',//上课班级/教室
-                        date: '',//临时课程
-                        day: '',//每月课程
-                        weekly: ''//每周课程
-                    }
-                ],
-                classroom: [//课程“教室”
-                    {
-                        classroomCode: ''
-                    }
-                ],
-                syllabus: [//关联课纲
-                    //...........
-                ]
-            },
-            {
-                id: 'uuid',
-                teamModelId: '0000#0001',
-                schoolCode: '0101',
-                courseCode: 'T968476',
-                courseName: '二次函数解的个数',
-                periodCode: '',
-                gradeCode: '',
-                subjectCode: '',
-                notice: '',//课程公告
-                scope: 'school',//personal:私有 school:校本
-                assistTeacher: [//协同教师
-                    {
-                        name: "张飞",
-                        teamModelId: 'zhangfei#0101'
-                    }
-                ],
-                courseTime: [//上课时间表
-                    {
-                        frequency: 'day',//上课频率 每日、每周、每月、临时课程
-                        begin: '',//课程开始时间
-                        end: '',//课程结束时间
-                        classroom: '',//上课班级/教室
-                        date: '',//临时课程
-                        day: '',//每月课程
-                        weekly: ''//每周课程
-                    }
-                ],
-                classroom: [//课程“教室”
-                    {
-                        classroomCode: ''
-                    }
-                ],
-                syllabus: [//关联课纲
-                    //...........
-                ]
-            }
-        ],
-        currentCourseIndex: 0,
+import apiTools from '@/api'
+import JSONPath from 'jsonpath'
+export default {
+  namespaced: true,
+  state: {
+    courseList: [],
+    currentCourseIndex: 0,
+    demoLoginInfo: {
+      user: 'admin',
+      TEAMModelId: 'habook#0001',
+      school: '醍摩豆书院',
+      schoolCode: 'HBCN'
     },
     },
-    getters: {
-        courseInfo(state) {
-            return state.courseList[state.currentCourseIndex]
-        }
+  },
+  getters: {
+    courseInfo(state) {
+      return state.courseList[state.currentCourseIndex]
+    }
+  },
+  mutations: {
+    setCurrentCourseIndex(state, index) {
+      state.currentCourseIndex = index
     },
     },
-    mutations: {
-        setCurrentCourseIndex(state, index) {
-            state.currentCourseIndex = index
+    setCourseList(state, data) {
+      state.courseList = data
+    }
+  },
+  actions: {
+    getCourseList(context) {
+      return new Promise(
+        (resolve, reject) => {
+          if (context.state.courseList.length == 0) {
+            apiTools.courseMgmt.findCourse({
+              TEAMModelId: context.state.demoLoginInfo.TEAMModelId
+            }).then(
+              res => {
+                if (res.error == null) {
+                  if (res.result.data.length > 0) {
+                    context.commit("setCourseList", res.result.data)
+                    resolve({
+                      code: 1,
+                      message: '数据请求成功'
+                    })
+                  } else {
+                    resolve({
+                      code: 2,
+                      message: '请求成功,数据为空'
+                    })
+                  }
+                } else {
+                  reject({
+                    code: 0,
+                    message: '请求失败,API error!'
+                  })
+                }
+              },
+              err => {
+                reject({
+                  code: 0,
+                  message: '请求失败,API error!'
+                })
+              }
+            )
+          } else {
+            resolve({
+              code: 3,
+              message: '数据已请求,无需重复请求'
+            })
+          }
         }
         }
-    },
-    actions: {
-
+      )
     }
     }
+  }
 }
 }

+ 126 - 128
TEAMModelOS/ClientApp/src/store/module/schoolBaseInfo.js

@@ -1,143 +1,141 @@
 import apiTools from '@/api'
 import apiTools from '@/api'
 import JSONPath from 'jsonpath'
 import JSONPath from 'jsonpath'
 export default {
 export default {
-    namespaced: true,
-    state: {
-        schoolBaseInfo: undefined,
-        classroomList: undefined,
-        demoLoginInfo: {
-            user: 'admin',
-            teamModelId: 'habook#0001',
-            school: '醍摩豆书院',
-            schoolCode: 'HBCN'
-        },
+  namespaced: true,
+  state: {
+    schoolBaseInfo: undefined,
+    classroomList: undefined,
+    demoLoginInfo: {
+      user: 'admin',
+      TEAMModelId: 'habook#0001',
+      school: '醍摩豆书院',
+      schoolCode: 'HBCN'
     },
     },
-    getters: {
+  },
+  getters: {
 
 
+  },
+  mutations: {
+    setSchoolInfo(state, data) {
+      state.schoolBaseInfo = data
     },
     },
-    mutations: {
-        setSchoolInfo(state, data) {
-            state.schoolBaseInfo = data
-        },
-        setClassroomList(state, data) {
-            state.classroomList = data
-        }
-    },
-    actions: {
-         getSchoolBaseData(context) {
-            return new Promise(
-                (resolve, reject) => {
-                    if (context.state.schoolBaseInfo == undefined) {
-                        apiTools.schoolSetting.findSchoolSystem({
-                            schoolCode: context.state.demoLoginInfo.schoolCode
-                        }).then(
-                            res => {
-                                if (res.error == null) {
-                                    if (res.result.data.length > 0) {
-                                        context.commit("setSchoolInfo", res.result.data[0])
-                                        resolve({
-                                            code: 1,
-                                            message: '数据请求成功'
-                                        })
-                                    } else {
-                                        resolve({
-                                            code: 2,
-                                            message: '请求成功,数据为空'
-                                        })
-                                    }
-                                } else {
-                                    reject({
-                                        code: 0,
-                                        message: '请求失败,API error!'
-                                    })
-                                }
-                            },
-                            err => {
-                                reject({
-                                    code: 0,
-                                    message: '请求失败,API error!'
-                                })
-                            }
-                        )
-                    } else {
-                        resolve({
-                            code: 3,
-                            message: '数据已请求,无需重复请求'
-                        })
-                    }
+    setClassroomList(state, data) {
+      state.classroomList = data
+    }
+  },
+  actions: {
+    getSchoolBaseData(context) {
+      return new Promise(
+        (resolve, reject) => {
+          if (context.state.schoolBaseInfo == undefined) {
+            apiTools.schoolSetting.findSchoolSystem({
+              schoolCode: context.state.demoLoginInfo.schoolCode
+            }).then(
+              res => {
+                if (res.error == null) {
+                  if (res.result.data.length > 0) {
+                    context.commit("setSchoolInfo", res.result.data[0])
+                    resolve({
+                      code: 1,
+                      message: '数据请求成功'
+                    })
+                  } else {
+                    resolve({
+                      code: 2,
+                      message: '请求成功,数据为空'
+                    })
+                  }
+                } else {
+                  reject({
+                    code: 0,
+                    message: '请求失败,API error!'
+                  })
                 }
                 }
+              },
+              err => {
+                reject({
+                  code: 0,
+                  message: '请求失败,API error!'
+                })
+              }
             )
             )
-        },
-        getClassroom(context) {
-            return new Promise(
-                (resolve, reject) => {
-                    if (context.state.classroomList == undefined) {
-                        apiTools.schoolSetting.findClassInfo({
-                            schoolCode: context.state.demoLoginInfo.schoolCode,
-                            status: 1
-                        }).then(
-                            res => {
-                                if (res.error == null) {
-                                    if (res.result.data.length > 0) {
-                                        let resData = res.result.data
-                                        context.dispatch('getSchoolBaseData').then(
-                                            (res) => {
-                                                if (res.code == 1 || res.code == 3) {
-                                                    for (let item of resData) {
-                                                        let currentSchoolInfo = JSONPath.query(context.state.schoolBaseInfo, "$..period[?(@.periodCode=='" + item.periodCode + "')]")
-                                                        //let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classroomCode=='" + item.classroom.classroomCode + "')]");
+          } else {
+            resolve({
+              code: 3,
+              message: '数据已请求,无需重复请求'
+            })
+          }
+        }
+      )
+    },
+    getClassroom(context) {
+      return new Promise(
+        (resolve, reject) => {
+          if (context.state.classroomList == undefined) {
+            apiTools.schoolSetting.findClassInfo({
+              schoolCode: context.state.demoLoginInfo.schoolCode,
+              status: 1
+            }).then(
+              res => {
+                if (res.error == null) {
+                  if (res.result.data.length > 0) {
+                    let resData = res.result.data
+                    context.dispatch('getSchoolBaseData').then(
+                      (res) => {
+                        if (res.code == 1 || res.code == 3) {
+                          for (let item of resData) {
+                            let currentSchoolInfo = JSONPath.query(context.state.schoolBaseInfo, "$..period[?(@.periodCode=='" + item.periodCode + "')]")
+                            //let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classroomCode=='" + item.classroom.classroomCode + "')]");
 
 
-                                                        if (currentSchoolInfo.length > 0) {
-                                                            item.periodName = currentSchoolInfo[0].periodName;
-                                                            item.gradeName = JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + item.gradeCode + "')]")[0].gradeName;
-                                                            //item.classroomName = currentClassroomlInfo[0].classroomName;
-                                                        }
-                                                        console.log(item)
-                                                    }
-                                                    console.log(resData)
-                                                    context.commit("setClassroomList", resData)
-                                                    resolve({
-                                                        code: 1,
-                                                        message: '数据请求成功'
-                                                    })
-                                                } else {
-                                                    console.log(res)
-                                                }
-                                            },
-                                            (err) => {
-                                                console.log(err)
-                                            }
-                                        )
-                                        
-                                        
-                                    } else {
-                                        resolve({
-                                            code: 2,
-                                            message: '请求成功,数据为空'
-                                        })
-                                    }
-                                } else {
-                                    resolve({
-                                        code: 0,
-                                        message: '请求失败,API error!'
-                                    })
-                                }
-                            },
-                            err => {
-                                resolve({
-                                    code: 0,
-                                    message: '请求失败,API error!'
-                                })
+                            if (currentSchoolInfo.length > 0) {
+                              item.periodName = currentSchoolInfo[0].periodName;
+                              item.gradeName = JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + item.gradeCode + "')]")[0].gradeName;
+                              //item.classroomName = currentClassroomlInfo[0].classroomName;
                             }
                             }
-                        )
-                    } else {
-                        resolve({
-                            code: 3,
-                            message: '数据已请求,无需重复请求'
-                        })
-                    }
+                            console.log(item)
+                          }
+                          console.log(resData)
+                          context.commit("setClassroomList", resData)
+                          resolve({
+                            code: 1,
+                            message: '数据请求成功'
+                          })
+                        } else {
+                          console.log(res)
+                        }
+                      },
+                      (err) => {
+                        console.log(err)
+                      }
+                    )
+                  } else {
+                    resolve({
+                      code: 2,
+                      message: '请求成功,数据为空'
+                    })
+                  }
+                } else {
+                  resolve({
+                    code: 0,
+                    message: '请求失败,API error!'
+                  })
                 }
                 }
+              },
+              err => {
+                resolve({
+                  code: 0,
+                  message: '请求失败,API error!'
+                })
+              }
             )
             )
+          } else {
+            resolve({
+              code: 3,
+              message: '数据已请求,无需重复请求'
+            })
+          }
         }
         }
+      )
     }
     }
+  }
 }
 }

+ 93 - 0
TEAMModelOS/ClientApp/src/utils/js-fn.js

@@ -0,0 +1,93 @@
+/*
+ * 根据某个属性进行分组
+ */
+import JSONPath from 'jsonpath'
+function groupBy(array, key) {
+  const groups = {}
+  array.forEach(function (item) {
+    const group = JSON.stringify(item[key])
+    groups[group] = groups[group] || []
+    groups[group].push(item)
+  })
+  return Object.keys(groups).map(function (group) {
+    return groups[group]
+  })
+}
+/*
+ * 判断两个对象是否相等
+ */
+function isObjEqual(o1, o2) {
+  var props1 = Object.keys(o1);
+  var props2 = Object.keys(o2);
+  console.log(props1);
+  if (props1.length != props2.length) {
+    return false;
+  }
+  for (var i = 0, max = props1.length; i < max; i++) {
+    var propName = props1[i];
+    if (o1[propName] !== o2[propName]) {
+      return false;
+    }
+  }
+  return true;
+}
+/*
+ * 获取对象在对象数组的index
+ */
+function getIndex(_arr, _obj) {
+  var len = _arr.length;
+  for (let i = 0; i < len; i++) {
+    if (isObjEqual(_arr[i], _obj)) {
+      return parseInt(i);
+    }
+  }
+  return -1;
+}
+/*
+ * 产生某个范围的随机数
+ */
+function getBtwRandom(start, end) {
+  return Math.floor(Math.random() * end) + start
+}
+/*
+ * 根据学段编码获取对应Name
+ */
+function getPeriod(data,periodCode) {
+  let result = JSONPath.query(data, "$..[?(@.periodCode=='" + periodCode + "')]")
+  if (result.length == 0) {
+    return '暂无数据'
+  } else {
+    return result[0]
+  }
+}
+/*
+ * 根据年级编码获取对应Name
+ */
+function getGradeName(data,gradeCode) {
+  let result = JSONPath.query(data, "$..[?(@.gradeCode=='" + gradeCode + "')]")
+  if (result.length == 0) {
+    return '暂无数据'
+  } else {
+    return result[0].gradeName
+  }
+}
+/*
+ * 根据学科编码获取对应Name
+ */
+function getSubjectName(data,subjectCode) {
+  let result = JSONPath.query(data, "$..[?(@.subjectCode=='" + subjectCode + "')]")
+  if (result.length == 0) {
+    return '暂无数据'
+  } else {
+    return result[0].subjectName
+  }
+}
+export default {
+  groupBy,
+  isObjEqual,
+  getIndex,
+  getBtwRandom,
+  getPeriod,
+  getGradeName,
+  getSubjectName
+}

+ 219 - 217
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseBaseSetting.less

@@ -6,256 +6,258 @@
 @second-textColor: #a5a5a5; //文本副级颜色
 @second-textColor: #a5a5a5; //文本副级颜色
 @primary-fontSize: 14px;
 @primary-fontSize: 14px;
 @second-fontSize: 16px;
 @second-fontSize: 16px;
+
 .common-header {
 .common-header {
-    height: 45px;
-    width: 100%;
-    border-bottom: 1px solid @borderColor;
-    color: @second-textColor;
-    line-height: 45px;
-    padding-left: 10px;
+  height: 45px;
+  width: 100%;
+  border-bottom: 1px solid @borderColor;
+  color: @second-textColor;
+  line-height: 45px;
+  padding-left: 10px;
 }
 }
 
 
 .course-detail-content {
 .course-detail-content {
-    width: 100%;
-    height: ~"calc(100% - 49px)";
-    display: flex;
-    flex-direction: row;
-
-    .course-base-info {
-        height: 100%;
-        width: 33%;
-        border-right: 1px solid @borderColor;
-        display: inline-block;
-
-        .course-base-info-header {
-            .common-header
-        }
+  width: 100%;
+  height: ~"calc(100% - 49px)";
+  display: flex;
+  flex-direction: row;
+
+  .course-base-info {
+    height: 100%;
+    width: 33%;
+    border-right: 1px solid @borderColor;
+    display: inline-block;
+
+    .course-base-info-header {
+      .common-header
+    }
 
 
-        .course-base-info-content {
-            width: 100%;
-            height: ~"calc(100% - 45px)";
-            overflow-y: auto;
-            padding: 30px 20px 0px 10px;
+    .course-base-info-content {
+      width: 100%;
+      height: ~"calc(100% - 45px)";
+      overflow-y: auto;
+      padding: 30px 20px 0px 10px;
+
+      &::-webkit-scrollbar { /*滚动条整体样式*/
+        width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
+      &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgb(124,124,124);
+      }
+
+      &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgba(68,68,68,.5);
+      }
+    }
+  }
 
 
-            &::-webkit-scrollbar { /*滚动条整体样式*/
-                width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-                height: 1px;
-            }
+  .course-teacher-info {
+    padding-left: 15px;
+    height: 100%;
+    width: 33%;
+    border-right: 1px solid @borderColor;
+    display: inline-block;
 
 
-            &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgb(124,124,124);
-            }
+    .course-teacher-info-header {
+      .common-header
+    }
 
 
-            &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgba(68,68,68,.5);
-            }
+    .course-teacher-info-content {
+      width: 100%;
+      height: ~"calc(100% - 45px)";
+      overflow-y: auto;
+
+      &::-webkit-scrollbar { /*滚动条整体样式*/
+        width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
+      &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgb(124,124,124);
+      }
+
+      &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgba(68,68,68,.5);
+      }
+
+      .course-teacher-item {
+        display: block;
+        padding: 10px 0px 10px 10px;
+        color: @second-textColor;
+        width: 100%;
+        border-bottom: 1px solid @borderColor;
+        font-size: 16px;
+      }
+
+      .course-teacher-search-box {
+        width: 100%;
+        height: 40px;
+        border-bottom: 1px solid @borderColor;
+        padding-left: 10px;
+        line-height: 40px;
+        color: white;
+
+        .search-course-teacher {
+          float: right;
+          width: 150px;
+          margin-right: 28px;
+          line-height: 40px;
         }
         }
+      }
     }
     }
+  }
 
 
-    .course-teacher-info {
-        padding-left: 15px;
-        height: 100%;
-        width: 33%;
-        border-right: 1px solid @borderColor;
-        display: inline-block;
+  .course-time-info {
+    height: 100%;
+    width: 34%;
+    display: inline-block;
+    padding-left: 15px;
 
 
-        .course-teacher-info-header {
-            .common-header
-        }
+    .course-time-info-header {
+      .common-header
+    }
 
 
-        .course-teacher-info-content {
-            width: 100%;
-            height: ~"calc(100% - 45px)";
-            overflow-y: auto;
+    .course-time-info-content {
+      width: 100%;
+      height: ~"calc(100% - 45px)";
+      overflow-y: auto;
+
+      &::-webkit-scrollbar { /*滚动条整体样式*/
+        width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
+      &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgb(124,124,124);
+      }
+
+      &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        background: rgba(68,68,68,.5);
+      }
+
+      .course-time-item {
+        width: 100%;
+        padding: 15px 0px 15px 15px;
+        border-bottom: 1px solid @borderColor;
+        display: flex;
+        flex-direction: row;
+        cursor: pointer;
+
+        .item-order {
+          font-size: 60px;
+          font-weight: 600;
+          width: 75px;
+          padding: 0 30px 0 10px;
+          display: flex;
+          flex-direction: row;
+          align-items: center;
+          justify-content: center;
+
+          .edit-time {
+            display: none;
+          }
+        }
 
 
-            &::-webkit-scrollbar { /*滚动条整体样式*/
-                width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-                height: 1px;
-            }
+        &:hover .item-order .edit-time {
+          display: inline-block;
+        }
 
 
-            &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgb(124,124,124);
-            }
+        &:hover .item-order .item-order-index {
+          display: none;
+        }
 
 
-            &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgba(68,68,68,.5);
-            }
+        .course-time-detail {
+          width: ~"calc(100% - 75px)";
 
 
-            .course-teacher-item {
-                display: block;
-                padding: 10px 0px 10px 10px;
-                color: @second-textColor;
-                width: 100%;
-                border-bottom: 1px solid @borderColor;
-                font-size: 16px;
-            }
+          .course-frequently {
+            position: relative;
+            width: 100%;
 
 
-            .course-teacher-search-box {
-                width: 100%;
-                height: 40px;
-                border-bottom: 1px solid @borderColor;
-                padding-left: 10px;
-                line-height: 40px;
-                color: white;
-                .search-course-teacher{
-                    float:right;
-                    width:150px;
-                    margin-right:28px;
-                    line-height:40px;
-                }
+            .course-date {
+              position: absolute;
+              right: 50px;
+              width: 130px;
+              margin-left: 15px;
             }
             }
-        }
-    }
-
-    .course-time-info {
-        height: 100%;
-        width: 34%;
-        display: inline-block;
-        padding-left: 15px;
-
-        .course-time-info-header {
-            .common-header
-        }
+          }
 
 
-        .course-time-info-content {
+          .course-time {
+            margin-top: 10px;
+            position: relative;
+            text-align: center;
             width: 100%;
             width: 100%;
-            height: ~"calc(100% - 45px)";
-            overflow-y: auto;
+            height: 40px;
 
 
-            &::-webkit-scrollbar { /*滚动条整体样式*/
-                width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-                height: 1px;
+            .course-time-start {
+              position: absolute;
+              left: 0;
             }
             }
 
 
-            &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgb(124,124,124);
+            .course-time-end {
+              position: absolute;
+              right: 50px;
             }
             }
-
-            &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-                -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-                background: rgba(68,68,68,.5);
+          }
+
+          .course-classroom {
+            margin-top: 10px;
+          }
+
+          .course-time-action {
+            width: ~"calc(100% - 50px)";
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            margin-top: 10px;
+
+            .smarll-confirm-btn {
+              width: 45%;
+              text-align: center;
+              background-color: #4f4f4f;
+              color: #A1A1A1;
+              font-weight: 600;
+              letter-spacing: 2px;
+              cursor: pointer;
+              user-select: none;
+              border-radius: 5px;
+              padding: 2px 0px;
             }
             }
 
 
-            .course-time-item {
-                width: 100%;
-                padding: 15px 0px 15px 15px;
-                border-bottom: 1px solid @borderColor;
-                display: flex;
-                flex-direction: row;
-                cursor: pointer;
-
-                .item-order {
-                    font-size: 60px;
-                    font-weight: 600;
-                    width: 75px;
-                    padding: 0 30px 0 10px;
-                    display: flex;
-                    flex-direction: row;
-                    align-items: center;
-                    justify-content: center;
-
-                    .edit-time {
-                        display: none;
-                    }
-                }
-
-                &:hover .item-order .edit-time {
-                    display: inline-block;
-                }
-
-                &:hover .item-order .item-order-index {
-                    display: none;
-                }
-
-                .course-time-detail {
-                    width: ~"calc(100% - 75px)";
-
-                    .course-frequently {
-                        position: relative;
-                        width: 100%;
-
-                        .course-date {
-                            position: absolute;
-                            right: 50px;
-                            width: 130px;
-                            margin-left: 15px;
-                        }
-                    }
-
-                    .course-time {
-                        margin-top: 10px;
-                        position: relative;
-                        text-align: center;
-                        width: 100%;
-                        height: 40px;
-
-                        .course-time-start {
-                            position: absolute;
-                            left: 0;
-                        }
-
-                        .course-time-end {
-                            position: absolute;
-                            right: 50px;
-                        }
-                    }
-
-                    .course-classroom {
-                        margin-top: 10px;
-                    }
-
-                    .course-time-action {
-                        width: ~"calc(100% - 50px)";
-                        display: flex;
-                        flex-direction: row;
-                        justify-content: space-between;
-                        margin-top: 10px;
-
-                        .smarll-confirm-btn {
-                            width: 45%;
-                            text-align: center;
-                            background-color: #4f4f4f;
-                            color: #A1A1A1;
-                            font-weight: 600;
-                            letter-spacing: 2px;
-                            cursor: pointer;
-                            user-select: none;
-                            border-radius: 5px;
-                            padding: 2px 0px;
-                        }
-
-                        .smarll-confirm-btn-active {
-                            background-color: #6DE2C4;
-                            color: white;
-                        }
-                    }
-                }
+            .smarll-confirm-btn-active {
+              background-color: #6DE2C4;
+              color: white;
             }
             }
+          }
         }
         }
+      }
     }
     }
+  }
 }
 }
+
 .confirm-btn {
 .confirm-btn {
-    width: 100%;
-    height: 40px;
-    line-height: 40px;
-    text-align: center;
-    background-color: #4f4f4f;
-    margin: auto;
-    color: #A1A1A1;
-    font-size: 18px;
-    font-weight: 600;
-    letter-spacing: 2px;
-    cursor: pointer;
-    user-select: none;
+  width: 100%;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  background-color: #4f4f4f;
+  margin: auto;
+  color: #A1A1A1;
+  font-size: 18px;
+  font-weight: 600;
+  letter-spacing: 2px;
+  cursor: pointer;
+  user-select: none;
 }
 }
 
 
 .confirm-btn-active {
 .confirm-btn-active {
-    background-color: #6DE2C4;
-    color: white;
+  background-color: #6DE2C4;
+  color: white;
 }
 }
-

+ 436 - 320
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseBaseSetting.vue

@@ -1,345 +1,461 @@
 <template>
 <template>
-    <div class="course-detail-content" >
-        <div class="course-base-info">
-            <div class="course-base-info-header">
-                <p>基础设置</p>
-            </div>
-            <div class="course-base-info-content">
-                <Form :model="courseInfo" label-position="top">
-                    <FormItem label="课程名称">
-                        <Input v-model="courseInfo.courseName" placeholder="请输入课程名称..."></Input>
-                    </FormItem>
-                    <FormItem label="设置学制" v-if="isLoaded">
-                        <Select v-model="courseInfo.periodCode" filterable style="width:100%" placeholder="请选择学制">
-                            <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index" @click.native="getCurrentGrade(index)">{{ item.periodName }}</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="设置年级">
-                        <Select v-model="courseInfo.gradeCode" filterable style="width:100%" placeholder="请选择年级">
-                            <Option v-for="(item,index) in gradeList" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="设置科目">
-                        <Select v-model="courseInfo.subjectCode" filterable style="width:100%" placeholder="请选择科目">
-                            <Option v-for="(item,index) in subjectList" :value="item.subjectCode" :key="index" >{{ item.subjectName }}</Option>
-                        </Select>
-                    </FormItem>
-                    <FormItem label="课程公告">
-                        <div ref="courseNotice"></div>
-                    </FormItem>
-                </Form>
-                <div class="confirm-btn" @click="submit()">
-                    保存变更
-                </div>
-            </div>
+  <div class="course-detail-content">
+    <div class="course-base-info">
+      <div class="course-base-info-header">
+        <p>基础设置</p>
+      </div>
+      <div class="course-base-info-content">
+        <Form ref="courseBaseInfo" :model="courseInfo.baseInfo" label-position="top" :rules="ruleValidate">
+          <FormItem label="课程名称" prop="courseName">
+            <Input v-model="courseInfo.baseInfo.courseName" placeholder="请输入课程名称..."></Input>
+          </FormItem>
+          <FormItem label="设置学制" v-if="isLoaded" prop="periodCode">
+            <Select v-model="courseInfo.baseInfo.periodCode" filterable style="width:100%" placeholder="请选择学制" :clearable="true">
+              <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index" >{{ item.periodName }}</Option>
+            </Select>
+          </FormItem>
+          <FormItem label="设置年级" prop="gradeCode">
+            <Select v-model="courseInfo.baseInfo.gradeCode" filterable style="width:100%" placeholder="请选择年级" :clearable="true">
+              <Option v-for="(item,index) in fn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,courseInfo.baseInfo.periodCode).grades" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
+            </Select>
+          </FormItem>
+          <FormItem label="设置科目" prop="subjectCode">
+            <Select v-model="courseInfo.baseInfo.subjectCode" filterable style="width:100%" placeholder="请选择科目" :clearable="true">
+              <Option v-for="(item,index) in fn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,courseInfo.baseInfo.periodCode).subjects" :value="item.subjectCode" :key="index">{{ item.subjectName }}</Option>
+            </Select>
+          </FormItem>
+          <FormItem label="课程公告" prop="notice">
+            <div ref="courseNotice"></div>
+            <Input v-model="courseInfo.baseInfo.notice" type="textarea" :autosize="{minRows: 2,maxRows: 5}" style="display:none"></Input>
+          </FormItem>
+        </Form>
+        <div :class="isFull ? 'confirm-btn confirm-btn-active':'confirm-btn' " @click="submit('baseInfo')">
+          保存变更
         </div>
         </div>
-        <div class="course-teacher-info">
-            <div class="course-teacher-info-header">
-                协同教师设置
+      </div>
+    </div>
+    <div class="course-teacher-info">
+      <div class="course-teacher-info-header">
+        协同教师设置
+      </div>
+      <div class="course-teacher-info-content">
+        <div class="course-teacher-search-box">
+          <Checkbox v-model="scope">添加校外教师</Checkbox>
+          <Input prefix="ios-search" placeholder="ID或姓名搜索" size="small" class="search-course-teacher" />
+        </div>
+        <CheckboxGroup v-model="courseInfo.assistTeacher" @on-change="saveChange">
+          <Checkbox :label="item.TEAMModelId" class="course-teacher-item" v-for="(item,index) in teacherList">{{item.teacherName}}</Checkbox>
+        </CheckboxGroup>
+      </div>
+    </div>
+    <div class="course-time-info">
+      <div class="course-time-info-header">
+        <span>课程时段设置</span>
+        <Icon type="md-add" color="white" size="18" @click="addCourseTime" style="float:right;margin-top:13px;margin-right:30px;cursor:pointer;" />
+      </div>
+      <div class="course-time-info-content">
+        <div v-if="courseInfo.courseTime.length > 0" class="course-time-item" v-for="(item,index) in courseInfo.courseTime" :key="index">
+          <div class="item-order">
+            <span class="item-order-index">{{index + 1}}</span>
+            <Icon type="md-create" color="white" class="edit-time" size="50" title="修改信息" @click="editCourseTime(index)" />
+          </div>
+          <div class="course-time-detail">
+            <div class="course-frequently">
+              <Select v-model="item.frequencyCode" :disabled="editTimeIndex !== index" size="small" style="width:112px">
+                <Option v-for="item in frequencyList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+              </Select>
+              <Select v-if="item.frequencyCode === 'week'" v-model="item.frequencyName" class="course-date" :disabled="editTimeIndex !== index" size="small" style="padding-left:15px;">
+                <Option v-for="item in weekList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+              </Select>
+              <DatePicker v-if="item.frequencyCode === 'temporary' || item.frequency === 'month'" v-model="item.frequencyName" :disabled="editTimeIndex !== index" class="course-date" type="date" placeholder="选择日期" size="small" style="" format="yyyy-MM-dd"></DatePicker>
+              <span v-if="item.frequencyCode === 'day'" class="course-date" style="color:white;padding-left:24px;">平日课程</span>
             </div>
             </div>
-            <div class="course-teacher-info-content">
-                <div class="course-teacher-search-box">
-                    <Checkbox v-model="scope">添加校外教师</Checkbox>
-                    <Input prefix="ios-search" placeholder="ID或姓名搜索" size="small" class="search-course-teacher" />
-                </div>
-                <CheckboxGroup v-model="courseInfo.assistTeacher">
-                    <Checkbox :label="item.TEAMModelId" class="course-teacher-item" v-for="(item,index) in teacherList">{{item.teacherName}}</Checkbox>
-                </CheckboxGroup>
+            <div class="course-time">
+              <TimePicker v-model="item.beginTime" :disabled="editTimeIndex !== index" format="HH:mm" placeholder="开始" size="large" class="course-time-start" style="width: 112px;font-size:18px;"></TimePicker>
+              <span style="margin-left: -50px;margin-top:10px;display:inline-block; color:#eeeeee;">至</span>
+              <TimePicker v-model="item.endTime" :disabled="editTimeIndex !== index" format="HH:mm" placeholder="结束" size="large" class="course-time-end" style="width: 112px;font-size:18px;"></TimePicker>
             </div>
             </div>
-        </div>
-        <div class="course-time-info">
-            <div class="course-time-info-header">
-                <span>课程时段设置</span>
-                <Icon type="md-add" color="white" size="18" @click="addCourseTime" style="float:right;margin-top:13px;margin-right:30px;cursor:pointer;"/>
+            <div class="course-classroom">
+              <Select v-model="item.classroomCode" v-if="editTimeIndex === index" placeholder="请选择教室" size="small" style="width:calc(100% - 50px);">
+                <Option v-for="item in $store.state.schoolBaseInfo.classroomList" :value="item.classroomCode" :key="item.classroomCode">{{ item.classroomName }}</Option>
+              </Select>
+              <p v-if="editTimeIndex !== index" style="color:white;padding-left:10px;"><span>授课教室:</span><span>{{getClassroomName(item.classroomCode)}}</span></p>
             </div>
             </div>
-            <div class="course-time-info-content">
-                <div class="course-time-item" v-for="(item,index) in courseInfo.courseTime" :key="index">
-                    <div class="item-order">
-                        <span  class="item-order-index">{{index + 1}}</span>
-                        <Icon  type="md-create" color="white" class="edit-time" size="50" title="修改信息" @click="editCourseTime(index)"/>
-                    </div>
-                    <div class="course-time-detail">
-                        <div class="course-frequently">
-                            <Select v-model="item.frequency" :disabled="editTimeIndex !== index" size="small" style="width:112px">
-                                <Option v-for="item in frequencyList" :value="item.value" :key="item.value">{{ item.label }}</Option>
-                            </Select>
-                            <Select v-if="item.frequency === 'week'" v-model="item.weekly" class="course-date" :disabled="editTimeIndex !== index" size="small" style="padding-left:15px;">
-                                <Option v-for="item in weekList" :value="item.value" :key="item.value">{{ item.label }}</Option>
-                            </Select>
-                            <DatePicker v-if="item.frequency === 'temporary' || item.frequency === 'month'" v-model="item.date" :disabled="editTimeIndex !== index" class="course-date" type="date" placeholder="选择日期" size="small" style="" format="yyyy-MM-dd"></DatePicker>
-                            <span v-if="item.frequency === 'day'" class="course-date" style="color:white;padding-left:24px;">平日课程</span>
-                        </div>
-                        <div class="course-time">
-                            <TimePicker v-model="item.begin" :disabled="editTimeIndex !== index" format="HH:mm" placeholder="开始" size="large" class="course-time-start" style="width: 112px;font-size:18px;"></TimePicker>
-                            <span style="margin-left: -50px;margin-top:10px;display:inline-block; color:#eeeeee;">至</span>
-                            <TimePicker v-model="item.end" :disabled="editTimeIndex !== index" format="HH:mm" placeholder="结束" size="large" class="course-time-end" style="width: 112px;font-size:18px;"></TimePicker>
-                        </div>
-                        <div class="course-classroom">
-                            <Select v-model="item.classroomCode" v-if="editTimeIndex === index" placeholder="请选择教室" size="small" style="width:calc(100% - 50px);">
-                                <Option v-for="item in $store.state.schoolBaseInfo.classroomList" :value="item.classroomCode" :key="item.classroomCode">{{ item.classroomName }}</Option>
-                            </Select>
-                            <p v-if="editTimeIndex !== index" style="color:white;padding-left:10px;"><span>授课教室:</span><span>{{getClassroomName(item.classroomCode)}}</span></p>
-                        </div>
-                        <div class="course-time-action" v-if="editTimeIndex === index">
-                            <div class="smarll-confirm-btn smarll-confirm-btn-active">取消变更</div>
-                            <div class="smarll-confirm-btn smarll-confirm-btn-active" @click="submit()">保存变更</div>
-                        </div>
-                    </div>
-                </div>
+            <div class="course-time-action" v-if="editTimeIndex === index">
+              <div class="smarll-confirm-btn smarll-confirm-btn-active" @click="cancelEditTime(index)">取消变更</div>
+              <div class="smarll-confirm-btn smarll-confirm-btn-active" style="margin:0px 15px;" @click="deleteTime(index)">删除</div>
+              <div class="smarll-confirm-btn smarll-confirm-btn-active" @click="submit('courseTime')">保存变更</div>
             </div>
             </div>
+          </div>
         </div>
         </div>
+        <NoData v-if="courseInfo.courseTime.length == 0" style="margin-top:120px;"></NoData>
+      </div>
     </div>
     </div>
+  </div>
 </template>
 </template>
 <script>
 <script>
-    import E from 'wangeditor'
-    export default {
-        data() {
-            return {
-                scope: false,
-                isLoaded:false,
-                classroomList: [],
-                periodList: [],
-                gradeList: [],
-                subjectList:[],
-                teacherList: [
-                    {
-                        teacherName: '张飞',
-                        TEAMModelId:'001#0101'
-                    },
-                    {
-                        teacherName:'狄仁杰',
-                        TEAMModelId:'001#0111'
-                    },
-                    {
-                        teacherName:'诸葛亮',
-                        TEAMModelId:'001#0102'
-                    },
-                    {
-                        teacherName:'码云',
-                        TEAMModelId:'001#0103'
-                    },
-                    {
-                        teacherName:'马可波罗',
-                        TEAMModelId:'001#0104'
-                    },
-                    {
-                        teacherName:'刘备',
-                        TEAMModelId:'001#0105'
-                    },
-                    {
-                        teacherName:'关羽',
-                        TEAMModelId:'001#0106'
-                    },
-                    {
-                        teacherName:'王昭君',
-                        TEAMModelId:'001#0107'
-                    },
-                    {
-                        teacherName:'貂蝉',
-                        TEAMModelId:'001#0108'
-                    }
+  import fn from '@/utils/js-fn.js'
+  import NoData from '@/common/NoData.vue'
+  import E from 'wangeditor'
+  export default {
+    components: {
+      NoData
+    },
+    data() {
+      return {
+        fn,
+        recordEdit: {},
+        scope: false,
+        isLoaded: false,
+        classroomList: [],
+        periodList: [],
+        gradeList: [],
+        subjectList: [],
+        teacherList: [
+          {
+            teacherName: '张飞',
+            TEAMModelId: '001#0101'
+          },
+          {
+            teacherName: '狄仁杰',
+            TEAMModelId: '001#0111'
+          },
+          {
+            teacherName: '诸葛亮',
+            TEAMModelId: '001#0102'
+          },
+          {
+            teacherName: '码云',
+            TEAMModelId: '001#0103'
+          },
+          {
+            teacherName: '马可波罗',
+            TEAMModelId: '001#0104'
+          },
+          {
+            teacherName: '刘备',
+            TEAMModelId: '001#0105'
+          },
+          {
+            teacherName: '关羽',
+            TEAMModelId: '001#0106'
+          },
+          {
+            teacherName: '王昭君',
+            TEAMModelId: '001#0107'
+          },
+          {
+            teacherName: '貂蝉',
+            TEAMModelId: '001#0108'
+          }
 
 
-                ],
-                noticeEditor: undefined,
-                editTimeIndex: -1,
-                weekList: [
-                    {
-                        label: '星期一',
-                        value:'MON'
-                    },
-                    {
-                        label: '星期二',
-                        value:'TUE'
-                    },
-                    {
-                        label: '星期三',
-                        value:'WED'
-                    },
-                    {
-                        label: '星期四',
-                        value:'THU'
-                    },
-                    {
-                        label: '星期五',
-                        value:'FRI'
-                    },
-                    {
-                        label: '星期六',
-                        value:'SAT'
-                    },
-                    {
-                        label: '星期日',
-                        value:'SUN'
-                    }
-                ],
-                frequencyList: [
-                    {
-                        label: '每日课程',
-                        value:'day'
-                    },
-                    {
-                        label: '每周课程',
-                        value:'week'
-                    },
-                    {
-                        label: '每月课程',
-                        value:'month'
-                    },
-                    {
-                        label: '临时课程',
-                        value:'temporary'
-                    }
-                ],
-                courseTimeInfo: {
-                    frequency: '',
-                    begin: '',
-                    end: '',
-                    classroomCode: '',
-                    date: ''
-                },
-                courseTimeList: [
-                    {
-                        frequency: 'day',
-                        date:'',
-                        begin: '10:50',
-                        end: '11:30',
-                        classroom: '第一教学楼B206',
-                        status:0
-                    },
-                    {
-                        frequency: '每日开课',
-                        date:'',
-                        begin: '',
-                        end: '',
-                        classroom: '',
-                        status:1
-                    }
-                ]
+        ],
+        noticeEditor: undefined,
+        editTimeIndex: -1,
+        isFull:false,
+        weekList: [
+          {
+            label: '星期一',
+            value: 'MON'
+          },
+          {
+            label: '星期二',
+            value: 'TUE'
+          },
+          {
+            label: '星期三',
+            value: 'WED'
+          },
+          {
+            label: '星期四',
+            value: 'THU'
+          },
+          {
+            label: '星期五',
+            value: 'FRI'
+          },
+          {
+            label: '星期六',
+            value: 'SAT'
+          },
+          {
+            label: '星期日',
+            value: 'SUN'
+          }
+        ],
+        frequencyList: [
+          {
+            label: '每日课程',
+            value: 'day'
+          },
+          {
+            label: '每周课程',
+            value: 'week'
+          },
+          //{
+          //  label: '每月课程',
+          //  value: 'month'
+          //},
+          {
+            label: '临时课程',
+            value: 'temporary'
+          }
+        ],
+        ruleValidate: {
+          courseName: [
+            { required: true, message: '课程名称不能为空', trigger: 'change' }
+          ],
+          periodCode: [
+            { required: true, message: '学段信息不能为空', trigger: 'change' }
+          ],
+          gradeCode: [
+            { required: true, message: '年级信息不能为空', trigger: 'change' }
+          ],
+          subjectCode: [
+            { required: true, message: '科目信息不能为空', trigger: 'change' }
+          ],
+          notice: [
+            { required: true, message: '课程公告不能为空', trigger: 'change' }
+          ]
+        }
+      }
+    },
+    methods: {
+      validateForm() {
+        this.$refs['courseBaseInfo'].validate((valid) => {
+          console.log('valid:' + valid)
+          if (valid) {
+            if (this.courseInfo.baseInfo.notice !== '' && this.courseInfo.baseInfo.notice !== '<p><br></p>') {
+              this.isFull = true
+            } else {
+              this.courseInfo.baseInfo.notice = ''
+              this.isFull = false
             }
             }
-        },
-        methods: {
-            editCourseTime(index) {
-                this.editTimeIndex = index
-            },
-            getClassroomName(code) {
-                let c = []
-                if (this.$store.state.schoolBaseInfo.classroomList !== undefined) {
-                    let c = this.$store.state.schoolBaseInfo.classroomList.filter(
-                        (item) => {
-                            return item.classroomCode == code
-                        }
-                    )
-                }
-                return c.length > 0 ? c[0].classroomName:'暂未选择教室'
-            },
-            addCourseTime() {
-                this.courseInfo.courseTime.push(
-                    {
-                        frequency: 'day',//上课频率 每日、每周、每月、临时课程
-                        begin: '',//课程开始时间
-                        end: '',//课程结束时间
-                        classroom: '',//上课班级/教室
-                        date: '',//临时课程
-                        day: '',//每月课程
-                        weekly: ''//每周课程
-                    }
-                )
-                this.editTimeIndex = this.courseInfo.courseTime.length - 1
-            },
-            getSchoolBaseInfo() {
-                 this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            alert('数据为空!');
-                        }
-                         this.isLoaded = true
-                    },
-                    (err) => {
-                        alert('API error!')
-                        this.isLoaded = true
-                    }
-                )
-            },
-            getClassroom() {
-                 this.$store.dispatch('schoolBaseInfo/getClassroom').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            alert('数据为空!');
-                        }
-                    },
-                    (err) => {
-                        alert('API error!')
-                    }
-                )
-            },
-            initEditor() {
-                console.log(this.$refs)
-                console.log(this.$refs.courseNotice)
-                let noticeEditor = new E(this.$refs.courseNotice)
-                noticeEditor.customConfig.onchange = (html) => {
-                    this.courseInfo.notice = html
+          } else {
+            this.isFull = false
+          }
+        })
+      },
+      setNoticeContent() {
+        console.log('调用子组件方法')
+        if (this.noticeEditor != undefined) {
+          this.noticeEditor.txt.html(this.courseInfo.baseInfo.notice)
+          setTimeout(() => {
+            this.validateForm()
+          }, 500)
+        }
+      },
+      editCourseTime(index) {
+        this.editTimeIndex = index
+        Object.assign(this.recordEdit, this.courseInfo.courseTime[index])
+      },
+      getClassroomName(code) {
+        let c = []
+        if (this.$store.state.schoolBaseInfo.classroomList !== undefined) {
+          c = this.$store.state.schoolBaseInfo.classroomList.filter(
+            (item) => {
+              return item.classroomCode == code
+            }
+          )
+        }
+        return c.length > 0 ? c[0].classroomName : '暂未选择教室'
+      },
+      addCourseTime() {
+        this.courseInfo.courseTime.push(
+          {
+            frequencyCode: 'day',//上课频率 每日、每周、每月、临时课程
+            beginTime: '',//课程开始时间
+            endTime: '',//课程结束时间
+            classroomCode: '',//上课班级/教室
+            frequencyName: '',//临时课程
+          }
+        )
+        this.editTimeIndex = this.courseInfo.courseTime.length - 1
+        this.recordEdit = {}
+      },
+      getSchoolBaseInfo() {
+        this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+          (res) => {
+            if (res.code == 2) {
+              alert('数据为空!');
+            }
+            this.isLoaded = true
+          },
+          (err) => {
+            alert('API error!')
+            this.isLoaded = true
+          }
+        )
+      },
+      getClassroom() {
+        this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+          (res) => {
+            if (res.code == 2) {
+              alert('数据为空!');
+            }
+          },
+          (err) => {
+            alert('API error!')
+          }
+        )
+      },
+      initEditor() {
+        let noticeEditor = new E(this.$refs.courseNotice)
+        noticeEditor.customConfig.onchange = (html) => {
+          this.courseInfo.baseInfo.notice = html
+        }
+        noticeEditor.customConfig.menus = [
+          'bold',  // 粗体
+          'italic',  // 斜体
+          'underline',  // 下划线
+          'list',  // 列表
+          'link',  // 插入链接
+          'image',  // 插入图片
+        ],
+        noticeEditor.customConfig.showLinkImg = false
+        noticeEditor.customConfig.uploadFileName = 'files'
+        noticeEditor.create()
+        noticeEditor.txt.html(this.courseInfo.baseInfo.notice)
+        this.noticeEditor = noticeEditor
+      },
+      /*
+       * js-fn里面的getPeriod方法取代
+       */
+      //getCurrentGrade(index) {
+      //  this.gradeList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].grades
+      //  this.subjectList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].subjects
+      //},
+      submit(model) {
+        if (model == 'baseInfo') {
+          this.validateForm()
+          if (this.isFull) {
+            this.$api.courseMgmt.saveOrUpdateCourse([this.courseInfo]).then(
+              res => {
+                if (res.error == null) {
+                  this.$Message.success('保存成功!');
+                } else {
+                  this.$Message.error('保存失败,API Error!');
                 }
                 }
-                noticeEditor.customConfig.menus = [
-                    'bold',  // 粗体
-                    'italic',  // 斜体
-                    'underline',  // 下划线
-                    'list',  // 列表
-                    'link',  // 插入链接
-                    'image',  // 插入图片
-                ],
-                noticeEditor.customConfig.showLinkImg = false
-                noticeEditor.customConfig.uploadFileName = 'files'
-                noticeEditor.create()
-                this.noticeEditor = noticeEditor
+              },
+              err => {
+                this.$Message.error('保存失败,API Error!');
+              }
+            )
+          } else {
+            this.$Message.error('请完善信息在保存!');
+          }
+        } else if(model == 'courseTime'){
+          this.$api.courseMgmt.saveOrUpdateCourse([this.courseInfo]).then(
+            res => {
+              if (res.error == null) {
+                this.$Message.success('保存成功!');
+                this.editTimeIndex = -1
+                this.recordEdit = {}
+              } else {
+                this.$Message.error('保存失败,API Error!');
+              }
             },
             },
-            getCurrentGrade(index) {
-                this.gradeList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].grades
-                this.subjectList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].subjects
+            err => {
+              this.$Message.error('保存失败,API Error!');
+            }
+          )
+        }
+        
+      },
+      saveChange() {
+        if (this.isFull) {
+          this.$api.courseMgmt.saveOrUpdateCourse([this.courseInfo]).then(
+            res => {
+              if (res.error == null) {
+                this.$Message.success('保存成功!');
+              } else {
+                this.$Message.error('保存失败,API Error!');
+              }
             },
             },
-            submit() {
-                console.log(this.courseInfo)
-                this.editTimeIndex = -1
+            err => {
+              this.$Message.error('保存失败,API Error!');
             }
             }
+          )
+        } else {
+          this.$Message.error('请完善信息在保存!');
+        }
+      },
+      deleteTime(index) {
+        this.courseInfo.courseTime.splice(index, 1)
+        this.editTimeIndex = -1
+      },
+      cancelEditTime(index) {
+        console.log(this.recordEdit)
+        console.log(JSON.stringify(this.recordEdit) !== "{}")
+        if (JSON.stringify(this.recordEdit) !== "{}") {
+          Object.assign(this.courseInfo.courseTime[index], this.recordEdit)
+        } else {
+          this.courseInfo.courseTime.splice(index,1)
+        }
+        this.editTimeIndex = -1
+        this.recordEdit = {}
+      }
+    },
+    mounted() {
+      this.initEditor()
+    },
+    created() {
+      this.getSchoolBaseInfo()
+      this.getClassroom()
+    },
+    computed: {
+      courseInfo: {
+        get() {
+          return this.$store.getters['courseMgmt/courseInfo']
         },
         },
-        mounted() {
-            this.initEditor()
-        },
-        created() {
-            this.getSchoolBaseInfo()
-            this.getClassroom()
-        },
-        computed: {
-            courseInfo: {
-                get() {
-                    return this.$store.getters.courseInfo
-                },
-                set(newVal) {
-                    console.log(newVal)
-                }
+        set(newVal) {
+          console.log(newVal)
+        }
+      }
+    },
+    
+    watch: {
+      'courseInfo.baseInfo': {
+        handler(val, oldVal) {
+          this.$refs['courseBaseInfo'].validate((valid) => {
+            if (valid) {
+              if (this.courseInfo.baseInfo.notice !== '' && this.courseInfo.baseInfo.notice !== '<p><br></p>') {
+                this.isFull = true
+              } else {
+                this.courseInfo.baseInfo.notice = ''
+                this.isFull = false
+              }
+              //this.$Message.success('Success!');
+            } else {
+              this.isFull = false
             }
             }
+          })
         },
         },
-        watch: {
-
-        }
+        deep: true //true 深度监听
+      }
     }
     }
+  }
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
-    @import './CourseBaseSetting.less';
+  @import './CourseBaseSetting.less';
 </style>
 </style>
 <style>
 <style>
-    .course-base-info-content .w-e-menu {
-        z-index:9 !important;
-    }
-    .course-teacher-item .ivu-checkbox {
-        float:right;
-        margin-right:30px;
-    }
-    .course-teacher-item .ivu-checkbox-inner, .course-teacher-search-box .ivu-checkbox-inner {
-        background:none;
-    }
-    .search-course-teacher .ivu-input {
-        background:none;
-        border-color:#424242;
-        border-radius:8px;
-    }
+  .course-base-info-content .w-e-menu {
+    z-index: 9 !important;
+  }
+
+  .course-teacher-item .ivu-checkbox {
+    float: right;
+    margin-right: 30px;
+  }
+
+  .course-teacher-item .ivu-checkbox-inner, .course-teacher-search-box .ivu-checkbox-inner {
+    background: none;
+  }
+
+  .search-course-teacher .ivu-input {
+    background: none;
+    border-color: #424242;
+    border-radius: 8px;
+  }
 </style>
 </style>

+ 2 - 1
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseClassroom.less

@@ -188,13 +188,14 @@
         .classroom-student {
         .classroom-student {
             width: 100%;
             width: 100%;
             height: 100%;
             height: 100%;
-
+            overflow-y:auto;
             .classroom-student-menu {
             .classroom-student-menu {
                 width:100%;
                 width:100%;
                 height:45px;
                 height:45px;
                 border-bottom:1px solid @borderColor;
                 border-bottom:1px solid @borderColor;
                 line-height:45px;
                 line-height:45px;
                 padding-left:10px;
                 padding-left:10px;
+                color:@primary-textColor;
             }
             }
         }
         }
     }
     }

+ 385 - 30
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseClassroom.vue

@@ -92,29 +92,101 @@
               </div>
               </div>
             </div>
             </div>
             <div v-if="currentSetIndex === 1" class="classroom-student">
             <div v-if="currentSetIndex === 1" class="classroom-student">
-              <div class="classroom-student-menu">
-                <span>删除所选学生</span>
-                <Button type="info" size="small" style="">删除</Button>
-              </div>
-              <Table :columns="studentColumn" :data="classroomStudent" class="system-classroom-table">
-                <template slot-scope="{ row ,index}" slot="action">
-                  <strong></strong>
-                </template>
-              </Table>
+              <vuescroll>
+                <div class="classroom-student-menu">
+                  <Button type="primary" size="small" style="float:right;margin-right:60px;margin-top:10px;" @click="customGroup">自动分组</Button>
+                  <!--<span style="float:right;margin-right:30px;">|</span>-->
+                  <div style="float:right;margin-right:40px;">
+                    <span style="margin-right:5px;">移动所选学生到</span>
+                    <Select v-model="currentGroup" style="width:80px" size="small">
+                      <Option v-for="(item,index) in groupList" :value="index" :key="index">{{ item.group+ '('+item.groupName+')' }}</Option>
+
+                    </Select>
+                    <span style="margin-right:10px;margin-left:5px;">组</span>
+                    <Button type="success" size="small" style="" @click="setGroup">套用</Button>
+                  </div>
+                  <div style="float:right;margin-right:30px;">
+                    <span style="margin-right:5px;">删除所选学生</span>
+                    <Button type="info" size="small" style="">删除</Button>
+                  </div>
+                </div>
+                <Table :columns="studentColumn" :data="classroomStudent" class="system-classroom-table" height="600" @on-selection-change="getSelections">
+                  <template slot-scope="{ row ,index}" slot="action">
+                    <strong></strong>
+                  </template>
+                </Table>
+
+              </vuescroll>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
+      <Modal v-model="customGroupStatus"
+             title="自动分组"
+             @on-ok="comfirmCustomRules"
+             @on-cancel="cancel" class="custom-group">
+        <Form :label-width="80" :label-colon="true">
+          <FormItem label="学生人数">
+            <span>{{classroomStudent.length}}人</span>
+          </FormItem>
+          <FormItem label="组别数量">
+            <InputNumber :max="10" :min="1" v-model="groupNum"></InputNumber>
+          </FormItem>
+          <FormItem label="分组方式">
+            <RadioGroup v-model="groupType">
+              <Radio label="1">
+                <span>随机分组</span>
+              </Radio>
+              <Radio label="2">
+                <span>依座号分组</span>
+              </Radio>
+              <Radio label="3">
+                <span>依座顺序S形分组</span>
+              </Radio>
+            </RadioGroup>
+          </FormItem>
+        </Form>
+      </Modal>
     </div>
     </div>
+
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
   import QRCode from 'qrcodejs2'
   import QRCode from 'qrcodejs2'
   import E from 'wangeditor'
   import E from 'wangeditor'
+  import fn from '@/utils/js-fn.js'
+  import { group, max } from 'd3'
 
 
   export default {
   export default {
     data() {
     data() {
       return {
       return {
+        groupNum: 0,
+        groupType: 0,
+        selections: [],
+        customGroupStatus: false,
+        currentGroup: '',
+        groupList: [
+          {
+            group: 'A',
+            groupName: '组别别名A'
+          },
+          {
+            group: 'B',
+            groupName: '组别别名B'
+          },
+          {
+            group: 'C',
+            groupName: '组别别名C'
+          },
+          {
+            group: 'D',
+            groupName: '组别别名D'
+          },
+          {
+            group: 'E',
+            groupName: '组别别名E'
+          }
+        ],
         selectSystemStatus: 0,
         selectSystemStatus: 0,
         classroomEditor: undefined,
         classroomEditor: undefined,
         test: '',
         test: '',
@@ -161,38 +233,133 @@
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
           },
           },
           {
           {
             seatNo: 2,
             seatNo: 2,
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
           }, {
           }, {
             seatNo: 3,
             seatNo: 3,
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
           }, {
           }, {
             seatNo: 4,
             seatNo: 4,
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
           }, {
           }, {
             seatNo: 5,
             seatNo: 5,
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
           }, {
           }, {
             seatNo: 6,
             seatNo: 6,
             name: '学生姓名',
             name: '学生姓名',
             period: '高中',
             period: '高中',
             grade: '三年级',
             grade: '三年级',
-            group: 'A'
+            group: 'A',
+            groupName: '组别A'
+          },
+          {
+            seatNo: 7,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          },
+          {
+            seatNo: 8,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 9,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 10,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 11,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 12,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          },
+          {
+            seatNo: 13,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          },
+          {
+            seatNo: 14,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 15,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          },
+          {
+            seatNo: 16,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 17,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
+          }, {
+            seatNo: 18,
+            name: '学生姓名',
+            period: '高中',
+            grade: '三年级',
+            group: 'A',
+            groupName: '组别A'
           }
           }
         ],
         ],
         studentColumn: [
         studentColumn: [
@@ -205,7 +372,8 @@
             title: '座号',
             title: '座号',
             key: 'seatNo',
             key: 'seatNo',
             width: 120,
             width: 120,
-            align: 'center'
+            align: 'center',
+            sortable: true
           },
           },
           {
           {
             title: '姓名',
             title: '姓名',
@@ -222,15 +390,22 @@
             title: '年级',
             title: '年级',
             key: 'grade',
             key: 'grade',
             width: 150,
             width: 150,
-            align: 'center'
+            align: 'center',
+            sortable: true
           },
           },
           {
           {
             title: '组别',
             title: '组别',
             key: 'group',
             key: 'group',
             width: 150,
             width: 150,
+            align: 'center',
+            sortable: true
+          },
+          {
+            title: '组名',
+            key: 'groupName',
+            width: 150,
             align: 'center'
             align: 'center'
           }
           }
-
         ],
         ],
         testData: [
         testData: [
           {
           {
@@ -259,6 +434,132 @@
       }
       }
     },
     },
     methods: {
     methods: {
+      comfirmCustomRules() {
+        if (this.groupNum === 0) {
+          this.$Message.warning('分组数量不能为0')
+        } else if (this.groupType == 0) {
+          this.$Message.warning('请设置分组方式')
+        } else {
+          switch (this.groupType) {
+            case '1':
+              this.randomGroup()
+              break
+            case '2':
+              this.orderGroup()
+              break
+            case '3':
+              this.orderGroupS()
+              break
+            default:
+              break
+          }
+        }
+      },
+      cancel() {
+
+      },
+      orderGroupS() {
+        let surplus = this.classroomStudent.length % this.groupNum//余数
+        let maxCount = surplus == 0 ? this.classroomStudent.length / this.groupNum : Math.ceil(this.classroomStudent.length / this.groupNum)//每组最大人数
+        this.classroomStudent = this.classroomStudent.sort((a, b) => {
+          a.seatNo > b.seatNo
+        })
+        for (let i = 0; i < maxCount; i++) {
+          for (let j = 0; j < this.groupNum; j++) {
+            let startIndex = this.groupNum * i
+            if (startIndex + j < this.classroomStudent.length) {
+              this.classroomStudent[startIndex + j].group = j + 1
+              this.classroomStudent[startIndex + j].groupName = "组别别名" + (j + 1)
+            } else {
+              break
+            }
+          }
+        }
+      },
+      orderGroup() {
+        let surplus = this.classroomStudent.length % this.groupNum//余数
+        let maxCount = surplus == 0 ? this.classroomStudent.length / this.groupNum : Math.ceil(this.classroomStudent.length / this.groupNum)//每组最大人数
+        this.classroomStudent = this.classroomStudent.sort((a, b) => {
+          a.seatNo > b.seatNo
+        })
+        let flag = 0
+        let startIndex = 0
+        for (let i = 0; i < this.groupNum; i++) {
+          for (let j = 0; j < maxCount; j++) {
+            if (startIndex + j < this.classroomStudent.length) {
+              this.classroomStudent[startIndex + j].group = i + 1
+              this.classroomStudent[startIndex + j].groupName = "组别别名" + (i + 1)
+            } else {
+              break
+            }
+          }
+          startIndex += maxCount
+          flag++
+          if (flag == surplus) {
+            maxCount--
+          }
+        }
+      },
+      randomGroup() {
+        let surplus = this.classroomStudent.length % this.groupNum//余数
+        let surplusCount = surplus//余数
+        let maxCount = surplus == 0 ? this.classroomStudent.length / this.groupNum : Math.ceil(this.classroomStudent.length / this.groupNum)//每组最大人数
+        let record = {}//记录每个组已经分配的人数
+        for (let i = 1; i <= this.groupNum; i++) {
+          record[i] = 0
+        }
+        let flag = true
+        for (let index in this.classroomStudent) {
+          let groupIndex = fn.getBtwRandom(1, this.groupNum)
+          if (record[groupIndex] < maxCount) {
+            record[groupIndex] = record[groupIndex] + 1
+          } else {
+            for (let key in record) {
+              if (record[key] < maxCount) {
+                record[key] = record[key] + 1
+                groupIndex = key
+                break
+              }
+            }
+          }
+          this.classroomStudent[index].group = groupIndex
+          this.classroomStudent[index].groupName = "组别别名" + groupIndex
+          if (record[groupIndex] == maxCount) {
+            surplusCount--
+          }
+          if (surplusCount <= 0 && surplus > 0 && flag) {
+            maxCount--
+            flag = false
+          }
+        }
+      },
+      getSelections(selection) {
+        this.selections = selection
+        console.log(selection)
+      },
+      setGroup() {
+        if (this.currentGroup == '') {
+          this.$Message.warning('请设置组别')
+          return
+        }
+        if (this.selections.length == 0) {
+          this.$Message.warning('请选择需要设置组别的学生')
+          return
+        }
+        let groupInfo = this.groupList[this.currentGroup]
+        for (let item of this.selections) {
+          let index = fn.getIndex(this.classroomStudent, item)
+          if (index !== -1) {
+            this.classroomStudent[index].group = groupInfo.group
+            this.classroomStudent[index].groupName = groupInfo.groupName
+          } else {
+            this.$Message.error('error!');
+          }
+        }
+      },
+      customGroup() {
+        this.customGroupStatus = true
+      },
       getClassroomList() {
       getClassroomList() {
         if (this.$store.state.schoolBaseInfo.classroomList == undefined) {
         if (this.$store.state.schoolBaseInfo.classroomList == undefined) {
           this.$store.dispatch('schoolBaseInfo/getClassroom').then(
           this.$store.dispatch('schoolBaseInfo/getClassroom').then(
@@ -391,20 +692,22 @@
   .classroom-base-info .w-e-text {
   .classroom-base-info .w-e-text {
     overflow-y: auto;
     overflow-y: auto;
     color: white;
     color: white;
-    &::-webkit-scrollbar{ /*滚动条整体样式*/
-      width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-      height: 1px;
-    }
+    &::-webkit-scrollbar
 
 
-    &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-      -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-      background: rgb(124,124,124);
-    }
+  { /*滚动条整体样式*/
+    width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+    height: 1px;
+  }
 
 
-    &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-      -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-      background: rgba(68,68,68,.5);
-    }
+  &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgb(124,124,124);
+  }
+
+  &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgba(68,68,68,.5);
+  }
 
 
   }
   }
 
 
@@ -416,4 +719,56 @@
     opacity: 1;
     opacity: 1;
     transition: opacity .2s;
     transition: opacity .2s;
   }
   }
+
+  /*对话框样式修改*/
+  .custom-group .ivu-modal-content {
+    background-color: #383838 !important;
+    color: white;
+  }
+
+  .custom-group .ivu-modal-header {
+    border-color: #454545;
+    color: white;
+    background-color: #383838;
+    border-top-left-radius: 6px;
+    border-top-right-radius: 6px;
+  }
+
+  .custom-group .ivu-modal-mask {
+    background-color: rgba(20,20,20,.7);
+  }
+
+  .custom-group .ivu-input {
+    background: none;
+    border: none;
+    border-bottom: 1px solid #828282;
+    border-radius: 0px;
+    color: white;
+    font-size: 16px;
+  }
+
+  .custom-group .ivu-form-item-label {
+    color: #929292;
+  }
+
+  .custom-group .ivu-modal-body {
+    padding: 16px 30px;
+  }
+
+  .custom-group .ivu-modal-footer {
+    border-color: #454545;
+  }
+
+  .custom-group .ivu-modal-header p, .custom-group .ivu-modal-header-inner {
+    color: white;
+    font-weight: 600;
+  }
+
+  .custom-group .ivu-btn-text {
+    color: white;
+  }
+
+    .custom-group .ivu-btn-text:hover {
+      color: black;
+    }
 </style>
 </style>

+ 296 - 188
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseManage.vue

@@ -1,235 +1,343 @@
 <template>
 <template>
-    <div class="course-mgmt-content">
-        <div class="course-list">
-            <div class="course-list-header">
-                <span class="list-label">课程列表</span>
-                <Input prefix="ios-search" placeholder="" size="small" class="search-course"/>
-                <Icon type="md-add" color="white" size="18" class="add-icon" title="新建课程" @click="addCourse" />
-            </div>
-            <div class="course-list-content">
-                <span class="show-course-label">显示所有课程<Icon type="ios-arrow-down" size="16"/></span>
-                <div :class="index === $store.state.courseMgmt.currentCourseIndex ? 'course-list-item course-list-item-active':'course-list-item'" v-for="(item,index) in $store.state.courseMgmt.courseList" :key="index" @click="selectCourse(index)">
-                    <p class="course-code">
-                        <Icon :type="item.scope === 'school' ? 'ios-barcode-outline' : 'md-person'" color="#AAAAAA" />
-                        {{item.courseCode}}
-                    </p>
-                    <p class="course-name">
-                        {{item.courseName}}
-                    </p>
-                    <Breadcrumb>
-                        <BreadcrumbItem><Icon type="md-pricetag" style="margin-right:5px;"/>{{item.period}}</BreadcrumbItem>
-                        <BreadcrumbItem>{{item.grade}}</BreadcrumbItem>
-                        <BreadcrumbItem>{{item.subject}}</BreadcrumbItem>
-                    </Breadcrumb>
-                    <Icon type="ios-browsers" title="复制??" color="#EEEEEE" class="course-item-tool" size="30"/>
-                </div>
-            </div>
+  <div class="course-mgmt-content">
+    <div class="course-list">
+      <div class="course-list-header">
+        <span class="list-label">课程列表</span>
+        <Input prefix="ios-search" placeholder="" size="small" class="search-course" />
+        <Icon type="md-add" color="white" size="18" class="add-icon" title="新建课程" @click="addCourse" />
+      </div>
+      <div class="course-list-content">
+        <span class="show-course-label">显示所有课程<Icon type="ios-arrow-down" size="16" /></span>
+        <div v-if="$store.state.courseMgmt.courseList.length > 0" :class="index === $store.state.courseMgmt.currentCourseIndex ? 'course-list-item course-list-item-active':'course-list-item'" v-for="(item,index) in $store.state.courseMgmt.courseList" :key="index" @click="selectCourse(index)">
+          <p class="course-code">
+            <Icon :type="item.scope === 'school' ? 'ios-barcode-outline' : 'md-person'" color="#AAAAAA" />
+            {{item.baseInfo.courseCode}}
+          </p>
+          <p class="course-name">
+            {{item.baseInfo.courseName}}
+          </p>
+          <Breadcrumb>
+            <BreadcrumbItem><Icon type="md-pricetag" style="margin-right:5px;" />{{fn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,item.baseInfo.periodCode).periodName}}</BreadcrumbItem>
+            <BreadcrumbItem>{{fn.getGradeName($store.state.schoolBaseInfo.schoolBaseInfo,item.baseInfo.gradeCode)}}</BreadcrumbItem>
+            <BreadcrumbItem>{{fn.getSubjectName($store.state.schoolBaseInfo.schoolBaseInfo,item.baseInfo.subjectCode)}}</BreadcrumbItem>
+          </Breadcrumb>
+          <Icon type="ios-browsers" title="复制" color="#EEEEEE" class="course-item-tool" size="30" />
         </div>
         </div>
-        <div  class="course-detail">
-            <div class="course-detail-header">
-                <span :class="currentSettingIndex === 0 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(0)">课程设置</span>
-                <span :class="currentSettingIndex === 1 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(1)">课纲设置</span>
-                <span :class="currentSettingIndex === 2 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(2)">教室管理</span>
-            </div>
-            <CourseBaseSetting v-if="currentSettingIndex === 0" :class="currentSettingIndex === 0 ? 'animated fadeIn':'animated fadeOut'"></CourseBaseSetting>
-            <CourseClassroom v-if="currentSettingIndex === 2" :class="currentSettingIndex === 2 ? 'animated fadeIn':'animated fadeOut'"></CourseClassroom>
+        <div v-if="$store.state.courseMgmt.courseList.length == 0" style="width:100%;text-align:center;margin-top:120px;">
+          <NoData :textContent="'暂无课程信息'"></NoData>
         </div>
         </div>
+      </div>
     </div>
     </div>
+    <div class="course-detail">
+      <div class="course-detail-header">
+        <span :class="currentSettingIndex === 0 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(0)">课程设置</span>
+        <span :class="currentSettingIndex === 1 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(1)">课纲设置</span>
+        <span :class="currentSettingIndex === 2 ? 'setting-label setting-label-active':'setting-label'" @click="selectSetting(2)">教室管理</span>
+      </div>
+      <CourseBaseSetting ref="courseBaseSetting" v-if="currentSettingIndex === 0 && $store.state.courseMgmt.courseList.length > 0" :class="currentSettingIndex === 0 ? 'animated fadeIn':'animated fadeOut'"></CourseBaseSetting>
+      <CourseSyllabus v-if="currentSettingIndex === 1 && $store.state.courseMgmt.courseList.length > 0" :class="currentSettingIndex === 1 ? 'animated fadeIn':'animated fadeOut'"></CourseSyllabus>
+      <CourseClassroom v-if="currentSettingIndex === 2 && $store.state.courseMgmt.courseList.length > 0" :class="currentSettingIndex === 2 ? 'animated fadeIn':'animated fadeOut'"></CourseClassroom>
+      <div v-if="$store.state.courseMgmt.courseList.length == 0" style="width:100%;text-align:center;margin-top:180px;">
+        <NoData></NoData>
+      </div>
+    </div>
+  </div>
 </template>
 </template>
 <script>
 <script>
-    
-    import CourseBaseSetting from './CourseBaseSetting.vue'
-    import CourseClassroom from './CourseClassroom.vue'
-    export default {
-        components: {
-            CourseBaseSetting,
-            CourseClassroom
-        },
-        data() {
-            return {
-                currentSettingIndex:0,
-                addCourseStatus: false,
-                demoLoginInfo: {
-                    user: "admin",
-                    TEAMModelId: "habook#0001",
-                    school: "醍摩豆书院",
-                    schoolCode: "HBCN"
-                }
+  import fn from '@/utils/js-fn.js'
+  import '@/utils/Math.uuid'
+  import NoData from '@/common/NoData.vue'
+  import CourseBaseSetting from './CourseBaseSetting.vue'
+  import CourseClassroom from './CourseClassroom.vue'
+  import CourseSyllabus from './CourseSyllabus.vue'
+  export default {
+    components: {
+      CourseBaseSetting,
+      CourseClassroom,
+      CourseSyllabus,
+      NoData
+    },
+    data() {
+      return {
+        fn,
+        currentSettingIndex: 0,
+        addCourseStatus: false,
+        demoLoginInfo: {
+          user: "admin",
+          TEAMModelId: "habook#0001",
+          school: "醍摩豆书院",
+          schoolCode: "HBCN"
+        }
+      }
+    },
+    methods: {
+      getSchoolBaseInfo() {
+        this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+          (res) => {
+            if (res.code == 2) {
+              alert('数据为空!');
             }
             }
-        },
-        methods: {
-            selectSetting(index) {
-                this.currentSettingIndex = index
-            },
-            selectCourse(index) {
-                this.$store.commit('setCurrentCourseIndex',index)
-                //this.currentCourseIndex = index
-            },
-            addCourse() {
-                this.addCourseStatus = true
+            this.isLoaded = true
+          },
+          (err) => {
+            alert('API error!')
+            this.isLoaded = true
+          }
+        )
+      },
+      getClassroom() {
+        this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+          (res) => {
+            if (res.code == 2) {
+              alert('数据为空!');
             }
             }
-        },
-        created() {
+          },
+          (err) => {
+            alert('API error!')
+          }
+        )
+      },
+      selectSetting(index) {
+        this.currentSettingIndex = index
+
+      },
+      selectCourse(index) {
+        this.$store.commit('courseMgmt/setCurrentCourseIndex', index)
+        setTimeout(() => {
+          this.$refs.courseBaseSetting.setNoticeContent()
+        },1000)
+      },
+      addCourse() {
+        this.addCourseStatus = true
+        let item = {
+          id: Math.uuid(),
+          TEAMModelId: 'habook#0001',
+          partitionKey:'personal',
+          schoolCode: '0101',
+          scope: 'personal',//personal:私有 school:校本
+          baseInfo: {
+            courseCode: 'T968475',
+            courseName: '',
+            periodCode: '',
+            gradeCode: '',
+            subjectCode: '',
+            notice: '',//课程公告
+          },
+          assistTeacher: [],//协同教师
+          courseTime: [],//上课时间表
+          classroom: [],//课程“教室”
+          syllabus: []//关联课纲
         }
         }
-       
+        let test = this.$store.state.courseMgmt.courseList
+        test.push(item)
+        this.$store.commit('courseMgmt/setCourseList', test)
+        this.$store.commit('courseMgmt/setCurrentCourseIndex', this.$store.state.courseMgmt.courseList.length - 1)
+        setTimeout(() => {
+          this.$refs.courseBaseSetting.setNoticeContent()
+        },500)
+      },
+      getCourseInfo() {
+        this.$store.dispatch('courseMgmt/getCourseList').then(
+          (res) => {
+            console.log(res)
+            if (res.code == 1 || res.code == 3) {
+              this.schoolSetting = this.$store.state.schoolBaseInfo.schoolBaseInfo
+            } else {
+              //this.getDefaultData()
+            }
+            console.log(this.$store.state.courseMgmt.courseList)
+          },
+          (err) => {
+            console.log(err)
+          }
+        )
+      },
+    },
+    created() {
+      this.getCourseInfo()
+      this.getSchoolBaseInfo()
+      this.getClassroom()
     }
     }
+
+  }
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
-    @import './CourseManage.less';
+  @import './CourseManage.less';
 </style>
 </style>
 <style lang="less">
 <style lang="less">
-    .search-course .ivu-input {
-        background:none;
-        border-color:#424242;
-        border-radius:8px;
-    }
+  .search-course .ivu-input {
+    background: none;
+    border-color: #424242;
+    border-radius: 8px;
+  }
 
 
-    .course-list-item .ivu-breadcrumb > span:last-child {
-        font-weight:400;
-        color:#999;
-    }
-    
-    .ivu-table-overflowY {
-        &::-webkit-scrollbar{ /*滚动条整体样式*/
-            width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-            height: 1px;
-        }
+  .course-list-item .ivu-breadcrumb > span:last-child {
+    font-weight: 400;
+    color: #999;
+  }
 
 
-        &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-            background: rgb(124,124,124);
-        }
+  .ivu-table-overflowY {
+    &::-webkit-scrollbar
 
 
-        &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-            background: rgba(68,68,68,.5);
-        }
+  { /*滚动条整体样式*/
+    width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+    height: 1px;
+  }
 
 
-    }
+  &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgb(124,124,124);
+  }
+
+  &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgba(68,68,68,.5);
+  }
 
 
-    .course-base-info-content .ivu-input {
-    background:none;
-    border:none;
-    border-bottom:1px solid #828282;
-    border-radius:0px;
-    color:white;
-    font-size:16px;
   }
   }
+
+  .course-base-info-content .ivu-input {
+    background: none;
+    border: none;
+    border-bottom: 1px solid #828282;
+    border-radius: 0px;
+    color: white;
+    font-size: 16px;
+  }
+
   .course-base-info-content .ivu-form-item-label {
   .course-base-info-content .ivu-form-item-label {
-    color:#929292;
+    color: #929292;
   }
   }
-  .course-base-info-content .ivu-form-item-required .ivu-form-item-label:before{
-    color:#6DE2C4;
+
+  .course-base-info-content .ivu-form-item-required .ivu-form-item-label:before {
+    color: #6DE2C4;
   }
   }
+
   .course-base-info-content .ivu-form-item-error .ivu-input:focus {
   .course-base-info-content .ivu-form-item-error .ivu-input:focus {
-    border:none;
+    border: none;
   }
   }
-  .course-base-info-content .ivu-input-group-prepend{
-    border:none;
-    background:none;
-    color:white;
-    font-size:14px;
+
+  .course-base-info-content .ivu-input-group-prepend {
+    border: none;
+    background: none;
+    color: white;
+    font-size: 14px;
   }
   }
+
   .course-base-info-content .ivu-checkbox-wrapper {
   .course-base-info-content .ivu-checkbox-wrapper {
-    float:right;
-    color:#929292;
+    float: right;
+    color: #929292;
   }
   }
+
   .course-base-info-content .ivu-checkbox-inner {
   .course-base-info-content .ivu-checkbox-inner {
-    background:none;
-    border-color:#6DE2C4;
+    background: none;
+    border-color: #6DE2C4;
   }
   }
+
   .course-base-info-content .ivu-checkbox-checked .ivu-checkbox-inner:after {
   .course-base-info-content .ivu-checkbox-checked .ivu-checkbox-inner:after {
-    border-color:#6DE2C4;
+    border-color: #6DE2C4;
   }
   }
+
   .course-base-info-content .ivu-select-selection {
   .course-base-info-content .ivu-select-selection {
     border-color: #828282;
     border-color: #828282;
-    background:none;
-  }
-  .course-base-info-content .ivu-select-selection:hover {
-    border-color: #57a3f3;
+    background: none;
   }
   }
-    .course-base-info-content .ivu-select-input {
-        color: white;
-        font-size: 16px;
-    }
 
 
-    .course-base-info-content .w-e-toolbar {
-        background: #383838 !important;
-        border-radius: 5px 5px 0px 0px;
-        border-color:#383838 !important;
+    .course-base-info-content .ivu-select-selection:hover {
+      border-color: #57a3f3;
     }
     }
-    .course-base-info-content .w-e-text-container {
-        border-color:#383838 !important;
-        border-radius: 0px 0px 5px 5px;
-        overflow-y:auto !important;
-        height:220px !important;
-    }
-    .course-base-info-content .w-e-text {
-        overflow-y:auto;
-        color:white;
-        &::-webkit-scrollbar{ /*滚动条整体样式*/
-            width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-            height: 1px;
-        }
 
 
-        &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-            background: rgb(124,124,124);
-        }
+  .course-base-info-content .ivu-select-input {
+    color: white;
+    font-size: 16px;
+  }
 
 
-        &::-webkit-scrollbar-track { /*滚动条里面轨道*/
-            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-            background: rgba(68,68,68,.5);
-        }
-    }
+  .course-base-info-content .w-e-toolbar {
+    background: #383838 !important;
+    border-radius: 5px 5px 0px 0px;
+    border-color: #383838 !important;
+  }
 
 
-    .course-base-info-content .w-e-toolbar .w-e-menu:hover i{
-        color:white !important; 
-    }
-    .course-time-item .ivu-select-selection, .course-time-item .ivu-input{
-        background:none;
-        color:white;
-    }
-    .course-time-item .ivu-select-disabled .ivu-select-selection,.course-time-item .ivu-input[disabled] {
-        border:none;
-    }
-    .course-time-item .course-time .ivu-input[disabled] {
-        font-size:30px;
-    }
-        .course-time-item .ivu-select-disabled .ivu-select-selection .ivu-select-arrow {
-            display:none;
-        }
-    /*对话框样式修改*/
-    .add-course-modal .ivu-modal-content {
-        background-color: #383838 !important;
-        height: 700px;
-    }
+  .course-base-info-content .w-e-text-container {
+    border-color: #383838 !important;
+    border-radius: 0px 0px 5px 5px;
+    overflow-y: auto !important;
+    height: 220px !important;
+  }
 
 
-    .add-course-modal .ivu-modal-header {
-        border-color: #454545;
-        background-color: #383838;
-        border-top-left-radius:6px;
-        border-top-right-radius:6px;
-    }
+  .course-base-info-content .w-e-text {
+    overflow-y: auto;
+    color: white;
+    &::-webkit-scrollbar
 
 
-    .add-course-modal .ivu-modal-mask {
-        background-color: rgba(20,20,20,.7);
-    }
+  { /*滚动条整体样式*/
+    width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+    height: 1px;
+  }
 
 
-    .add-course-modal .ivu-input {
-        background: none;
-        border: none;
-        border-bottom: 1px solid #828282;
-        border-radius: 0px;
-        color: white;
-        font-size: 16px;
-    }
+  &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgb(124,124,124);
+  }
 
 
-    .add-course-modal .ivu-form-item-label {
-        color: #929292;
-    }
-    .add-course-modal .ivu-modal-body {
-        padding:16px 30px;
+  &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+    background: rgba(68,68,68,.5);
+  }
+
+  }
+
+  .course-base-info-content .w-e-toolbar .w-e-menu:hover i {
+    color: white !important;
+  }
+
+  .course-time-item .ivu-select-selection, .course-time-item .ivu-input {
+    background: none;
+    color: white;
+  }
 
 
+    .course-time-item .ivu-select-disabled .ivu-select-selection, .course-time-item .ivu-input[disabled] {
+      border: none;
     }
     }
+
+  .course-time-item .course-time .ivu-input[disabled] {
+    font-size: 30px;
+  }
+
+  .course-time-item .ivu-select-disabled .ivu-select-selection .ivu-select-arrow {
+    display: none;
+  }
+  /*对话框样式修改*/
+  .add-course-modal .ivu-modal-content {
+    background-color: #383838 !important;
+    height: 700px;
+  }
+
+  .add-course-modal .ivu-modal-header {
+    border-color: #454545;
+    background-color: #383838;
+    border-top-left-radius: 6px;
+    border-top-right-radius: 6px;
+  }
+
+  .add-course-modal .ivu-modal-mask {
+    background-color: rgba(20,20,20,.7);
+  }
+
+  .add-course-modal .ivu-input {
+    background: none;
+    border: none;
+    border-bottom: 1px solid #828282;
+    border-radius: 0px;
+    color: white;
+    font-size: 16px;
+  }
+
+  .add-course-modal .ivu-form-item-label {
+    color: #929292;
+  }
+
+  .add-course-modal .ivu-modal-body {
+    padding: 16px 30px;
+  }
 </style>
 </style>

+ 54 - 0
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseSyllabus.less

@@ -0,0 +1,54 @@
+@first-bgColor: #141414;
+@second-bgColor: #1b1b1b;
+@third-bgColor: #222222;
+@borderColor: #424242;
+@primary-textColor: #fff; //文本主颜色
+@second-textColor: #a5a5a5; //文本副级颜色
+@primary-fontSize: 14px;
+@second-fontSize: 16px;
+
+.course-syllabus-content {
+  width: 100%;
+  height: ~"calc(100% - 45px)";
+  color: @second-textColor;
+
+  .course-syllabus-tab-box {
+    width: 100%;
+    height: 45px;
+    border-bottom: 1px solid @borderColor;
+    padding-left: 10px;
+
+    .tab-label {
+      line-height: 45px;
+      color: @second-textColor;
+      margin-right: 55px;
+      cursor: pointer;
+    }
+
+    .tab-label-active {
+      color: white;
+      font-weight: 600;
+      border-bottom: 2px solid white;
+    }
+  }
+
+  .syllabus-filter-box {
+    width: 100%;
+    padding: 20px 10px;
+    border-bottom: 1px solid @borderColor;
+
+    span {
+      color: @second-textColor;
+    }
+  }
+
+  .course-syllabus-box {
+    width: 100%;
+    height: ~"calc(100% 146px)";
+    padding-top:15px;
+    padding-left:10px;
+    position:relative; 
+  }
+
+ 
+}

+ 109 - 0
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseSyllabus.vue

@@ -0,0 +1,109 @@
+<template>
+  <div class="course-syllabus-content">
+    <div class="course-syllabus-tab-box">
+      <span :class="currentTabIndex == 0 ? 'tab-label tab-label-active':'tab-label'" @click="selectSyllabusTab(0)">校本课纲</span>
+      <span :class="currentTabIndex == 1 ? 'tab-label tab-label-active':'tab-label'" @click="selectSyllabusTab(1)">私人课纲</span>
+    </div>
+    <div class="syllabus-filter-box">
+      <div>
+        <span>学制 / 年级:</span>
+        <Select v-model="filters.periodCode" filterable style="width:180px;" placeholder="请选择学制" :clearable="true" size="small">
+          <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index" @click.native="getCurrentGrade(index)">{{ item.periodName }}</Option>
+        </Select>
+        <Select v-model="filters.gradeCode" filterable style="width:180px;margin-left:20px;margin-right:40px;" placeholder="请选择年级" :clearable="true" size="small">
+          <Option v-for="(item,index) in gradeList" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
+        </Select>
+        <span>学科:</span>
+        <Select v-model="filters.subjectCode" filterable style="width:240px;" placeholder="请选择科目" :clearable="true" size="small">
+          <Option v-for="(item,index) in subjectList" :value="item.subjectCode" :key="index">{{ item.subjectName }}</Option>
+        </Select>
+        </br>
+        <Checkbox v-model="showAll" style="margin-top:15px;">显示未选择的所有课纲</Checkbox>
+      </div>
+    </div>
+    <div class="course-syllabus-box">
+      <Tree :data="data4" show-checkbox multiple></Tree>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    data() {
+      return {
+        data4: [
+          {
+            title: 'parent 1',
+            expand: true,
+            selected: true,
+            children: [
+              {
+                title: 'parent 1-1',
+                expand: true,
+                children: [
+                  {
+                    title: 'leaf 1-1-1',
+                    disabled: true
+                  },
+                  {
+                    title: 'leaf 1-1-2'
+                  }
+                ]
+              },
+              {
+                title: 'parent 1-2',
+                expand: true,
+                children: [
+                  {
+                    title: 'leaf 1-2-1',
+                    checked: true
+                  },
+                  {
+                    title: 'leaf 1-2-1'
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        showAll: false,
+        currentTabIndex: 0,
+        filters: {
+          periodCode: '',
+          gradeCode: '',
+          subjectCode:''
+        },
+        gradeList: [],
+        subjectList:[]
+      }
+    },
+    methods: {
+      selectSyllabusTab(index) {
+        this.currentTabIndex = index
+      },
+      getCurrentGrade(index) {
+        this.gradeList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].grades
+        this.subjectList = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[index].subjects
+      },
+    }
+  }
+</script>
+<style scoped lang="less">
+  @import './CourseSyllabus.less';
+</style>
+<style>
+  .syllabus-filter-box .ivu-select-input {
+    color: white;
+  }
+
+  .syllabus-filter-box .ivu-select-selection {
+    border-color: #424242;
+  }
+
+  .course-syllabus-content .ivu-checkbox-inner {
+    background: none;
+  }
+
+  .course-syllabus-box .ivu-tree-title {
+    color: #a5a5a5;
+  }
+</style>

文件差异内容过多而无法显示
+ 809 - 809
TEAMModelOS/ClientApp/src/view/school-mgmt/ClassroomSetting/ClassroomSetting.vue


文件差异内容过多而无法显示
+ 636 - 654
TEAMModelOS/ClientApp/src/view/school-mgmt/SystemSetting/SystemSetting.vue


+ 1 - 1
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/Index.vue

@@ -1,4 +1,4 @@
-<style lang="less" scoped>
+ <style lang="less" scoped>
     @import './Index.less';
     @import './Index.less';
 </style>
 </style>
 
 

+ 22 - 11
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -82,7 +82,7 @@
                 <div class="item-tools">
                 <div class="item-tools">
                   <Icon type="md-download" size="18" color="white" title="下载文件" @click="downloadFile(index)" />
                   <Icon type="md-download" size="18" color="white" title="下载文件" @click="downloadFile(index)" />
                   <Icon v-show="row.type === 'picture' || row.type === 'video' || row.extension == 'pdf'" type="md-eye" size="18" color="white" title="预览文件" @click="openPreviewFile(index)" />
                   <Icon v-show="row.type === 'picture' || row.type === 'video' || row.extension == 'pdf'" type="md-eye" size="18" color="white" title="预览文件" @click="openPreviewFile(index)" />
-                  <Icon type="md-infinite" size="18" color="white" title="绑定知识点" />
+                  <Icon type="md-infinite" size="18" color="white" title="绑定知识点" @click="bindKnowledge(index)" />
                   <Icon type="md-create" size="18" color="white" title="编辑名称" @click="setFileNameEdit(index)" />
                   <Icon type="md-create" size="18" color="white" title="编辑名称" @click="setFileNameEdit(index)" />
                   <Icon type="md-trash" size="18" color="white" title="删除文件" @click="delFile(index)" />
                   <Icon type="md-trash" size="18" color="white" title="删除文件" @click="delFile(index)" />
                 </div>
                 </div>
@@ -94,18 +94,18 @@
               <div class="card-item animated fadeIn" v-for="(item,index) in fileListShow" :key="index">
               <div class="card-item animated fadeIn" v-for="(item,index) in fileListShow" :key="index">
                 <span class="file-name">{{item.fileName}}</span>
                 <span class="file-name">{{item.fileName}}</span>
                 <img :src="item.compressUrl+sasString"
                 <img :src="item.compressUrl+sasString"
-                     width="300" style="border-radius:5px;"/>
+                     width="300" style="border-radius:5px;" />
                 <div class="item-tools">
                 <div class="item-tools">
                   <Icon type="md-download"
                   <Icon type="md-download"
                         size="18"
                         size="18"
                         color="white"
                         color="white"
-                        title="下载文件" @click="downloadFile(index)"/>
+                        title="下载文件" @click="downloadFile(index)" />
                   <Icon type="md-eye"
                   <Icon type="md-eye"
                         size="18"
                         size="18"
                         color="white"
                         color="white"
-                        title="预览文件" @click="openPreviewFile(index)"/>
-                  <Icon type="md-infinite" size="18" color="white" title="绑定知识点" />
-                  <Icon type="md-trash" size="18" color="white" title="删除文件" @click="delFile(index)"/>
+                        title="预览文件" @click="openPreviewFile(index)" />
+                  <Icon type="md-infinite" size="18" color="white" title="绑定知识点"  @click="bindKnowledge(index)" />
+                  <Icon type="md-trash" size="18" color="white" title="删除文件" @click="delFile(index)" />
                   <span style="color:white; float:right;">{{formatDate(item.createTime)}}</span>
                   <span style="color:white; float:right;">{{formatDate(item.createTime)}}</span>
                   <span style="color:white; float:right;margin-right:10px;">{{item.size/1024 > 1024 ? (item.size/1024/1024).toFixed(1) + 'M': (item.size/1024).toFixed(1) + 'KB'}}</span>
                   <span style="color:white; float:right;margin-right:10px;">{{item.size/1024 > 1024 ? (item.size/1024/1024).toFixed(1) + 'M': (item.size/1024).toFixed(1) + 'KB'}}</span>
                 </div>
                 </div>
@@ -124,14 +124,21 @@
       <video v-if="previewFile.type == 'video'" :src="previewFile.blobUrl+sasString" width="780" controls="controls">
       <video v-if="previewFile.type == 'video'" :src="previewFile.blobUrl+sasString" width="780" controls="controls">
         您的浏览器不支持 video 标签。
         您的浏览器不支持 video 标签。
       </video>
       </video>
-      <img v-if="previewFile.type == 'picture'" :src="previewFile.blobUrl+sasString" width="780" style="border-radius:5px;"/>
+      <img v-if="previewFile.type == 'picture'" :src="previewFile.blobUrl+sasString" width="780" style="border-radius:5px;" />
       <embed v-if="previewFile.type == 'document'" :src="previewFile.blobUrl+sasString" width="780" height="600" />
       <embed v-if="previewFile.type == 'document'" :src="previewFile.blobUrl+sasString" width="780" height="600" />
       <div slot="footer"></div>
       <div slot="footer"></div>
     </Modal>
     </Modal>
+    <Modal v-model="bindStatus"
+           title="绑定知识点" class="upload-modal"  width="660" :mask-closable="false">
+      <p>知识点</p>
+      <p>知识点</p>
+      <p>知识点</p>
+      <p>知识点</p>
+      <p>知识点</p>
+    </Modal>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-  import axios from 'axios'
   import EditableLabel from '@/common/EditableLabel.vue'
   import EditableLabel from '@/common/EditableLabel.vue'
   import UploadFile from '@/common/UploadFile.vue'
   import UploadFile from '@/common/UploadFile.vue'
   export default {
   export default {
@@ -205,6 +212,7 @@
           range: 'private',
           range: 'private',
           sha1Code: ''
           sha1Code: ''
         },
         },
+        bindStatus: false,
         previewStatus: false,
         previewStatus: false,
         storageSpace: 0,
         storageSpace: 0,
         uploadStatus: false,
         uploadStatus: false,
@@ -278,6 +286,9 @@
     methods: {
     methods: {
       change() {
       change() {
 
 
+      },
+      bindKnowledge(index) {
+        this.bindStatus = true
       },
       },
       getSasStr() {
       getSasStr() {
         this.$api.uploadFile.getContainerSAS().then(
         this.$api.uploadFile.getContainerSAS().then(
@@ -407,7 +418,9 @@
           (res) => {
           (res) => {
             if (res.error == null) {
             if (res.error == null) {
               this.$Message.success('文件上传成功!')
               this.$Message.success('文件上传成功!')
-              this.file.push(...[this.uploadFileList])
+              this.fileListShow.concat (this.uploadFileList)
+              this.fileList.concat (this.uploadFileList)
+              this.activeTypeIndex = 0
               this.uploadFileList = []
               this.uploadFileList = []
             }
             }
           },
           },
@@ -420,8 +433,6 @@
         this.uploadStatus = !this.uploadStatus
         this.uploadStatus = !this.uploadStatus
       },
       },
       getFileUrl(file) {  //获取文件地址
       getFileUrl(file) {  //获取文件地址
-        console.log('-------')
-        console.log(file)
         this.uploadFileList.push({
         this.uploadFileList.push({
           schoolCode: this.demoLoginInfo.schoolCode,
           schoolCode: this.demoLoginInfo.schoolCode,
           TEAMModelId: this.demoLoginInfo.TEAMModelId,
           TEAMModelId: this.demoLoginInfo.TEAMModelId,