浏览代码

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

李思淳 5 年之前
父节点
当前提交
08390e057d

+ 9 - 2
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -43,16 +43,23 @@ export default {
         return post('/api/Learn/SaveUnit', data)
     },
     /*
-     *保存最小单元
+     *查询最小单元
      */
     FindUnit: function (data) {
         return post('/api/Learn/FindUnit', data)
     },
     /*
-     *保存最小单元
+     *删除最小单元
      */
     DeleteUnit: function (data) {
         return post('/api/Learn/DeleteUnit', data)
+    },
+    /*
+    *根据id数组查询资源文件
+    */
+    FindSyllabusResourceById: function (data) {
+        return post('/api/Resource/FindSyllabusResourceById', data)
     }
 
+
 }

+ 12 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.less

@@ -7,6 +7,7 @@
 
 .choose-question-wrap {
   height: ~"calc(100% - 76px)";
+  position:relative;
 }
 .seach-input {
   position: absolute;
@@ -21,7 +22,7 @@
     height: ~"calc(100% - 30px)";
     background: #2c2c2c;
     padding-top: 15px;
-
+    
     .content-filter-wrap {
       width: 100%;
       border-bottom: 1px solid #606060;
@@ -41,6 +42,16 @@
     }
   }
 }
+.page-wrap {
+    width: 100%;
+    position: fixed;
+    left: 0px;
+    bottom: 32px;
+    padding: 5px 0px;
+    background: rgba(20,20,20,.8);
+    text-align: center;
+    color: white;
+}
 .syllabus-content-wrap {
   display: flex;
   flex-direction: row;

+ 36 - 26
TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.vue

@@ -102,34 +102,37 @@
             </TabPane>
             <TabPane label="题目">
                 <div class="tab-wrap">
-                    <div class="content-filter-wrap">
-                        <div class="content-filter-item">
-                            <span class="content-filter-label">题目范围:</span>
-                            <RadioGroup v-model="syllabusFilter.type" style="display:inline-block;">
-                                <Radio :label="0" class="radio-width">私有题库</Radio>
-                                <Radio :label="1" class="radio-width">校本题库</Radio>
-                            </RadioGroup>
-                        </div>
-                        <div class="content-filter-item">
-                            <span class="content-filter-label">题型:</span>
-                            <RadioGroup v-model="syllabusFilter.periodCode" style="display:inline-block;" @on-change="getSubjectList">
-                                <Radio label="All" class="radio-width">全部</Radio>
-                                <Radio label="Single" class="radio-width">单选题</Radio>
-                                <Radio label="Multiple" class="radio-width">多选题</Radio>
-                                <Radio label="Judge" class="radio-width">判断题</Radio>
-                                <Radio label="Complete" class="radio-width">填空题</Radio>
-                                <Radio label="Subjective" class="radio-width">问答题</Radio>
-                                <Radio label="Compose" class="radio-width">综合题</Radio>
-                            </RadioGroup>
+                    <vuescroll v-if="questionList.length > 0">
+                        <div class="content-filter-wrap">
+                            <div class="content-filter-item">
+                                <span class="content-filter-label">题目范围:</span>
+                                <RadioGroup v-model="syllabusFilter.type" style="display:inline-block;">
+                                    <Radio :label="0" class="radio-width">私有题库</Radio>
+                                    <Radio :label="1" class="radio-width">校本题库</Radio>
+                                </RadioGroup>
+                            </div>
+                            <div class="content-filter-item">
+                                <span class="content-filter-label">题型:</span>
+                                <RadioGroup v-model="syllabusFilter.periodCode" style="display:inline-block;" @on-change="getSubjectList">
+                                    <Radio label="All" class="radio-width">全部</Radio>
+                                    <Radio label="Single" class="radio-width">单选题</Radio>
+                                    <Radio label="Multiple" class="radio-width">多选题</Radio>
+                                    <Radio label="Judge" class="radio-width">判断题</Radio>
+                                    <Radio label="Complete" class="radio-width">填空题</Radio>
+                                    <Radio label="Subjective" class="radio-width">问答题</Radio>
+                                    <Radio label="Compose" class="radio-width">综合题</Radio>
+                                </RadioGroup>
+                            </div>
+                            <Input class="seach-input" suffix="ios-search" placeholder="关键字搜索" clearable style="width: 240px" size="small" />
                         </div>
-                        <Input class="seach-input" suffix="ios-search" placeholder="关键字搜索" clearable style="width: 240px" size="small" />
-                    </div>
-                    <div class="choose-question-wrap">
-                        <vuescroll v-if="questionList.length > 0">
+                        <div class="choose-question-wrap">
                             <QuestionList :config="questionConfig" @seleteQuestion="seleteQuestion" :questions="questionList"></QuestionList>
-                        </vuescroll>
-                        <NoData style="margin-top:30px;" v-if="questionList.length == 0"></NoData>
-                    </div>
+                            <NoData style="margin-top:30px;" v-if="questionList.length == 0"></NoData>
+                            <div class="page-wrap">
+                                <Page :current.sync="pageNum" :total="totalNum" :page-size="pageSize" size="small" show-elevator show-sizer @on-change="getCurrentPageData" />
+                            </div>
+                        </div>
+                    </vuescroll>
                 </div>
             </TabPane>
         </Tabs>
@@ -147,6 +150,10 @@
         },
         data() {
             return {
+                pageNum: 0,
+                totalNum: 100,
+                pageSize: 20,
+
                 questionConfig: {
                     showSelect: true
                 },
@@ -210,6 +217,9 @@
             }
         },
         methods: {
+            getCurrentPageData(page) {
+
+            },
             setScopeCode(type) {
 
             },

+ 25 - 1
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -26,7 +26,7 @@
             <Loading :top="100" v-show="dataLoading" type="1"></Loading>
             <div class="paper-item" v-for="(paper,index) in paperList" :key="index" @click="goToPaper(paper)">
                 <div class="paper-item-name">
-                    <span class="paper-item-tag">{{ paper.subjectCode }}</span>
+                    <span class="paper-item-tag">{{ getSubjectName(paper.subjectCode) }}</span>
                     <span>{{ paper.name }}</span>
                 </div>
                 <div class="paper-item-info">
@@ -54,6 +54,7 @@
         <!-- 随机挑题组卷 -->
         <Modal v-model="randomModal"
                title="随机挑题"
+               class-name="random-pick-modal"
                width="1000px">
             <Form :model="paperInfo" label-position="top">
                 <FormItem label="试卷名称">
@@ -265,6 +266,14 @@
                 } else {
                     this.$Message.error('对不起,文档解析失败!')
                 }
+            },
+
+            /**
+             * 根据SubjectCode换取SubjectName
+             * @param code
+             */
+            getSubjectName(code) {
+                return this.$jsFn.getSubjectName(this.$store.state.schoolBaseInfo.schoolBaseInfo,code)
             }
 
         },
