From e1c94388bde1a53f2122f42e31e77116f8dcc5c7 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Mon, 29 Jul 2024 17:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 + src/views/modules/course/courseList.vue | 358 ++++++++-- src/views/modules/miniClass/classAddType.vue | 411 ++++++++++++ src/views/modules/miniClass/miniClass.vue | 634 ++++++++++++++++++ src/views/modules/miniClass/miniClassList.vue | 352 ++++++++++ src/views/modules/miniClass/miniClassType.vue | 322 +++++++++ static/config/index.js | 4 +- 7 files changed, 2034 insertions(+), 50 deletions(-) create mode 100644 src/views/modules/miniClass/classAddType.vue create mode 100644 src/views/modules/miniClass/miniClass.vue create mode 100644 src/views/modules/miniClass/miniClassList.vue create mode 100644 src/views/modules/miniClass/miniClassType.vue diff --git a/src/router/index.js b/src/router/index.js index fbe8184..58ef557 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -66,6 +66,9 @@ const mainRoutes = { { path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } }, { path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } }, { path: '/workOrder', component: _import('modules/workOrderLIst'), name: 'workOrder', meta: { title: '工单列表', isTab: true } }, + // { path: '/miniClassList', component: _import('modules/miniClass/miniClassList'), name: 'miniClass', meta: { title: '班级列表', isTab: true } }, + { path: '/miniClassList8', component: _import('modules/miniClass/miniClassList8'), name: 'miniClassList8', meta: { title: 'miniClassList8', isTab: true } }, + { path: '/ClassType', component: _import('modules/miniClass/miniClassType'), name: 'ClassType', meta: { title: '班级类型管理', isTab: true } }, ], beforeEnter (to, from, next) { let token = Vue.cookie.get('token') diff --git a/src/views/modules/course/courseList.vue b/src/views/modules/course/courseList.vue index c67310b..0ebb978 100644 --- a/src/views/modules/course/courseList.vue +++ b/src/views/modules/course/courseList.vue @@ -69,8 +69,13 @@ > @@ -159,7 +164,7 @@ align="center" label="排序" > - + 修改 - 查看引用 + 查看引用 删除 + + + @@ -211,9 +245,9 @@
-
当前课程共有 {{resList.length}} 个标签引用
+
+ 当前课程共有 {{ resList.length }} 个标签引用 +
- {{index + 1}}、 {{ item.title }} + {{ index + 1 }}、 {{ item.title }} - > {{ item1.title }} + + > {{ item1.title }} - > {{ item2.title }} + + > {{ item2.title }} - > {{ item3.title }} - + + > {{ item3.title }} + @@ -260,6 +295,65 @@ 好 的 + + +
+

当前操作的课程:{{ optCourse.title }}

