Browse Source

Merge branch 'develop3.0' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0

zhouj1203@hotmail.com 5 years ago
parent
commit
ad67dc8020

+ 4 - 1
TEAMModelOS/ClientApp/src/api/syllabus.js

@@ -35,5 +35,8 @@ export default {
     // ͨ�ü��ϲ�ѯ�ӿ�
     FindCollection: function(data) {
         return post('/api/Common/FindCollection', data)
-    }
+    },// ͨ�ü��ϲ�ѯ�ӿ�
+    FindSyllabusCount: function(data) {
+        return post('/api/Volume/FindSyllabusCount', data)
+    },
 }

+ 0 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue

@@ -208,7 +208,6 @@
 
                         params.target = target
                         this.isBtnLoading = true
-                        console.log('111111')
                         this.saveorUpdataHw({ homeWork: params, reset: isReset }).then(res => {
                             this.$Message.success((this.isEdit && this.editInfo.id) ? '修改成功!' : '添加成功!')
                             this.hwFormEdit = false

+ 2 - 4
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue

@@ -40,7 +40,7 @@
                     <span class="option-order">{{ index + 1 }}</span>
                     <div :ref="'voteOption'+index" style="text-align:left" class="option-editor" @click="optionClick(index)"></div>
                 </div>
-                <p style="float:right;color:#BDBDBD;cursor:pointer" @click="onAddOption"><Icon type="md-add" />添加选项</p>
+                <p style="float:right;color:#BDBDBD;cursor:pointer" @click="onAddOption" v-show="voteFormEdit"><Icon type="md-add" />添加选项</p>
             </FormItem>
 
             <!--<FormItem label="投票记录" prop="isReset" v-show="editable && isEdit">
@@ -195,11 +195,8 @@
             },
 
             initEditors() {
-                console.log(this.voteOptions)
-                console.log(this.$refs)
 
                 this.$nextTick(() => {
-                
                     // Editor默认配置
                     if (this.voteOptions.length > 0) {
                         this.voteOptions.forEach((item, i) => {
@@ -207,6 +204,7 @@
                             let editor = new E(that.$refs['voteOption' + i][0])
                             editor.customConfig = this.defaultConfig
 
+
                             // 选项编辑器失焦隐藏工具栏
                             editor.customConfig.onblur = function () {
                                 let allToolbars = document.getElementsByClassName('option-editor')

+ 1 - 1
TEAMModelOS/ClientApp/src/view/selflearning/ManageVote.vue

@@ -57,7 +57,7 @@
             <div class="hw-box-header">
                 <span>投票数据</span>
                 <div class="hw-box-header-tools">
-                    <span class="hw-box-header-tools-tool" @click="changeTableView"><Icon type="md-podium" />{{ isOptionView ? '学生清单视图' : '选项清单视图' }}</span>
+                    <span class="hw-box-header-tools-tool" @click="changeTableView" v-show="tableData.length"><Icon type="md-podium" />{{ isOptionView ? '学生清单视图' : '选项清单视图' }}</span>
                 </div>
             </div>
                 <div v-if="voteList.length === 0 || currentVote.state !== 300">

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

@@ -1,4 +1,4 @@
- <style lang="less" scoped>
+<style lang="less" scoped>
     @import './Index.less';
 </style>
 
@@ -49,7 +49,7 @@
                              :key="index"
                              @click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
                             <p class="gl-item-name">{{item.subjectName}}</p>
-                            <p class="gl-item-info"><span></span>册别数:{{ 0 }}</p>
+                            <p class="gl-item-info"><span></span>册别数:{{ tabIndex === 0  ? schoolVolCount[index] : privateVolCount[index]}}</p>
                         </div>
                     </div>
                 </vuescroll>
@@ -65,7 +65,7 @@
                             <span style="margin-left:5px">册别</span>
                         </span>
                         <div>
-                            <Icon type="md-add"  v-if="$access.can('admin.*|Volumn_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onAddVolume" />
+                            <Icon type="md-add" v-if="$access.can('admin.*|Volumn_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onAddVolume" />
                             <Poptip title="筛选册别" placement="bottom-end" @on-popper-show="onPopperShow" v-show="volumeList.length">
                                 <Icon type="ios-funnel" color="#fff" size="18" style="cursor:pointer;margin-right:10px" />
                                 <div class="funnel-box" slot="content">
@@ -112,9 +112,9 @@
                                     <Icon type="md-folder" title="内容资源数" style="margin-left:0" /> {{ item.itemCount }}
                                     <Icon type="md-cube" title="关联知识点数" /> {{ item.resourceCount }}
                                 </div>
-                                <span class="btn-edit"  v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditVolume(item)"><Icon type="md-create" size="20" color="#d2d2d2" /></span>
-                                <span class="btn-users"  v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="共编使用者管理" @click.stop="onEditEditors(item)"><Icon type="md-people" size="22" color="#d2d2d2" /></span>
-                                <span class="btn-delete"  v-if="$access.can('admin.*|Volumn_Delete') || tabIndex === 1" title="删除" @click.stop="onDeleteVolume(item)"><Icon type="md-trash" size="22" color="#d2d2d2" /></span>
+                                <span class="btn-edit" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditVolume(item)"><Icon type="md-create" size="20" color="#d2d2d2" /></span>
+                                <span class="btn-users" v-if="$access.can('admin.*|Volumn_Edit') || tabIndex === 1" title="共编使用者管理" @click.stop="onEditEditors(item)"><Icon type="md-people" size="22" color="#d2d2d2" /></span>
+                                <span class="btn-delete" v-if="$access.can('admin.*|Volumn_Delete') || tabIndex === 1" title="删除" @click.stop="onDeleteVolume(item)"><Icon type="md-trash" size="22" color="#d2d2d2" /></span>
                             </div>
                         </div>
                     </div>
@@ -135,7 +135,7 @@
                             <!--<span class="tree-version">v1.0.0</span>-->
                         </div>
                         <div>
-                            <Button @click="onSaveSyllabus" :disabled="!hasModify"  v-if="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1">存储变更</Button>
+                            <Button @click="onSaveSyllabus" :disabled="!hasModify" v-if="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1">存储变更</Button>
                         </div>
                     </div>
                     <Tree :volume="currentVolume" :treeData="treeData" ref="treeRef" :editable="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1" @onTreeUpdate="onTreeUpdate"></Tree>
@@ -161,7 +161,7 @@
         <Modal v-model="isEditEditors" width="760" footer-hide class="add-volume-modal">
             <div class="modal-header" slot="header">共编使用者管理</div>
             <div class="modal-content">
-                <AddEditors :editVolume="editVolume"  @addFinish="onFinishAddVolume"></AddEditors>
+                <AddEditors :editVolume="editVolume" @addFinish="onFinishAddVolume"></AddEditors>
             </div>
         </Modal>
 
@@ -192,12 +192,15 @@
                 isLoadSubject: false,
                 isLoadVolumes: false,
                 isLoadSyllabus: false,
+                volumnCounts: [],
                 currentPeriodIndex: null,
                 currentSubjectIndex: null,
                 currentVolume: null,
                 tabIndex: 0,
                 originData: {},
                 originSchoolData: {},
+                schoolVolCount: [],// 校本科目册别数量
+                privateVolCount: [],//个人科目册别数量
                 periodList: [],
                 gradeList: [],
                 semesterList: [],
@@ -228,9 +231,7 @@
         },
         created() {
             this.initSchoolData()
-
-            console.log("当前用户权限")
-            console.log(this.$access)
+            this.initSyllabusCount()
         },
         methods: {
             // 获取当前学校学段学科等基本信息
@@ -249,6 +250,27 @@
                     }
                 })
             },
+
+            // 获取当前册别数量
+            initSyllabusCount() {
+                if (this.volumnCounts.length) {
+                    this.schoolVolCount = this.volumnCounts[this.currentPeriodIndex].map(i => i[0])
+                    this.privateVolCount = this.volumnCounts[this.currentPeriodIndex].map(i => i[1])
+                } else {
+                    this.$api.syllabus.FindSyllabusCount({ schoolCode: this.schoolInfo.schoolCode }).then(res => {
+                        if (!res.error) {
+                            this.$nextTick(() => {
+                                this.volumnCounts = res.result.data
+                                this.schoolVolCount = res.result.data[this.currentPeriodIndex].map(i => i[0])
+                                this.privateVolCount = res.result.data[this.currentPeriodIndex].map(i => i[1])
+                            })
+                        } else {
+                            this.$Message.warning('获取数据失败')
+                        }
+                    })
+                }
+            },
+
             // 根据学科获取所有册别信息
             getVolumesData() {
                 let that = this
@@ -263,7 +285,7 @@
                         this.originVolumeList = list
                         this.handleVolumeTap(0, list.length > 0 ? list[0] : null)
                         this.searchVolume = ''
-                        setTimeout(function() {
+                        setTimeout(function () {
                             that.isLoadVolumes = false
                         }, 400)
                     } else {
@@ -278,7 +300,7 @@
                 this.$api.syllabus.GetTreeByVolume({ volumeCode: volumeCode }).then(res => {
                     if (!res.error && res.result.data) {
                         this.treeData = res.result.data
-                        setTimeout(function() {
+                        setTimeout(function () {
                             that.isLoadSyllabus = false
                         }, 400)
                     } else {
@@ -315,8 +337,9 @@
                     this.gradeList = this.periodList[index].grades // 切换学段后更新 年级 列表
                     this.semesterList = this.periodList[index].semesters // 切换学段后更新 学期 列表
                     this.handleSubjectTap(0)
+                    this.initSyllabusCount()
                     this.searchSubject = ''
-                    setTimeout(function() {
+                    setTimeout(function () {
                         that.isLoadSubject = false
                     }, 400)
                 }
@@ -324,11 +347,11 @@
 
             // 学科点击事件
             handleSubjectTap(index) {
-                    this.isLoadVolumes = true
-                    this.currentSubjectIndex = index
-                    this.currentParams.subjectCode = this.subjectList[index].subjectCode
-                    this.activeSubjectIndex = index
-                    this.getVolumesData()
+                this.isLoadVolumes = true
+                this.currentSubjectIndex = index
+                this.currentParams.subjectCode = this.subjectList[index].subjectCode
+                this.activeSubjectIndex = index
+                this.getVolumesData()
             },
 
             // 册别点击事件
@@ -349,6 +372,8 @@
                         this.$Message.success('册别已存在,已为您更新数据')
                     } else {
                         this.$Message.success('添加新册别成功')
+                        this.volumnCounts = []
+                        this.initSyllabusCount()
                     }
                     this.handleSubjectTap(this.currentSubjectIndex) // 获取最新册别数据
                 }
@@ -528,6 +553,9 @@
                     }
                 })
             }
+        },
+        mounted() {
+
         }
     }
 </script>

+ 3 - 1
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/AddVolume.vue

@@ -46,7 +46,6 @@
             }
         },
         created() {
-
         },
         methods: {
             // 提交添加
@@ -116,6 +115,8 @@
             originData: {
                 handler(newValue, oldValue) {
                     this.originDatas = newValue
+            console.log(this.originData)
+
                 }
             },
             periodIndex: {
@@ -125,6 +126,7 @@
                     this.formTop.grade = this.currentPeriod.grades[0].gradeCode
                     this.formTop.semester = this.currentPeriod.semesters[0].semesterCode
                     this.formTop.volume = ''
+                    console.log(this.currentPeriod)
                 }
             },
             subjectIndex: {