@@ -295,4 +304,19 @@
     .pl-container .ivu-checkbox-inner {
         display: none !important;
     }
+
+    .random-pick-modal .question-condition-wrap .question-condition-item .condition-label,
+    .random-pick-modal .question-condition-wrap .question-condition-item{
+        color:#000;
+        font-size:14px;
+    }
+
+    .random-pick-modal .question-num-item .ivu-select-selection{
+        color:#333333;
+    }
+
+    .random-pick-modal .question-num-item .ivu-input-number,
+    .random-pick-modal .question-num-item .ivu-input-number-small input {
+        color:#000;
+    }
 </style>

+ 170 - 98
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -8,77 +8,22 @@
         </div>
         <div class="content-wrap" v-else>
             <Loading :top="200" v-show="dataLoading" type="1"></Loading>
-            <div v-if="viewModel === 'type'">
-                <div v-for="(type,typeIndex) in typeList">
-                    <div v-if="groupRes[type]">
-                        <div>{{ type }}</div>
-                        <div class="exercise-item" v-for="(item,index) of groupRes[type]" :key="index" @click="onQuestionToggle(index,item.id,$event)" @mouseenter="exerciseMouseover($event)" @mouseleave="exerciseMouseleave($event)">
-                            <div class="item-tools-wrap">
-                                <div class="item-tools-t flex-row-center"><Icon type="ios-list-box-outline" />配分</div>
-                                <div class="item-tools-t flex-row-center" @click.stop="handleToolEdit(item)"><Icon type="ios-brush-outline" />编辑</div>
-                                <div class="item-tools-t flex-row-center" @click.stop="handleDelete(index)"><Icon type="ios-archive-outline" />删除</div>
-                                <div class="item-tools-t flex-row-center" v-show="index != 0" @click.stop="handleMoveUp(exerciseList,index)"><Icon type="md-arrow-up" />上移</div>
-                                <div class="item-tools-t flex-row-center" v-show="index != (exerciseList.length - 1)" @click.stop="handleMoveDown(exerciseList,index)"><Icon type="md-arrow-down" />下移</div>
-                            </div>
-
-                            <!-- 题干部分 -->
-                            <div class="item-question" style="pointer-events:none">
-                                <p>{{ pageSize * (pageNum - 1) + index + 1 }} : <span v-html="item.question"></span></p>
-                                <span class="item-btn-toggle">
-                                    <Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" />
-                                    <!--<Button type="primary">选题</Button>-->
-                                </span>
-                            </div>
-                            <!-- 选项部分 -->
-                            <div v-for="(option,optionIndex) in item.option" :key="optionIndex" class="item-options" style="pointer-events:none">
-                                <p class="item-option-content">{{String.fromCharCode(64 + parseInt(optionIndex+1))}} : <span v-html="option.value"></span></p>
-                            </div>
-                            <transition name="slide">
-                                <div v-show="collapseList.indexOf(index) > -1" class="toggle-area">
-                                    <!-- 答案展示部分 -->
-                                    <div class="item-explain" v-show="isShowAnswer">
-                                        <span class="explain-title">【答案】</span>
-                                        <div class="item-explain-details">
-                                            <span v-html="item.answer" v-if="item.type === 'Subjective'"></span>
-                                            <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else-if="item.type === 'Complete'" v-html="answer"></span>
-                                            <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else>{{answer}}</span>
-                                        </div>
-                                    </div>
-                                    <!-- 解析部分 -->
-                                    <div class="item-explain" v-show="isShowAnswer">
-                                        <span class="explain-title">【解析】</span>
-                                        <div class="item-explain-details">
-                                            <span v-html="item.explain || '暂无解析'"></span>
-                                        </div>
-                                    </div>
-                                    <!-- 知识点部分 -->
-                                    <div class="item-explain" v-show="isShowAnswer">
-                                        <span class="explain-title">【知识点】</span>
-                                        <div class="item-explain-details">
-                                            <span v-html="item.points.length ? item.points : '暂未绑定知识点'"></span>
-                                        </div>
-                                    </div>
 
-                                </div>
-                            </transition>
-                        </div>
-                    </div>
-                </div>
-            </div>
-
-            <div v-else class="list-view">
-                <div class="exercise-item" v-for="(item,index) of exerciseList" :key="index" @click="onQuestionToggle(index,item.id,$event)" @mouseenter="exerciseMouseover($event)" @mouseleave="exerciseMouseleave($event)">
+            <div class="list-view" v-for="(typeItem,typeIndex) in groupList">
+                <p v-show="viewModel === 'type'" class="type-name">{{ numberConvertToUppercase(typeIndex + 1) }} : {{  exersicesType[typeItem.type] }} ( {{ typeItem.score }} 分)</p>
+                <div class="exercise-item" v-for="(item,index) of typeItem.list" :key="index" @click="onQuestionToggle(exerciseList.indexOf(item),item.id,$event,typeItem.list)" @mouseenter="exerciseMouseover($event)" @mouseleave="exerciseMouseleave($event)">
                     <div class="item-tools-wrap">
-                        <div class="item-tools-t flex-row-center" @click.stop="handleSetScore(item,index)"><Icon type="ios-list-box-outline" />配分</div>
+                        <div class="item-tools-t flex-row-center" @click.stop="handleSetScore(item,exerciseList.indexOf(item))"><Icon type="ios-list-box-outline" />配分</div>
                         <div class="item-tools-t flex-row-center" @click.stop="handleToolEdit(item)"><Icon type="ios-brush-outline" />编辑</div>
-                        <div class="item-tools-t flex-row-center" @click.stop="handleDelete(index)"><Icon type="ios-archive-outline" />删除</div>
-                        <div class="item-tools-t flex-row-center" v-show="index != 0" @click.stop="handleMoveUp(exerciseList,index)"><Icon type="md-arrow-up" />上移</div>
-                        <div class="item-tools-t flex-row-center" v-show="index != (exerciseList.length - 1)" @click.stop="handleMoveDown(exerciseList,index)"><Icon type="md-arrow-down" />下移</div>
+                        <div class="item-tools-t flex-row-center" @click.stop="handleDelete(typeItem.list,item,index)"><Icon type="ios-archive-outline" />删除</div>
+                        <div class="item-tools-t flex-row-center" v-show="index != 0" @click.stop="handleMoveUp(typeItem.list,index)"><Icon type="md-arrow-up" />上移</div>
+                        <div class="item-tools-t flex-row-center" v-show="index != (typeItem.list.length - 1)" @click.stop="handleMoveDown(typeItem.list,index)"><Icon type="md-arrow-down" />下移</div>
                     </div>
 
                     <!-- 题干部分 -->
                     <div class="item-question" style="pointer-events:none">