+ + + + + + + + + + + + + 主任和副主任不可以是同一个人 + +
+ + 提 交 + +
@@ -270,6 +364,15 @@ export default { data() { return { selectType: [], + director: { + director: null, + ddirector: null + }, + directorShow: false, + remoteMethodLoading: false, + miniClassVisible: false, + personSeting: false, + userList: [], options: [ { id: "all", @@ -287,11 +390,11 @@ export default { children: [] } ], - courseId:"0", + courseId: "0", dataForm: { - key: "", + key: "" }, - relationProducts:[], + relationProducts: [], query: { type: "", categoryId: "", @@ -311,7 +414,8 @@ export default { sociologyList: "/master/courseSociology/getCourseSociologyList" //国学 }, resList: [], - resListVisible: false + resListVisible: false, + optCourse: {} }; }, components: { @@ -328,28 +432,176 @@ export default { this.getTreeList(this.urlList.sociologyList, 2); }, methods: { - delPro(val){ - console.log(val,this.relationProducts) - let list = this.relationProducts + delPro(val) { + console.log(val, this.relationProducts); + let list = this.relationProducts; + this.relationProducts = list.slice(1, 1); + }, + saveDirector() { + if(this.director.director == this.director.ddirector && this.director.director != null){ + this.$message.error('主任与副主任不能是同一人') + return + } + var director = 0; + var ddirector = 0; + if (this.director.director) { + director = this.director.director; + } + if (this.director.ddirector) { + ddirector = this.director.ddirector; + } + this.$http({ + url: this.$http.adornUrl("/master/course/editCourseDirector"), + method: "post", + data: this.$http.adornData({ + courseId: this.optCourse.id, + director: director, //主任,清空时传0 + ddirector: ddirector //副主任,清空时传0 + }) + }) + .then(res => { + if (res.data.code == 0) { + this.$message.success("操作成功!"); + this.closeDirector(); + } + }) + .catch(e => { + this.$message.error("获取课程信息失败"); + _info = null; + }); + }, + closeDirector() { + this.directorShow = false; + setTimeout(() => { + this.$nextTick(() => { + this.$refs["director"].resetFields(); + this.director = { + director: null, + ddirector: null + }; + this.userList = [] + this.optCourse = {}; + console.log("director关闭了吗", this.director); + }) + + },200) - this.relationProducts = list.slice(1,1) - - }, - pclose(){ - this.relationProducts = [] - this.courseId = null - console.log('关闭了 ') + async showDirectorShow(data) { + this.optCourse = data; + var obj = await this.getDirectorInfo(data.id); + console.log("教务信息", obj); + if (obj) { + // console.log("有绑定", obj.data.director.tel); + if (obj.data.director != null) { + var list = this.userList.map( item => { return item.id}) + console.log('list',list) + var i = list.find(function(elem){ + return elem == obj.data.director.id; + }); + if(!i){ + this.userList.push({ + id:obj.data.director.id, + tel:obj.data.director.tel + }) + } + this.director.director = obj.data.director.id; + } + else { + // this.director.director = null; + } + if (obj.data.ddirector != null) { + console.log('jinlailema') + var list = this.userList.map( item => { return item.id}) + console.log('list',list) + var i = list.find(function(elem){ + return elem == obj.data.ddirector.id; + }); + if(!i){ + this.userList.push({ + id:obj.data.ddirector.id, + tel:obj.data.ddirector.tel + }) + } + this.director.ddirector = obj.data.ddirector.id; + } + else { + // this.ddirector.director = null; + } + + } else { + console.log("没有绑定"); + this.director = { + director: null, + ddirector: null + }; + } + this.directorShow = true; }, - linkList(data){ - console.log('父级',data) - if(data && data.length > 0){ - this.relationProducts = data + // 检索教务信息 + getDirectorInfo(id) { + return new Promise((resolve, reject) => { + this.$http({ + url: this.$http.adornUrl("/master/course/getCourseDirector"), + method: "post", + data: this.$http.adornData({ + courseId: id + }) + }) + .then(res => { + resolve(res); + // if (res.code === 0) { + // _info = res.director; + // console.log('教务信息++++res', res.director) + // } + }) + .catch(e => { + this.$message.error("获取课程信息失败"); + reject(e); + }); + }); + }, + // 搜索用户列表 + remoteMethod(query) { + if (query !== "") { + this.remoteMethodLoading = true; + this.$http({ + url: this.$http.adornUrl("/book/user/getUserList"), + method: "post", + data: this.$http.adornData({ + page: 1, + limit: 10, + key: query + }) + }) + .then(({ data }) => { + if (data && data.code === 0) { + this.userList = data.user.records; + this.remoteMethodLoading = false; + } + }) + .catch(e => { + this.userList = []; + this.remoteMethodLoading = false; + }); + } else { + this.userList = []; } }, - showProTable(data){ - console.log('data',data) + pclose() { + this.relationProducts = []; + this.courseId = null; + console.log("关闭了 "); + }, + linkList(data) { + console.log("父级", data); + if (data && data.length > 0) { + this.relationProducts = data; + } + }, + showProTable(data) { + console.log("data", data); this.$nextTick(() => { this.$refs.commonShopTable.open(); }); @@ -359,7 +611,6 @@ export default { this.resList = []; }, showLinkTags(row) { - this.$http({ url: this.$http.adornUrl("/master/course/getCourseLableLinkList"), method: "post", @@ -370,7 +621,6 @@ export default { this.resListVisible = true; if (res.data.code == 0 && res.data.resList.length > 0) { this.resList = res.data.resList; - } // console.log(row, "row" , res.data.resList,this.resList); }); @@ -404,7 +654,7 @@ export default { }, // 获取数据列表 getDataList() { - this.relationProducts = [] + this.relationProducts = []; var data = { page: this.pageIndex, limit: this.pageSize, @@ -466,8 +716,8 @@ export default { }, // 新增 / 修改 addOrUpdateHandle(row) { - this.addOrUpdateVisible = true; - row ? this.courseId = row.id : '' + this.addOrUpdateVisible = true; + row ? (this.courseId = row.id) : ""; // this.courseId = row.id this.$nextTick(() => { this.$refs.addOrUpdate.init(row); @@ -592,6 +842,15 @@ export default { this.getDataList(); }); } + }, + computed: { + isSameOne() { + if(this.director.ddirector == this.director.director && this.director.ddirector != null){ + return true + }else{ + return false + } + } } }; @@ -601,4 +860,7 @@ export default { color: #149f97; } } +.flexbox { + display: flex; +} diff --git a/src/views/modules/miniClass/classAddType.vue b/src/views/modules/miniClass/classAddType.vue new file mode 100644 index 0000000..61e16de --- /dev/null +++ b/src/views/modules/miniClass/classAddType.vue @@ -0,0 +1,411 @@ + + + + + diff --git a/src/views/modules/miniClass/miniClass.vue b/src/views/modules/miniClass/miniClass.vue new file mode 100644 index 0000000..2d83142 --- /dev/null +++ b/src/views/modules/miniClass/miniClass.vue @@ -0,0 +1,634 @@ + + + + + diff --git a/src/views/modules/miniClass/miniClassList.vue b/src/views/modules/miniClass/miniClassList.vue new file mode 100644 index 0000000..6f7f309 --- /dev/null +++ b/src/views/modules/miniClass/miniClassList.vue @@ -0,0 +1,352 @@ + + + diff --git a/src/views/modules/miniClass/miniClassType.vue b/src/views/modules/miniClass/miniClassType.vue new file mode 100644 index 0000000..0c7dc7b --- /dev/null +++ b/src/views/modules/miniClass/miniClassType.vue @@ -0,0 +1,322 @@ + + + diff --git a/static/config/index.js b/static/config/index.js index 9e62848..2dffa09 100644 --- a/static/config/index.js +++ b/static/config/index.js @@ -5,10 +5,10 @@ window.SITE_CONFIG = {}; // api接口请求地址 - // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川 + window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川 // window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11 - window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境 + // window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境 // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';//磊哥 // window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';