-                        <p>{{ pageSize * (pageNum - 1) + index + 1 }} : <span v-html="item.question"></span></p>
+                        <p v-if="viewModel === 'list'">{{pageSize * (pageNum - 1) + exerciseList.indexOf(item) + 1}} : <span v-html="item.question"></span></p>
+                        <p v-else>{{ pageSize * (pageNum - 1) + index + 1 }} : <span v-html="item.question"></span></p>
                         <span class="item-btn-toggle">
                             <span class="item-score">{{ item.score }} 分</span>
 
@@ -91,7 +36,7 @@
                         <p class="item-option-content">{{String.fromCharCode(64 + parseInt(optionIndex+1))}} : <span v-html="option.value"></span></p>
                     </div>
                     <transition name="slide">
-                        <div v-show="collapseList.indexOf(index) > -1" class="toggle-area">
+                        <div v-show="collapseList.indexOf(exerciseList.indexOf(item)) > -1" class="toggle-area">
                             <!-- 答案展示部分 -->
                             <div class="item-explain" v-show="isShowAnswer">
                                 <span class="explain-title">【答案】</span>
@@ -137,10 +82,26 @@
                title="题目配分"
                @on-ok="onConfirmScore"
                >
-            <InputNumber :max="curItemScore + surPlusScore" :min="0" v-model="curItemScore" @on-change="onScoreChange"></InputNumber>
+            <InputNumber :max="curItemScore + surPlusScore" :min="0" :step="scoreStep" v-model="curItemScore" @on-change="onScoreChange"></InputNumber>
             <p>剩余可分配分数:{{ surPlusScore }}</p>
         </Modal>
 
+        <Modal v-model="typeScoreModel"
+               title="题型配分"
+               footer-hide>
+            <span class="type-score-item">已分配总分 : {{ getTotalScore(groupTypeList) }}</span>
+            <div v-for="item in groupTypeList" class="type-score-item">
+                <span>{{ exersicesType[item.type] }} </span>
+                <span>共 {{ item.list.length }} 道题,总分配:</span>
+                <InputNumber :max="paper.score" :min="0" :step="scoreStep" v-model="item.score"></InputNumber>
+                <span> 分</span>
+            </div>
+
+            <Button class="type-score-btn" @click="onConfirmTypeScore" type="info" :disabled="getTotalScore(groupTypeList) > paper.score">确认</Button>
+            <p style="color:red;text-align:center;font-weight:bold;margin-top:10px" v-show="getTotalScore(groupTypeList) > paper.score">配分已超试卷总分,请重新分配!</p>
+
+        </Modal>
+
 
     </div>
 </template>
@@ -148,7 +109,7 @@
 <script>
     import Loading from '@/common/Loading.vue'
     export default {
-        props: ['exerciseData','totalScore'],
+        props: ['paper'],
         components: {
             Loading
         },
@@ -160,13 +121,14 @@
                 exerciseList: [],
                 schoolInfo: {},
                 isShowUploadList: false,
+                typeScoreModel:false,
                 setPaperInfoModal: false,
                 exersicesType: {
-                    Single: '单选',
-                    Multiple: '多选',
-                    Judge: '判断',
-                    Complete: '填空',
-                    Subjective: '问答',
+                    Single: '单选',
+                    Multiple: '多选',
+                    Judge: '判断',
+                    Complete: '填空',
+                    Subjective: '问答',
                     Compose: '综合题'
                 },
                 exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
@@ -183,30 +145,33 @@
                 subjectList: [],
                 basketList: [],
                 originData: [],
-                groupRes: {},
+                groupList: [],
+                groupTypeList:[],
                 typeList: ['Single', 'Multiple', 'Judge', 'Complete', 'Subjective', 'Compose'],
-                viewModel:'list',
+                viewModel:'type',
                 filterParams: {},
                 surPlusScore: 0,
                 curItemScore: 0,
                 curIndex:0,
-                lastScore:0,
+                lastScore: 0,
+                scoreStep:0.5,
                 scoreModal:false
             }
         },
 
         created() {
-            console.log(this.exerciseList)
+            //console.log(this.exerciseList)
         },
         methods: {
             /**
              * 根据ID获取试题详细数据
              * @param id 试题ID
              */
-            getDetailsById(id, index) {
+            getDetailsById(arr, id, index) {
                 this.$api.newEvaluation.FindExerciseById(id).then(res => {
                     /* 查询到详细数据则替换掉原数据 */
                     this.exerciseList.splice(index, 1, res.result.data)
+                    arr.splice(index, 1, res.result.data)
                 })
             },
 
@@ -215,18 +180,39 @@
              * @param index
              * @param id
              */
-            onQuestionToggle(index, id, e) {
+            onQuestionToggle(index, id, e, arr) {
                 e.stopPropagation()
                 let listIndex = this.collapseList.indexOf(index)
                 if (listIndex > -1) {
                     this.collapseList.splice(listIndex, 1)
                 } else {
                     this.collapseList.push(index)
-                    if (!this.exerciseList[index].answer.length) this.getDetailsById(id, index)
+                    if (!this.exerciseList[index].answer.length) this.getDetailsById(arr, id, index)
                     this.pageScrollTo(e.target.offsetTop + 60) // content-wrap 距离顶部高度
                 }
             },
 
+            /**
+             * 数字与中文转换
+             * @param num
+             */
+            numberConvertToUppercase(num) {
+                num = Number(num)
+                var upperCaseNumber = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '百', '千', '万', '亿']
+                var length = String(num).length
+                if (length === 1) {
+                    return upperCaseNumber[num]
+                } else if (length === 2) {
+                    if (num === 10) {
+                        return upperCaseNumber[num]
+                    } else if (num > 10 && num < 20) {
+                        return '十' + upperCaseNumber[String(num).charAt(1)]
+                    } else {
+                        return upperCaseNumber[String(num).charAt(0)] + '十' + upperCaseNumber[String(num).charAt(1)].replace('零', '')
+                    }
+                }
+            },
+
            // 分页操作
             pageChange(page) {
                 let start = this.pageSize * (page - 1)
@@ -288,7 +274,7 @@
              * 删除试卷中的单个试题
              * @param index
              */
-            handleDelete(index) {
+            handleDelete(arr,item,index) {
                 this.$Modal.confirm({
                     title: '提示',
                     content: '<p>确认删除该试题吗?</p>',
@@ -296,9 +282,10 @@
                     cancelText: '取消',
                     onOk: () => {
                         this.$Message.success('删除成功')
-                        this.surPlusScore += this.exerciseList[index].score
+                        this.surPlusScore += item.score
                         console.log(this.surPlusScore)
-                        this.exerciseList.splice(index, 1)
+                        arr.splice(index, 1)
+                        this.exerciseList.splice(this.exerciseList.indexOf(item), 1)
                         this.$emit('dataUpdate', this.exerciseList)
                     }
                 })
@@ -322,6 +309,11 @@
             },
 
 
+            /**
+             * 给单个试题配分
+             * @param item
+             * @param index
+             */
             handleSetScore(item, index) {
                 this.curIndex = index
                 this.curItemScore = item.score
@@ -329,41 +321,103 @@
                 this.scoreModal = true
             },
 
-
+            /**
+             * 配分变化时的剩余分数处理
+             * @param val
+             */
             onScoreChange(val) {
                 this.surPlusScore = this.surPlusScore + this.lastScore - val 
                 this.lastScore = val
 
             },
 
+            /** 确认单个试题配分 */
             onConfirmScore() {
                 this.$set(this.exerciseList[this.curIndex], 'score', this.curItemScore);
+            },
+
+            /** 按照题型配分 */
+            onConfirmTypeScore() {
+                /** 重新计算剩余分配分数 */
+                this.surPlusScore = this.paper.score - this.groupTypeList.reduce((p, e) => p + e.score, 0)
+                if (this.surPlusScore < 0) {
+                    this.$Message.warning("当前配分超过试卷总分,请重新分配!")
+                } else {
+                    /* 按照题型配分后平均分配给每个子题 */
+                    this.groupTypeList.forEach(item => {
+                        item.list.forEach(exercise => {
+                            exercise.score = item.score / item.list.length
+                            this.exerciseList.filter(item => item.id === exercise.id)[0].score = item.score / item.list.length
+                        })
+                    })
+                    /** 回到题型视图 */
+                    this.groupList = this.groupTypeList
+                    this.$parent.viewModel = 'type'
+                    this.typeScoreModel = false
+                }
+
+            },
+
+
+            /** 打开题型配分 */
+            onSetScoreByType() {
+                this.typeScoreModel = true;
+            },
+
+
+            /**
+             * 获取题目列表总分
+             * @param arr
+             */
+            getTotalScore(arr) {
+                return arr.reduce((p,e)=>p+e.score,0)
             }
 
-        },
-        mounted() {
+
         },
         watch: {
-            exerciseData: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.exerciseList = newValue
-                        this.originData = newValue
-                        this.totalNum = newValue.length
-                        this.groupRes = this._.groupBy(newValue, 'type')
+            paper: {
+                handler(newPaper, oldValue) {
+                    if (newPaper) {
+                        
+                        let that = this
+                        this.groupList = []
+                        this.exerciseList = []
+
+                        /* 处理试卷内题目按照题型排序 */
+                        this.typeList.forEach(item => {
+                            this._.mapKeys(this._.groupBy(newPaper.item, 'type'), function (value, key) {
+                                if (key === item) { /* 按照题型排序,并且计算每种题型的总分 */
+                                    that.groupList.push({ type: key, list: value, score : value.reduce((p,e)=>p+e.score,0) })
+                                    that.exerciseList = that.exerciseList.concat(value)
+                                }
+                            })
+                        });
+
+                        this.originData = this.exerciseList
+                        this.groupTypeList = this.groupList
+                        this.totalNum = newPaper.item.length
+                        this.surPlusScore = newPaper.score - newPaper.item.reduce((p,e)=>p+e.score,0);
                         this.pageScrollTo(0)
                         this.pageChange(1)
                     }
                 }
             },
-
-            totalScore: {
-                handler(newValue, oldValue) {
+            viewModel: {
+                handler(newValue) {
                     if (newValue) {
-                        this.surPlusScore = newValue - this.exerciseList.reduce((p,e)=>p+e.score,0);
-                        console.log(this.surPlusScore)
+                        if (newValue === 'list') {
+                            this.groupList = [{
+                                type: 'all',
+                                score:this.exerciseList.reduce((p,e)=>p+e.score,0),
+                                list: this.exerciseList
+                            }]
+                        } else {
+                            this.groupList = this.groupTypeList
+                        }
                     }
-                }
+                },
+                immediate:true
             }
         }
 
@@ -382,6 +436,12 @@
         margin: 20px 0;
     }
 
+    .components-el-container .type-name {
+        font-size:18px;
+        font-weight:bold;
+        margin-top:20px;
+    }
+
     .components-el-container .exercise-item {
         position:relative;
         margin-top:30px;
@@ -430,6 +490,18 @@
             margin:0 3px;
         }
 
+    .type-score-btn {
+        width:80%;
+        margin-left:10%;
+        height:40px;
+        line-height:40px;
+    }
+
+    .type-score-item {
+        margin:20px 10px;
+    }
+
+
         /*横向垂直水平居中*/
     .flex-row-center {
         display: flex;

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.less

@@ -57,7 +57,7 @@
             justify-content: space-around;
 
             .ivu-btn {
-                width: 42%;
+                width: 30%;
                 height: 40px;
             }
         }

+ 48 - 50
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue

@@ -22,7 +22,7 @@
                         </Tooltip>
                     </div>
                     <!-- 题目类型及列表 -->
-                    <BaseExerciseList :exerciseData="exersicesList" :totalScore="paperInfo.score" @dataUpdate="onListUpdate" ref="exList"></BaseExerciseList>
+                    <BaseExerciseList :paper="paperInfo" @dataUpdate="onListUpdate" ref="exList"></BaseExerciseList>
                 </div>
             </div>
 
@@ -31,11 +31,12 @@
                 <div class="analysis-btns">
                     <Button type="success" @click="savePaper">保存试卷</Button>
                     <Button type="info" @click="goToPickExercise">重新选题</Button>
+                    <Button type="info" @click="onSetScoreByType">题型配分</Button>
                 </div>
                 <div class="analysis-infos">
                     <RadioGroup v-model="viewModel" @on-change="onViewModelChange">
-                        <Radio label="list">清单视图</Radio>
                         <Radio label="type">题型视图</Radio>
+                        <Radio label="list">清单视图</Radio>
                     </RadioGroup>
                     <p class="analysis-title">基础信息</p>
                     <div class="flex-row-center">
@@ -74,11 +75,12 @@
                     item: []
                 },
                 exersicesType: {
-                    single: '单选',
-                    multiple: '多选',
-                    judge: '判断',
-                    complete: '填空',
-                    subjective: '问答'
+                    Single: '单选题',
+                    Multiple: '多选题',
+                    Judge: '判断题',
+                    Complete: '填空题',
+                    Subjective: '问答题',
+                    Compose:'综合题'
                 },
                 exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
                 diffColors: ['#32CF74', '#E8BE15', '#F19300', '#EB5E00', '#D30000'],
@@ -105,7 +107,7 @@
                     }
                 ],
                 analysisTableData: [],
-                viewModel:'list'
+                viewModel: 'type'
 
             }
         },
@@ -122,48 +124,37 @@
                 this.paperInfo.name = e.target.innerHTML
             },
 
-            /**
-             * 数字与中文转换
-             * @param num
-             */
-            numberConvertToUppercase(num) {
-                num = Number(num + 1)
-                var upperCaseNumber = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '百', '千', '万', '亿']
-                var length = String(num).length
-                if (length === 1) {
-                    return upperCaseNumber[num]
-                } else if (length === 2) {
-                    if (num === 10) {
-                        return upperCaseNumber[num]
-                    } else if (num > 10 && num < 20) {
-                        return '十' + upperCaseNumber[String(num).charAt(1)]
-                    } else {
-                        return upperCaseNumber[String(num).charAt(0)] + '十' + upperCaseNumber[String(num).charAt(1)].replace('零', '')
-                    }
-                }
-            },
+            
 
             /** 保存试卷 */
             savePaper() {
-                let isSurplus = this.$refs.exList.surPlusScore === 0
-                if (isSurplus) {
-                    let savaParams = this.paperInfo
-                    this.$refs.exList.dataLoading = true
-                    this.$api.learnActivity.SaveExamPaper(savaParams).then(res => {
-                        if (res.error == null) {
-                            this.$refs.exList.dataLoading = false
-                            this.$router.push({
-                                name: 'testPaperList'
-                            })
-                            this.$Message.success('保存成功!')
-                        } else {
-                            this.$Message.error('API ERROR!')
-                        }
-                    },
-                        err => {
-                            this.$Message.error('API ERROR!')
-                        }
-                    )
+                let hasSurplus = this.$refs.exList.surPlusScore === 0 // 判断是否有剩余分数未分配
+                let noScoreList = this.$refs.exList.exerciseList.filter(item => item.score === 0) // 判断是否有未配分的题目
+                if (hasSurplus) {
+                    if (!noScoreList.length) {
+                        let savaParams = this.paperInfo
+                        this.$refs.exList.dataLoading = true
+                        this.$api.learnActivity.SaveExamPaper(savaParams).then(res => {
+                            if (res.error == null) {
+                                this.$refs.exList.dataLoading = false
+                                this.$router.push({
+                                    name: 'testPaperList',
+                                    params: {
+                                        tabName:'paper'
+                                    }
+                                })
+                                this.$Message.success('保存成功!')
+                            } else {
+                                this.$Message.error('API ERROR!')
+                            }
+                        },
+                            err => {
+                                this.$Message.error('API ERROR!')
+                            }
+                        )
+                    } else {
+                        this.$Message.warning(`存在未配分的题目,请配分后再保存!`)
+                    }
                 } else {
                     this.$Message.warning(`试卷配分未完成!剩余 ${this.$refs.exList.surPlusScore} 分数可分配`)
                 }
@@ -190,7 +181,7 @@
                 this.paperInfo.item = list
                 const groupList = this._.groupBy(list, 'type')
                 this._.mapKeys(groupList, function (value, key) {
-                    that.analysisTableData.push({ name: key, value: value.length })
+                    that.analysisTableData.push({ name: that.exersicesType[key], value: value.length })
                 });
             },
 
@@ -204,7 +195,16 @@
                 })
             },
 
+            /** 点击题型配分 */
+            onSetScoreByType() {
+                this.$refs.exList.onSetScoreByType()
+            },
 
+
+            /**
+             * 试卷的视图模式切换
+             * @param val
+             */
             onViewModelChange(val) {
                 this.$refs.exList.viewModel = val
                 this.$refs.exList.collapseList = []
@@ -214,8 +214,6 @@
         mounted() {
             let paper = this.$route.params.paper || JSON.parse(localStorage.getItem('_paperInfo'))
             if (!paper) return
-            console.log(paper)
-            console.log(this.$jsFn.groupBy(paper.item,'type'))
             localStorage.setItem('_paperInfo', JSON.stringify(paper))
             this.paperInfo = paper // 自己页面的值
             this.handleAnalysisData(paper.item) // 处理试题分析数据

+ 10 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreate.less

@@ -5,7 +5,16 @@
 @primary-fontSize: 14px;
 @second-fontSize: 16px;
 
-
+.auto-create-name {
+    text-align: center;
+    margin-top: 30px;
+    color: #CCCCCC;
+    display: block;
+}
+.auto-create-wrap {
+    height: 100%;
+    background: #404040;
+}
 .question-condition-wrap {
   width: 1000px;
   margin: auto;

+ 2 - 15
TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreate.vue

@@ -1,7 +1,7 @@
 <template>
-  <div style="height:100%;background:#404040;">
+  <div class="auto-create-wrap">
     <vuescroll>
-      <h2 style="text-align:center;margin-top:30px;color:#CCCCCC;display:block;">设置组题条件</h2>
+      <h2 class="auto-create-name">设置组题条件</h2>
       <div class="question-condition-wrap">
         <div class="question-condition-item">
           <span class="condition-label">题库范围:</span>
@@ -218,15 +218,6 @@
         </div>
       </div>
     </vuescroll>
-    <Modal v-model="comfirmPreviewStatus"
-           ok-text="是"
-           cancel-text="否"
-           :mask-closable="false"
-           @on-ok="goToPreview"
-           @on-cancel="cancel">
-
-      <p style="font-size:18px;padding-top:15px;">自动组题成功,是否跳转到试题预览界面预览题目?</p>
-    </Modal>
     <Modal v-model="selectPointsStatus"
            title="设置知识点"
            width="70"
@@ -368,9 +359,6 @@
     methods: {
       cancel() {
 
-      },
-      goToPreview() {
-        this.$emit('goToPreview')
       },
       selectPointScope(index) {
         this.activePointTab = index
@@ -486,7 +474,6 @@
                   for (let i = 0; i < res.result.data.length; i++) {
                       this.$emit('autoQuestions', res.result.data[i].item)
                 }
-                this.comfirmPreviewStatus = true
               } else {
                 this.$Message.error('未能匹配满足条件的题目!')
               }

+ 18 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -58,7 +58,7 @@
                     </div>
                     <Tabs v-model="activeTab" type="card" class="question-main-tabs" v-if="evaluationInfo.testPaper.length > 0" name="createTest">
                         <TabPane label="组题条件" name="auto" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'auto'" :index="1" tab="createTest">
-                            <AutoCreate :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getImportQuestions"></AutoCreate>
+                            <AutoCreate :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getAutoQuestions"></AutoCreate>
                         </TabPane>
                         <TabPane label="备选题目" name="manual" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'manual'" :index="2" tab="createTest">
                             <ManualCreate :questionList="questionList" @goToPreview="goToPreview" @selectedQuestion="getSelectedQuestion"></ManualCreate>
@@ -99,7 +99,15 @@
                @on-ok="confirmToManage">
             <p>评测保存成功,是否跳转到管理评测页面查看?</p>
         </Modal>
+        <Modal v-model="comfirmPreviewStatus"
+               ok-text="是"
+               cancel-text="否"
+               :mask-closable="false"
+               @on-ok="goToPreview"
+               @on-cancel="cancel">
 
+            <p style="font-size:18px;padding-top:15px;">自动组题成功,是否跳转到试题预览界面预览题目?</p>
+        </Modal>
     </div>
 </template>
 <script>
@@ -123,6 +131,7 @@
         data() {
             return {
                 jsFn,
+                comfirmPreviewStatus: false,
                 goToManageStatus: false,
                 examInfo: {},
                 ruleValidate: {
@@ -213,6 +222,14 @@
                 this.evaluationInfo.startTime = new Date(value[0]).getTime()
                 this.evaluationInfo.endTime = new Date(value[1]).getTime()
             },
+            getAutoQuestions(questions) {
+                if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
+                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]
+                } else {
+                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions]
+                }
+                this.comfirmPreviewStatus = true
+            },
             getImportQuestions(questions) {
                 if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
                     this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]

+ 136 - 131
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.less

@@ -6,167 +6,172 @@
 @second-fontSize: 16px;
 
 .manage-evaluation-container {
-  width: 100%;
-  height: 100%;
-  display: flex;
-  flex-direction: row;
-
-  .evaluation-list-wrap {
-    width: 350px;
+    width: 100%;
     height: 100%;
-    border-right: 1px solid @borderColor;
-    padding-left: 15px;
-    color: white;
-  }
+    display: flex;
+    flex-direction: row;
 
-  .evaluation-detail-wrap {
-    width: ~"calc(100% - 350px)";
-    height: 100%;
-    padding-left: 15px;
-  }
+    .evaluation-list-wrap {
+        width: 350px;
+        height: 100%;
+        border-right: 1px solid @borderColor;
+        padding-left: 15px;
+        color: white;
+    }
+
+    .evaluation-detail-wrap {
+        width: ~"calc(100% - 350px)";
+        height: 100%;
+        padding-left: 15px;
+    }
 }
+
 .test-paper-analysis {
-  color: aqua;
-  cursor: pointer;
+    color: aqua;
+    cursor: pointer;
 }
-.evaluation-list-wrap {
-  .evaluation-list-title {
-    width: 100%;
-    height: 45px;
-    line-height: 45px;
-    border-bottom: 1px solid @borderColor;
-    color: @second-textColor;
-  }
-
-  .evaluation-list-main {
-    width: 100%;
-    height: ~"calc(100% - 45px)";
-
-    .evaluation-item {
-      border-bottom: 1px solid @borderColor;
-      padding: 10px 10px 10px 0px;
-      cursor: pointer;
-
-      .evaluation-name {
-        font-size: 20px;
-      }
 
-      .evaluation-type {
+.evaluation-list-wrap {
+    .evaluation-list-title {
+        width: 100%;
+        height: 45px;
+        line-height: 45px;
+        border-bottom: 1px solid @borderColor;
         color: @second-textColor;
-      }
     }
 
-    .evaluation-item-active {
-      background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
-    }
-  }
-}
-.evaluation-detail-wrap {
+    .evaluation-list-main {
+        width: 100%;
+        height: ~"calc(100% - 45px)";
 
-  .evaluation-detail-bar {
-    width: 100%;
-    height: 45px;
-    line-height: 45px;
-    border-bottom: 1px solid @borderColor;
-    color: @second-textColor;
+        .evaluation-item {
+            border-bottom: 1px solid @borderColor;
+            padding: 10px 10px 10px 0px;
+            cursor: pointer;
 
-    .edit-evaluation {
-      float: right;
-      margin-right: 45px;
-      display: inline-block;
-      cursor: pointer;
-      color:white;
-    }
+            .evaluation-name {
+                font-size: 20px;
+            }
 
-    .edit-evaluation:hover{
-      color:aqua;
-    }
-    .evalustion-bar-item {
-      margin-right: 30px;
-      display: inline-block;
-      cursor: pointer;
-      line-height: 38px;
-    }
+            .evaluation-type {
+                color: @second-textColor;
+                margin-top: 5px
+            }
+        }
 
-    .evalustion-bar-item-active {
-      color: white;
-      border-bottom: 2px solid white;
+        .evaluation-item-active {
+            background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
+        }
     }
-  }
-
-  .evaluation-base-info {
-    width: 100%;
-    height: ~"calc(100% - 45px)";
-    display: flex;
-    flex-direction: row;
+}
 
-    .evalustion-base-attr {
-      width: 350px;
-      height: 100%;
-      border-right: 1px solid @borderColor;
+.evaluation-detail-wrap {
 
-      .evalustion-base-attr-header {
+    .evaluation-detail-bar {
+        width: 100%;
         height: 45px;
         line-height: 45px;
-        color: @second-textColor;
         border-bottom: 1px solid @borderColor;
-        margin-bottom: 25px;
-      }
+        color: @second-textColor;
 
-      .evaluation-attr-form {
-        margin-right: 15px;
-        /*color: white;*/
-      }
+        .edit-evaluation {
+            float: right;
+            margin-right: 45px;
+            display: inline-block;
+            cursor: pointer;
+            color: white;
+        }
+
+        .edit-evaluation:hover {
+            color: aqua;
+        }
+
+        .evalustion-bar-item {
+            margin-right: 30px;
+            display: inline-block;
+            cursor: pointer;
+            line-height: 38px;
+        }
+
+        .evalustion-bar-item-active {
+            color: white;
+            border-bottom: 2px solid white;
+        }
     }
 
-    .evaluation-test-paper {
-      width: ~"calc(100% - 350px)";
-      height: 100%;
-      padding-left: 15px;
-
-      .evaluation-test-paper-header {
-        height: 45px;
-        line-height: 45px;
-        color: @second-textColor;
-        border-bottom: 1px solid @borderColor;
-      }
+    .evaluation-base-info {
+        width: 100%;
+        height: ~"calc(100% - 45px)";
+        display: flex;
+        flex-direction: row;
+
+        .evalustion-base-attr {
+            width: 350px;
+            height: 100%;
+            border-right: 1px solid @borderColor;
+
+            .evalustion-base-attr-header {
+                height: 45px;
+                line-height: 45px;
+                color: @second-textColor;
+                border-bottom: 1px solid @borderColor;
+                margin-bottom: 25px;
+            }
+
+            .evaluation-attr-form {
+                margin-right: 15px;
+                /*color: white;*/
+            }
+        }
+
+        .evaluation-test-paper {
+            width: ~"calc(100% - 350px)";
+            height: 100%;
+            padding-left: 15px;
+
+            .evaluation-test-paper-header {
+                height: 45px;
+                line-height: 45px;
+                color: @second-textColor;
+                border-bottom: 1px solid @borderColor;
+            }
+        }
     }
-  }
 }
 
 .subject-item {
-  display: inline-block;
-  margin-right: 15px;
-  color: @second-textColor;
-  cursor: pointer;
-  line-height: 40px;
-  min-width: 50px;
-  font-size: 15px;
-  text-align: center;
-  margin-left:15px;
-
+    display: inline-block;
+    margin-right: 15px;
+    color: @second-textColor;
+    cursor: pointer;
+    line-height: 40px;
+    min-width: 50px;
+    font-size: 15px;
+    text-align: center;
+    margin-left: 15px;
 }
 
 .subject-item-active {
-  color: @primary-textColor;
-  border-bottom: 2px solid white;
-  font-weight: 500;
-
+    color: @primary-textColor;
+    border-bottom: 2px solid white;
+    font-weight: 500;
 }
+
 .test-paper-detail {
-  width: 100%;
-  height: ~"calc(100% - 45px)";
-  color: white;
-  padding-top: 15px;
-
-  .test-paper-info {
-    margin-bottom: 15px;
-  }
+    width: 100%;
+    height: ~"calc(100% - 45px)";
+    color: white;
+    padding-top: 15px;
+
+    .test-paper-info {
+        margin-bottom: 15px;
+    }
 }
+
 .question-type-count {
-  color: white;
-  font-size: 16px;
-  display: inline-block;
-  margin-top:15px;
-  margin-bottom:5px;
-}
+    color: white;
+    font-size: 16px;
+    display: inline-block;
+    margin-top: 15px;
+    margin-bottom: 5px;
+}

+ 42 - 0
TEAMModelOS/ClientApp/src/view/selflearning/CreateLearnUnit.less

@@ -139,4 +139,46 @@
 
 .file-content-wrap{
   padding-top:5px;
+}
+.content-file-item {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    margin-bottom: 5px;
+
+    .action-icon {
+        cursor: pointer;
+        margin-right: 8px;
+        font-size: 18px;
+        line-height: 22px;
+
+        &:hover {
+            color: aqua;
+        }
+    }
+
+    .content-file-name-wrap {
+        font-size: 15px;
+        width: ~"calc(100% - 80px)";
+    }
+
+    .content-file-item-action {
+        display: none;
+    }
+
+    &:hover {
+        border-bottom: 1px solid @borderColor;
+        background: #606060;
+        padding-left: 4px;
+        border-radius: 4px;
+    }
+
+    &:hover .content-file-item-action {
+        display: inline-block;
+    }
+}
+.file-icon {
+    display: inline-block;
+    vertical-align: sub;
+    margin-right: 5px;
 }

+ 19 - 1
TEAMModelOS/ClientApp/src/view/selflearning/CreateLearnUnit.vue

@@ -24,7 +24,25 @@
                                 <p class="content-type-label">内容:{{learnUnit.resource.length}}个</p>
                                 <div class="content-file-wrap">
                                     <NoData style="margin-top:30px;" v-if="learnUnit.resource.length == 0"></NoData>
-                                    <p v-for="(item,index) in learnUnit.resource">{{item.fileName}}</p>
+                                    <div class="content-file-item" v-for="(item,index) in learnUnit.resource">
+                                        <div class="content-file-name-wrap">
+                                            <div class="file-icon">
+                                                <img v-if="item.extension == 'ppt' || item.extension == 'pptx'" src="../../assets/icon/ppt50.png" width="15" />
+                                                <img v-else-if="item.extension == 'doc' || item.extension == 'docx'" src="../../assets/icon/word50.png" width="15" />
+                                                <img v-else-if="item.extension == 'xls' || item.extension == 'xlsx'" src="../../assets/icon/xls50.png" width="15" />
+                                                <img v-else-if="item.extension == 'pdf'" src="../../assets/icon/pdf50.png" width="15" />
+                                                <img v-else-if="item.type == 'picture'" src="../../assets/icon/icon_img.png" width="15" />
+                                                <img v-else-if="item.type == 'video'" src="../../assets/icon/icon_video.png" width="15" />
+                                                <img v-else src="../../assets/icon/prelearn50.png" width="15" />
+                                            </div>
+                                            <span>{{item.fileName}}</span>
+                                        </div>
+                                        <span class="content-file-item-action">
+                                            <Icon type="md-download" class="action-icon" title="下载"/>
+                                            <Icon type="md-eye" class="action-icon" title="预览"/>
+                                            <!--<Icon type="md-close" class="action-icon" title="删除"/>-->
+                                        </span>
+                                    </div>
                                 </div>
                                 <p class="content-type-label">题目:{{learnUnit.item.length}}道</p>
                                 <div class="content-question-wrap">

+ 138 - 0
TEAMModelOS/ClientApp/src/view/selflearning/ManageUnit.less

@@ -4,3 +4,141 @@
 @second-textColor: #a5a5a5; //文本副级颜色
 @primary-fontSize: 14px;
 @second-fontSize: 16px;
+
+.manage-unit-container {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: row;
+
+    .unit-list-wrap {
+        width: 350px;
+        height: 100%;
+        border-right: 1px solid @borderColor;
+        padding-left: 15px;
+
+        .unit-list-label {
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid @borderColor;
+            color: @second-textColor;
+        }
+
+        .unit-list-item-active {
+            background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
+        }
+
+        .unit-list-item {
+            width: 100%;
+            padding: 10px 10px 10px 0px;
+            color: white;
+            border-bottom: 1px solid @borderColor;
+
+            .unit-item-name {
+                font-size: 20px;
+            }
+
+            .unit-item-resource {
+                margin-top: 10px;
+                color: @second-textColor;
+            }
+
+            .unit-item-item {
+                margin-top: 10px;
+                color: @second-textColor;
+            }
+        }
+    }
+
+    .unit-main-wrap {
+        width: ~"calc(100% - 350px)";
+        height: 100%;
+        padding-left: 15px;
+
+        .unit-main-header {
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid @borderColor;
+        }
+
+        .unit-main-action {
+            float: right;
+            margin-right: 45px;
+            display: inline-block;
+            cursor: pointer;
+            color: white;
+
+            &:hover {
+                color: aqua;
+            }
+        }
+
+        .unit-main-label {
+            color: @second-textColor;
+        }
+
+        .unit-content-wrap {
+            width: 100%;
+            height: ~"calc(100% - 40px)";
+
+            .unit-content-label {
+                color: white;
+                line-height: 13px;
+                margin: 15px 0px;
+                padding: 5px;
+                padding-left: 8px;
+                border-left: 2px solid white;
+                background: #333333;
+            }
+
+            .unit-content-detail {
+                min-height: 240px;
+                width: 100%;
+            }
+        }
+    }
+}
+.content-file-item {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    margin-bottom: 5px;
+
+    .action-icon {
+        cursor: pointer;
+        margin-right: 8px;
+        font-size: 18px;
+        line-height: 22px;
+        color:white;
+        &:hover {
+            color: aqua;
+        }
+    }
+
+    .content-file-name-wrap {
+        font-size: 15px;
+        width: ~"calc(100% - 100px)";
+        color:white;
+    }
+
+    .content-file-item-action {
+        display: none;
+    }
+
+    &:hover {
+        border-bottom: 1px solid @borderColor;
+        background: #606060;
+        padding-left: 4px;
+        border-radius: 4px;
+    }
+
+    &:hover .content-file-item-action {
+        display: inline-block;
+    }
+}
+
+.file-icon {
+    display: inline-block;
+    vertical-align: text-top;
+    margin-right: 5px;
+}

+ 111 - 4
TEAMModelOS/ClientApp/src/view/selflearning/ManageUnit.vue

@@ -1,21 +1,128 @@
 <template>
-    <div>
-        <h1>管理最小学习单元</h1>
+    <div class="manage-unit-container">
+        <div class="unit-list-wrap">
+            <p class="unit-list-label">最小单元列表</p>
+            <div :class="index == currentUnitIndex ? 'unit-list-item unit-list-item-active':'unit-list-item'" v-for="(item,index) in unitList" @click="selectUnit(index)">
+                <p class="unit-item-name">{{item.name}}</p>
+                <p class="unit-item-resource"><Icon type="ios-folder" style="margin-right:10px;"/>资源数:{{item.resource.length}}</p>
+                <p class="unit-item-item"><Icon type="ios-cube"  style="margin-right:10px;"/>题目数:{{item.item.length}}</p>
+            </div>
+            <NoData v-if="unitList.length == 0" style="margin-top:120px;"></NoData>
+        </div>
+        <div class="unit-main-wrap">
+            <div class="unit-main-header">
+                <span class="unit-main-label">自学资源</span>
+                <span class="unit-main-action"><Icon type="ios-create-outline" size="20" />编辑内容</span>
+                <span class="unit-main-action"><Icon type="ios-send" size="20" />发布内容</span>
+            </div>
+            <div class="unit-content-wrap" v-if="unitList.length > 0">
+                <vuescroll>
+                    <p class="unit-content-label">自学内容</p>
+                    <div class="unit-content-detail">
+                        <NoData v-if="unitList[currentUnitIndex].length == 0" style="margin-top:120px;"></NoData>
+                        <div class="content-file-item" v-for="(item,index) in unitList[currentUnitIndex].resource">
+                            <div class="content-file-name-wrap">
+                                <div class="file-icon">
+                                    <img v-if="item.extension == 'ppt' || item.extension == 'pptx'" src="../../assets/icon/ppt50.png" width="15" />
+                                    <img v-else-if="item.extension == 'doc' || item.extension == 'docx'" src="../../assets/icon/word50.png" width="15" />
+                                    <img v-else-if="item.extension == 'xls' || item.extension == 'xlsx'" src="../../assets/icon/xls50.png" width="15" />
+                                    <img v-else-if="item.extension == 'pdf'" src="../../assets/icon/pdf50.png" width="15" />
+                                    <img v-else-if="item.type == 'picture'" src="../../assets/icon/icon_img.png" width="15" />
+                                    <img v-else-if="item.type == 'video'" src="../../assets/icon/icon_video.png" width="15" />
+                                    <img v-else src="../../assets/icon/prelearn50.png" width="15" />
+                                </div>
+                                <span>{{item.fileName}}</span>
+                            </div>
+                            <span class="content-file-item-action">
+                                <Icon type="md-download" class="action-icon" title="下载" />
+                                <Icon type="md-eye" class="action-icon" title="预览" />
+                                <Icon type="md-close" class="action-icon" title="删除"/>
+                            </span>
+                        </div>
+                    </div>
+                    
+                    <p class="unit-content-label">检测题目</p>
+                    <div class="unit-content-detail">
+                        <NoData v-if="unitList[currentUnitIndex].length !== 0" style="margin-top:120px;"></NoData>
+                    </div>
+                    
+                </vuescroll>
+            </div>
+        </div>
     </div>
 </template>
 <script>
+    import NoData from '@/common/NoData.vue'
     export default {
+        components: {
+            NoData
+        },
         data() {
             return {
+                unitList: [],
+                currentUnitIndex:0
+            }
+        },
+        methods: {
+            selectUnit(index) {
+                this.currentUnitIndex = index
+                this.findResourceById()
+            },
+            findResourceById() {
+                if (this.unitList.length > 0) {
+                    if (!this.unitList[this.currentUnitIndex].requested) {
+                        this.$api.learnActivity.FindSyllabusResourceById(this.unitList[this.currentUnitIndex].resource).then(
+                            res => {
+                                if (res.error == null) {
+                                    //if (res.result.data.length == this.unitList[this.currentUnitIndex].resource.length) {
+                                    this.unitList[this.currentUnitIndex].resource.length = 0
+                                    this.unitList[this.currentUnitIndex].resource = res.result.data
+                                    this.unitList[this.currentUnitIndex].requested = true
+                                    //} else {
+                                    //    this.$Message.error("数据错误")
+                                    //}
+                                } else {
+                                    this.$Message.error("API ERROR!")
+                                }
+                            },
+                            err => {
+                                this.$Message.error("API ERROR!")
+                            }
+                        )
+                    } else {
+                        this.$Message.info("已经通过id请求过数据!")
+                    }
+                }
+            },
+            getUnit() {
+                let requestData = {
+                    scopeCode: this.$store.state.schoolBaseInfo.demoLoginInfo.TEAMModelId
+                }
+                this.$api.learnActivity.FindUnit(requestData).then(
+                    res => {
+                        if (res.error == null) {
+                            this.unitList = res.result.data
+                            if (this.unitList.length > 0) {
+                                this.findResourceById()
+                            }
+                        } else {
+                            this.$Message.error('API ERROR!')
+                        }
+                    },
+                    err => {
 
+                    }
+                )
             }
         },
+        created() {
+            this.getUnit()
+        }
 
     }
 </script>
 <style lang="less" scoped>
-@import "./ManageUnit.less";
+    @import "./ManageUnit.less";
 </style>
 <style lang="less">
-
 </style>

+ 5 - 1
TEAMModelOS/Controllers/Analysis/AchievementController.cs

@@ -42,7 +42,7 @@ namespace TEAMModelOS.Controllers.Analysis
             {
                 { "schoolCode", "Habook" }
             };
-            //声明进行标准
+            //声明进行标准用来设置进线标准,权重等参数
             request.@params.TryGetValue("Standard", out object Standard);
             List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
             Console.WriteLine(DateTimeOffset.Now.Second);
@@ -1270,6 +1270,10 @@ namespace TEAMModelOS.Controllers.Analysis
                 {
                     if (p.periodName.Equals("初中")) {
                         grades = p.grades;
+                    } else if (p.periodName.Equals("高中")) {
+                        grades = p.grades;
+                    } else {
+                        grades = p.grades;
                     }
                 });
                 //循环处理不同年级考试信息