소스 검색

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

李思淳 5 년 전
부모
커밋
31e1e3927b

+ 7 - 0
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -59,7 +59,14 @@ export default {
     */
     FindSyllabusResourceById: function (data) {
         return post('/api/Resource/FindSyllabusResourceById', data)
+    },
+    /*
+    *根据id数组查询资源文件
+    */
+    FindQuestionById: function (data) {
+        return post('/api/ItemInfo/FindById', data)
     }
 
 
+
 }

+ 18 - 2
TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.less

@@ -8,6 +8,8 @@
 .choose-question-wrap {
   height: ~"calc(100% - 76px)";
   position:relative;
+  padding-left:10px;
+  padding-bottom:40px;
 }
 .seach-input {
   position: absolute;
@@ -45,8 +47,7 @@
 .page-wrap {
     width: 100%;
     position: fixed;
-    left: 0px;
-    bottom: 32px;
+    bottom: 30px;
     padding: 5px 0px;
     background: rgba(20,20,20,.8);
     text-align: center;
@@ -121,4 +122,19 @@
     vertical-align: text-top;
     border-radius: 2px;
   }
+}
+.manual-filter-item {
+    margin-top: 5px;
+    margin-bottom: 8px;
+    color:white;
+    .manual-filter-label {
+        width: 60px;
+        display: inline-block;
+    }
+}
+.question-filter-wrap {
+    width: 100%;
+    border-bottom: 1px solid #666666;
+    margin-bottom: 10px;
+    padding-left:10px;
 }

+ 148 - 43
TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.vue

@@ -103,30 +103,60 @@
             <TabPane label="题目">
                 <div class="tab-wrap">
                     <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>
+                        <Row class="question-filter-wrap">
+                            <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+                            <div class="manual-filter-item">
+                                <span class="manual-filter-label">来源:</span>
+                                <CheckboxGroup v-model="questionFilter.scopeCode" style="display:inline-block;" @on-change="checkAll($event,'scopeCode')">
+                                    <Checkbox label="all">全部</Checkbox>
+                                    <Checkbox :label="demoLoginInfo.TEAMModelId">私有题库</Checkbox>
+                                    <Checkbox :label="demoLoginInfo.schoolCode">校本题库</Checkbox>
+                                </CheckboxGroup>
                             </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>
+                            </Col>
+                            <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+                            <div class="manual-filter-item">
+                                <span class="manual-filter-label">学段:</span>
+                                <CheckboxGroup v-model="questionFilter.periodCode" style="display: inline-block;" @on-change="checkAll($event,'periodCode')">
+                                    <Checkbox label="all">全部</Checkbox>
+                                    <Checkbox v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.periodCode">{{item.periodName}}</Checkbox>
+                                </CheckboxGroup>
                             </div>
-                            <Input class="seach-input" suffix="ios-search" placeholder="关键字搜索" clearable style="width: 240px" size="small" />
-                        </div>
+                            </Col>
+                            <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+                            <div class="manual-filter-item">
+                                <span class="manual-filter-label">题型:</span>
+                                <CheckboxGroup v-model="questionFilter.type" border style="display: inline-block;" @on-change="checkAll($event,'type')">
+                                    <Checkbox label="all">全部</Checkbox>
+                                    <Checkbox label="Single">单选</Checkbox>
+                                    <Checkbox label="Multiple">多选</Checkbox>
+                                    <Checkbox label="Judge">判断</Checkbox>
+                                    <Checkbox label="Complete">填空</Checkbox>
+                                    <Checkbox label="Subjective">问答</Checkbox>
+                                    <Checkbox label="Compose">综合</Checkbox>
+                                </CheckboxGroup>
+                            </div>
+                            </Col>
+                            <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+                            <div class="manual-filter-item">
+                                <span class="manual-filter-label">难度:</span>
+                                <CheckboxGroup v-model="questionFilter.level" border style="display: inline-block;" @on-change="checkAll($event,'level')">
+                                    <Checkbox label="all">全部</Checkbox>
+                                    <Checkbox v-for="(item,index) in exersicesDiff" :key="index" :label="index + 1">{{ item }}</Checkbox>
+                                </CheckboxGroup>
+                            </div>
+                            </Col>
+                            <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
+                            <div class="manual-filter-item">
+                                <span class="manual-filter-label">知识点:</span>
+                                <span>暂无知识点</span>
+                                <Icon @click="addKnowledge" type="md-add-circle" title="添加知识点" color="white" style="margin-left:15px;cursor:pointer;" size="18" />
+                            </div>
+                            </Col>
+                        </Row>
                         <div class="choose-question-wrap">
-                            <QuestionList :config="questionConfig" @seleteQuestion="seleteQuestion" :questions="questionList"></QuestionList>
+                            <Loading :top="100" v-show="isLoading"></Loading>
+                            <QuestionList :class="isLoading ? '':'animated fadeIn'" v-show="!isLoading" :config="questionConfig" @seleteQuestion="seleteQuestion" :questions="questionList"></QuestionList>
                             <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" />
@@ -142,18 +172,28 @@
     import NoData from '@/common/NoData.vue'
     import JSONPath from 'jsonpath'
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import questions from '../../view/evaluation/index/list.json'
+    import Loading from '@/common/Loading.vue'
     export default {
         components: {
             NoData,
-            QuestionList
+            QuestionList,
+            Loading
         },
         data() {
             return {
-                pageNum: 0,
-                totalNum: 100,
+                isLoading: false,
+                questionFilter: {
+                    periodCode: ['all'],
+                    scopeCode: ['all'],
+                    points: ['all'],
+                    type: ['all'],
+                    level: ['all'],
+                    subjectCode: ['all']
+                },
+                exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
+                pageNum: 1,
+                totalNum: 0,
                 pageSize: 20,
-
                 questionConfig: {
                     showSelect: true
                 },
@@ -191,7 +231,6 @@
                     }
                 ],
                 questionList: [],
-                //selectedFiles:[],
                 selectedQuestions: [],
                 searchBefore: [],
                 defaultProps: {
@@ -213,12 +252,89 @@
                     status: 1,
                     scopeCode: 'HBCN'
                 },
-
+                addKnowledgeStatus: false
             }
         },
         methods: {
-            getCurrentPageData(page) {
+            /**
+             * 查询当前页题目
+             */
+            getCurrentPageData(pageNum) {
+                this.queryQuestionByPage()
+            },
+            /**
+             * 选择全部逻辑
+             * @param data:选中数据
+             * @param field:字段名
+             */
+            checkAll(data, field) {
+                if (this.questionFilter[field].length !== 1 && this.questionFilter[field].indexOf('all') === 0) {
+                    this.questionFilter[field].splice(this.questionFilter[field].indexOf('all'), 1)
+                } else if (this.questionFilter[field].indexOf('all') > 0) {
+                    this.questionFilter[field].length = 0
+                    this.$set(this.questionFilter[field], 0, 'all')
+                }
+                console.log(this.questionFilter)
+                this.pageNum = 1
+                this.getResultCount()
+                this.queryQuestionByPage()
+            },
+            /**
+             * 获取题库数量
+             */
+            getResultCount() {
+                let findCountParams = {
+                    "collectionName": "ExamItem",
+                    "queryDict": {
+                        'scopeCode': this.deleteAll(this.questionFilter.scopeCode),
+                        'periodCode': this.deleteAll(this.questionFilter.periodCode),
+                        'level': this.deleteAll(this.questionFilter.level),
+                        'type': this.deleteAll(this.questionFilter.type),
+                        'gradeCode': [],
+                        'subjectCode': [],
+                        'field': [],
+                    }
+                }
+                this.$api.newEvaluation.FindCount(findCountParams).then(res => {
+                    this.totalNum = res.result.data[0]
+                })
+            },
+            /**
+             * 分页查询题目
+             */
+            queryQuestionByPage() {
+                let queryData = {
+                    '@CURRPAGE': this.pageNum,
+                    '@PAGESIZE': this.pageSize,
+                    'scopeCode': this.deleteAll(this.questionFilter.scopeCode),
+                    'periodCode': this.deleteAll(this.questionFilter.periodCode),
+                    'level': this.deleteAll(this.questionFilter.level),
+                    'type': this.deleteAll(this.questionFilter.type),
+                    'gradeCode': [],
+                    'subjectCode': [],
 
+                }
+                this.isLoading = true
+                this.$api.newEvaluation.FindExerciseList(queryData).then(res => {
+                    this.questionList = res.result.data
+                    setTimeout(() => {
+                        this.isLoading = false
+                    }, 500)
+                })
+            },
+            deleteAll(data) {
+                if (data.length == 1) {
+                    if (data[0] == 'all') {
+                        return []
+                    } else {
+                        return data
+                    }
+                } else {
+                    return data
+                }
+            },
+            addKnowledge() {
+                this.addKnowledgeStatus = true
             },
             setScopeCode(type) {
 
@@ -226,7 +342,7 @@
             seleteQuestion(question) {
                 let flag = true
                 for (let item of this.selectedQuestions) {
-                    if (item.shaCode == question.shaCode) {
+                    if (item.id == question.id) {
                         flag = false
                         break
                     }
@@ -303,18 +419,6 @@
                         key: 'fileName',
                         sortable: true
                     },
-                    //{
-                    //  title: this.$t('teachContent.tableC2'),
-                    //  slot: 'action',
-                    //  width: 210,
-                    //  align: 'center'
-                    //},
-                    //{
-                    //  title: this.$t('teachContent.tableC3'),
-                    //  slot: 'knowledges',
-                    //  width: 180,
-                    //  align: 'center'
-                    //},
                     {
                         title: this.$t('teachContent.tableC4'),
                         slot: 'size',
@@ -425,7 +529,8 @@
             Date.prototype.toLocaleString = function () {
                 return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate();
             }
-            this.questionList = questions.result.data
+            this.getResultCount()
+            this.queryQuestionByPage()
         }
     }
 </script>

+ 0 - 2
TEAMModelOS/ClientApp/src/components/learnactivity/QuestionList.vue

@@ -23,8 +23,6 @@
           <span v-for="(answerItem,index) in item.answer" v-html='answerItem'></span>
         </p>
         <div class="question-control-wrap">
-          <!--<Button class="question-control-btn" type="warning" size="small">补救资源</Button>
-          <Button class="question-control-btn" type="warning" size="small">删除</Button>-->
           <Icon type="md-trash" class="question-control-btn" size="25" title="删除" v-if="config.showDelete" @click="deleteQuestion(index)"/>
           <Icon type="ios-link" class="question-control-btn" size="25" title="补救资源" v-if="config.showRemedy"/>
         </div>

+ 9 - 6
TEAMModelOS/ClientApp/src/utils/js-fn.js

@@ -60,12 +60,15 @@ function getPeriod(data, periodCode) {
       subjects: []
     }
   } else {
-    let result = JSONPath.query(data, "$..[?(@.periodCode=='" + periodCode + "')]")
-    if (result.length == 0) {
-      return {
-        periodName: '暂无数据'
-      }
-    } else {
+      let result = JSONPath.query(data, "$..[?(@.periodCode=='" + periodCode + "')]")
+      if (result.length == 0) {
+          return {
+              periodName: '暂无数据',
+              periodCode: '00',
+              grades: [],
+              subjects: []
+          }
+      } else {
       return result[0]
     }
   }

+ 3 - 0
TEAMModelOS/ClientApp/src/view/coursemgmt/CourseClassroom.less

@@ -212,4 +212,7 @@
 .close-btn:hover {
   transform: rotate(270deg);
   transition: transform 1s;
+}
+.add-learn-step-icon{
+
 }

+ 58 - 20
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -9,7 +9,7 @@
             <span class="import-exercise">
                 <Button type="success" @click="goPickExercises">手动挑题</Button>
                 <Button type="info" @click="randomModal = true">随机挑题</Button>
-                <Upload multiple action="api/ImportExercise/uploadWord" :headers="headers" :on-success="uploadSuccess">
+                <Upload multiple action="/api/ImportExercise/UploadWord" :headers="headers" :on-success="uploadSuccess">
                     <Button type="info">导入习题</Button>
                 </Upload>
             </span>
@@ -54,6 +54,7 @@
         <!-- 随机挑题组卷 -->
         <Modal v-model="randomModal"
                title="随机挑题"
+               footer-hide
                class-name="random-pick-modal"
                width="1000px">
             <Form :model="paperInfo" label-position="top">
@@ -66,10 +67,6 @@
             </Form>
             <AutoCreate @getExercises="autoQuestions"
                         @goToPreview="goCreatePaper"></AutoCreate>
-            <div slot="footer">
-                <Button type="text" @click="randomModal = false">取消</Button>
-                <Button type="primary" @click="randomModal = false">确定</Button>
-            </div>
         </Modal>
     </div>
 </template>
@@ -201,14 +198,21 @@
             },
 
             autoQuestions(res) {
-                let items = []
-                res.forEach(item => {
-                    items = items.concat(item.item)
-                })
-                this.paperInfo.item = items
-                this.paperInfo.scopeCode = this.filterParams.scopeCode,
-                this.paperInfo.periodCode = this.filterParams.periodCode[0],
-                this.paperInfo.subjectCode = this.filterParams.subjectCode[0]
+                if (this.paperInfo.name) {
+                    let items = []
+                    res.forEach(item => {
+                        items = items.concat(item.item)
+                    })
+                    console.log(res)
+                    this.paperInfo.item = items
+                    this.paperInfo.scopeCode = this.filterParams.scopeCode,
+                        this.paperInfo.periodCode = this.filterParams.periodCode[0],
+                        this.paperInfo.subjectCode = this.filterParams.subjectCode[0]
+
+                    this.goCreatePaper()
+                } else {
+                    this.$Message.warning("请先输入试卷名称!")
+                }
             },
 
             /**
@@ -273,7 +277,7 @@
              * @param code
              */
             getSubjectName(code) {
-                return this.$jsFn.getSubjectName(this.$store.state.schoolBaseInfo.schoolBaseInfo,code)
+                return this.$jsFn.getSubjectName(this.$store.state.schoolBaseInfo.schoolBaseInfo, code)
             }
 
         },
@@ -306,17 +310,51 @@
     }
 
     .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-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-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;
+        color: #000;
+    }
+
+    .random-pick-modal .auto-create-wrap {
+        background: transparent;
+    }
+
+    .random-pick-modal .auto-create-name {
+        color: #515a6e;
+        text-align: left;
+        font-size: 14px;
+        font-weight: normal;
+        margin-top: 0;
+    }
+
+    .random-pick-modal .question-condition-wrap .ivu-btn {
+        height: 40px;
+        line-height: 40px;
+        margin-top: 0;
+    }
+
+    .random-pick-modal .question-condition-wrap {
+        overflow: hidden;
+    }
+
+    .random-pick-modal .ivu-tag {
+        background: transparent !important;
+    }
+
+    .random-pick-modal .ivu-tag-color-white {
+        color: #515a6e !important;
+    }
+
+    .random-pick-modal .ivu-tag .ivu-icon-ios-close {
+        color: #515a6e !important;
     }
 </style>

+ 28 - 109
TEAMModelOS/ClientApp/src/view/evaluation/index/index.vue

@@ -1,44 +1,25 @@
 <template>
-  <div class="evaluation">
-    <div class="ev-header" style="display:none;">
-      <Header :parentToChild="syllabusTitle" :identityselect="identitydata"></Header>
-    </div>
-    <vuescroll ref="evScroll">
-        <div class="ev-body">
-            <!--<div class="ev-slide">
-          <div class="ev-slide-school"><Icon type="ios-school" size="26" color="#10abe7" style="vertical-align:sub"/> {{schoolInfo.claimName}}</div>
-          <div class="ev-slide-header">选择学段及科目</div>
-          <div class="ev-slide-select">
-            <Select v-model="evPeriodSelect" @on-change="periodChange" label-in-value>
-              <Option v-for="item in evPeriodsList" :value="item.code" :key="item.rowKey">{{ item.name }}</Option>
-            </Select>
-            <Select v-model="evSubjectSelect" @on-change="subjectChange" label-in-value>
-              <Option v-for="item in evSubjectList" :value="item.code" :key="item.rowKey">{{ item.name }}</Option>
-            </Select>
-          </div>
-          <div class="ev-slide-header ev-slide-select-volumes" style="position:relative">
-            <Select v-model="evVolumeSelect" @on-change="volumeChange" label-in-value placeholder="请选择册别">
-              <Option v-for="item in evVolumesList" :value="item.rowKey" :key="item.rowKey">{{ item.gradeName + '' + item.termName }}</Option>
-            </Select>
-          </div>
-          <SyllabusTree :treeDatas="treeData"></SyllabusTree>
-        </div>-->
-            <div class="ev-content">
-                <router-view />
+    <div class="evaluation">
+        <div class="ev-header" style="display:none;">
+            <Header :parentToChild="syllabusTitle" :identityselect="identitydata"></Header>
+        </div>
+        <Loading :top="100" v-show="dataLoading" type="3"></Loading>
+        <vuescroll ref="evScroll">
+            <div class="ev-body">
+                <div class="ev-content">
+                    <router-view />
+                </div>
             </div>
+        </vuescroll>
+        <div class="slide-menu animated">
+            <ul>
+                <li @click="goRouter('createExercises')">创建习题</li>
+                <li @click="goRouter('exercisesList')">组卷中心</li>
+                <li @click="goRouter('testPaperList')">试卷试题库</li>
+            </ul>
+            <!--<Icon type="md-list" />-->
         </div>
-    </vuescroll>
-    <div class="slide-menu animated">
-      <ul>
-        <li @click="goRouter('createExercises')">创建习题</li>
-        <li @click="goRouter('exercisesList')">我的题库</li>
-        <li @click="goRouter('createTest')">创建评测</li>
-        <li @click="goRouter('testPaper')">编辑评测</li>
-        <li @click="goRouter('testPaperList')">我的评测</li>
-      </ul>
-      <!--<Icon type="md-list" />-->
     </div>
-  </div>
 
 </template>
 <script>
@@ -67,83 +48,20 @@
         evSubjectSelect: '',
         evPeriodSelect: '',
         evVolumeSelect: '',
-        isLoadingFinish: false
+        dataLoading: false
       }
     },
     created() {
-      // this.schoolInfo = JSON.parse(localStorage.getItem('c_role_info')).roleClaim[0].claim[0] // 默认选中第一个学校
-      // this.findSchoolPeriodsByDict()
+      
     },
     methods: {
-      goRouter(name) {
-        this.$router.push({
-          name: name
-        })
-      },
-
-      // 获取当前学校全部学段
-      findSchoolPeriodsByDict() {
-        this.$api.FindSchoolPeriodsByDict({ SchoolCode: this.schoolInfo.claimCode }).then(res => {
-          // this.evPeriodsList = res.result.data;
-          // this.evPeriodSelect = res.result.data[0].code;
-          // this.findSchoolSubjectsByDict();
-        })
-      },
-
-      // 查找当前学校已有科目
-      findSchoolSubjectsByDict() {
-        this.$api.FindSchoolSubjectsByDict({ SchoolCode: this.schoolInfo.claimCode, Status: 1 }).then(res => {
-          this.evSubjectList = res.result.data
-          this.evSubjectSelect = res.result.data[0].code
-          this.findVolumesBySubjectAndPeriod(this.evPeriodSelect, this.evSubjectSelect)
-        })
-      },
-
-      // 根据当前选择的科目及学段获取所有册别
-      findVolumesBySubjectAndPeriod(periodCode, subjectCode) {
-        let defaultData = {
-          SchoolCode: this.schoolInfo.claimCode,
-          SubjectCode: subjectCode,
-          PeriodCode: periodCode,
-          Status: 1
-        }
-        this.$api.FindSchoolVolumesByDict(defaultData).then(res => {
-          this.evVolumesList = res.result.data
-          if (res.result.data.length) {
-            this.evVolumeSelect = res.result.data[0].rowKey
-            this.findSyllabusByVolumeCode(res.result.data[0].rowKey)
-          } else {
-            this.evVolumeSelect = ''
-            this.treeData = []
-          }
-         })
-      },
-
-      // 根据册别来获取课纲树形结构
-      findSyllabusByVolumeCode(volumeCode) {
-        this.isLoadingFinish = false
-        this.$api.FindSyllabusByVolumeCode({ VolumeCode: volumeCode, Status: 1 }).then(res => {
-          let list = res.result.data
-          list.forEach(item => { item.expand = false })
-          this.treeData = list
-          this.isLoadingFinish = true
-        })
-      },
-
-      // 选择科目变化
-      subjectChange(val) {
-        this.findVolumesBySubjectAndPeriod(this.evPeriodSelect, val.value)
-      },
-
-      // 选择学段变化
-      periodChange(val) {
-        this.findVolumesBySubjectAndPeriod(val.value, this.evSubjectSelect)
+        goRouter(name) {
+            this.$router.push({
+              name: name
+            })
       },
 
-      // 选择册别变化
-      volumeChange(val) {
-        this.findSyllabusByVolumeCode(val.value)
-      }
+      
     },
     mounted() {
     }
@@ -157,6 +75,7 @@
     height:100%;
     position:relative;
     overflow:hidden;
+    font-family: '微軟正黑體', 'Heiti TC' !important;
   }
   .ev-body {
     width:98%;
@@ -247,7 +166,7 @@
 
   .slide-menu {
     width:150px;
-    background:#bdbcbc;
+    background:#191919;
     position:fixed;
     top:100px;
     left:-140px;
@@ -295,7 +214,7 @@
           width: 1em;
           height: 1em;
           border-radius: 50%;
-          background:#2cbeff;
+          background:#a28f5c;
           transform-origin: center;
           transform: translate3d(50%, 50%, 0) scale3d(0, 0, 0);
           transition: transform 0.45s ease-in-out;

+ 1 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue

@@ -123,8 +123,7 @@
         </div>
         <Modal v-model="editEvaluationStatus"
                title="编辑评测"
-               @on-ok="confirmEdit"
-               @on-cancel="cancelEdit">
+               @on-ok="confirmEdit">
             <p>即将跳转到评测编辑页面?</p>
         </Modal>
         <Modal v-model="examAnalysisStatus"
@@ -221,9 +220,6 @@
             }
         },
         methods: {
-            cancelEdit() {
-
-            },
             drawPie(flag) {
                 if (flag) {
                     this.$refs.examPaperAnalysis.drawDiffChart()

+ 2 - 8
TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue

@@ -96,17 +96,11 @@
                         <Icon @click="addKnowledge" type="md-add-circle" title="添加知识点" color="white" style="margin-left:15px;cursor:pointer;" size="18" />
                     </div>
                     </Col>
-                    <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
-
-                    </Col>
-                    <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
-
-                    </Col>
                 </Row>
             </div>
             <div class="question-list-wrap">
                 <Loading :top="100" v-show="isLoading"></Loading>
-                <QuestionList :class="isLoading ? '':'animated fadeIn'" v-if="!isLoading" :config="questionConfig" :questions="questionList" @seleteQuestion="seleteQuestion"></QuestionList>
+                <QuestionList :class="isLoading ? '':'animated fadeIn'" v-show="!isLoading" :config="questionConfig" :questions="questionList" @seleteQuestion="seleteQuestion"></QuestionList>
                 <NoData style="margin-top:120px;" v-if="!isLoading && questionList.length == 0" textContent="没有查询到题目"></NoData>
                 <div class="page-wrap">
                     <Page :current.sync="pageNum" :total="totalNum" :page-size="pageSize" size="small" show-elevator show-sizer @on-change="getCurrentPageData" />
@@ -268,7 +262,7 @@
             seleteQuestion(data) {
                 let flag = true
                 for (let item of this.shoppingQuestionList) {
-                    if (item.shaCode == data.shaCode) {
+                    if (item.id == data.id) {
                         flag = false
                         break
                     }

+ 4 - 0
TEAMModelOS/ClientApp/src/view/selflearning/CreateLearnUnit.vue

@@ -151,6 +151,10 @@
             }
         },
         created() {
+            let routerData = this.$route.params.unitInfo
+            if (routerData !== undefined) {
+                this.learnUnit = routerData
+            }
         }
     }
 </script>

+ 9 - 0
TEAMModelOS/ClientApp/src/view/selflearning/CreateOrderLearn.less

@@ -169,3 +169,12 @@
     min-height: 200px;
     padding: 10px 0px 20px 0px;
 }
+.add-learn-step-icon {
+    margin-right: 10px;
+    line-height: 40px;
+    cursor: pointer;
+    color:white;
+}
+.add-step-type-label{
+    padding:10px 5px;
+}

+ 82 - 74
TEAMModelOS/ClientApp/src/view/selflearning/CreateOrderLearn.vue

@@ -18,9 +18,14 @@
                         <FormItem label="活动名称">
                             <Input v-model="orderLearnInfo.name"></Input>
                         </FormItem>
+                        <FormItem label="学段">
+                            <Select v-model="orderLearnInfo.periodCode">
+                                <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
+                            </Select>
+                        </FormItem>
                         <FormItem label="科目">
-                            <Select v-model="orderLearnInfo.subject">
-                                <Option v-for="(item,index) in subjectList" :value="item" :key="index">{{ item }}</Option>
+                            <Select v-model="orderLearnInfo.subjectCode">
+                                <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,orderLearnInfo.periodCode).subjects" :value="item.subjectCode" :key="index">{{ item.subjectName }}</Option>
                             </Select>
                         </FormItem>
                         <FormItem label="学习对象">
@@ -36,13 +41,13 @@
                                 </Tooltip>
 
                             </div>
-                            <RadioGroup v-model="orderLearnInfo.isPass">
+                            <RadioGroup v-model="orderLearnInfo.isOrder">
                                 <Radio label="1">是</Radio>
                                 <Radio label="0" style="margin-left:30px;">否</Radio>
                             </RadioGroup>
                         </FormItem>
                         <FormItem label="活动说明">
-                            <Input v-model="orderLearnInfo.notice" type="textarea" :rows="6"></Input>
+                            <Input v-model="orderLearnInfo.introduce" type="textarea" :rows="6"></Input>
                         </FormItem>
                     </Form>
                     <!--</vuescroll>-->
@@ -51,25 +56,30 @@
             <div class="order-learn-main dark-iview-split">
                 <Split v-model="split1">
                     <!--<div slot="left" class="demo-split-pane">
-                      Left Pane
-                    </div>-->
+                  Left Pane
+                </div>-->
                     <div slot="left" class="learn-step-wrap">
-                        <p class="base-info-label">
+                        <div class="base-info-label">
                             <span>
                                 学习阶段
                             </span>
-                            <Icon type="md-add" color="white" size="20" style="float:right;margin-right:10px;line-height:40px;cursor:pointer;" @click="addContent" />
-                        </p>
-                        <Table draggable :columns="columns" :data="orderLearnInfo.content" @on-drag-drop="dragOrder" @on-row-click="getCurrentItem" :row-class-name="setClassName" style="width:100%;">
+                            <Tooltip style="float:right;" placement="left">
+                                <Icon class="add-learn-step-icon" type="md-add" size="20" @click="addStepStatus = true" />
+                                <div slot="content">
+                                    <p class="add-step-type-label"><Icon type="md-list" size="18" style="margin-right:5px;"/>手动选择内容</p>
+                                    <p class="add-step-type-label"><Icon type="md-list" size="18" style="margin-right:5px;"/>选择最小单元</p>
+                                </div>
+                            </Tooltip>
+                            
+                        </div>
+                        <Table draggable :columns="columns" :data="orderLearnInfo.steps" @on-drag-drop="dragOrder" @on-row-click="getCurrentItem" :row-class-name="setClassName" style="width:100%;">
                             <template slot-scope="{ row, index }" slot="name">
                                 <Icon type="ios-pricetags" color="white" style="margin-right:8px;" />
                                 <span class="learn-step-name">{{row.name}}</span>
                             </template>
                         </Table>
+                        <!--<NoData v-if="orderLearnInfo.steps.length == 0" style="margin-top:30px;"></NoData>-->
                     </div>
-                    <!--<div slot="right" class="demo-split-pane">
-                      Right Pane
-                    </div>-->
                     <div slot="right" class="learn-content-wrap">
                         <div class="base-info-label">
                             学习资源
@@ -86,55 +96,60 @@
                                 </div>
                             </div>
                         </div>
-                        <div :class="currentView == 1 ? 'animated faster fadeInLeft choose-learn-content-wrap':'animated fadeOutRight choose-learn-content-wrap'">
+                        <div v-if="orderLearnInfo.steps.length !== 0" :class="currentView == 1 ? 'animated faster fadeInLeft choose-learn-content-wrap':'animated fadeOutRight choose-learn-content-wrap'">
                             <div class="create-learn-content">
                                 <span :class="currentCreateType == 0 ? 'active-span':''" @click="selectCreateType(0)">选择已建自学内容</span>
                                 <span :class="currentCreateType == 1 ? 'active-span':''" @click="selectCreateType(1)">临时创建自学内容</span>
                             </div>
-                            <ChooseContent style="margin-top:10px;height:calc(100% - 50px);" @on-select-question="getSelectedQuestion" @on-cancel-file="cancelFile" @on-select-file="getSelectFile"></ChooseContent>
+                            <ChooseContent v-show="currentCreateType == 1" :class="currentCreateType == 1 ? 'animated fadeIn':''" style="margin-top:10px;height:calc(100% - 50px);" @on-select-question="getSelectedQuestion" @on-cancel-file="cancelFile" @on-select-file="getSelectFile"></ChooseContent>
+                            <ManageUnit :type="0" v-show="currentCreateType == 0" :class="currentCreateType == 0 ? 'animated fadeIn':''" @chooseUnit="chooseUnit"></ManageUnit>
                         </div>
-                        <div :class="currentView == 0 ? 'animated faster fadeInLeft preview-learn-content-wrap':'animated fadeOutRight preview-learn-content-wrap'">
-                            <p class="content-type-label">内容:{{orderLearnInfo.content[contentIndex].files.length}}个</p>
+                        <NoData v-if="orderLearnInfo.steps.length == 0" style="margin-top:100px;"></NoData>
+                        <div v-if="orderLearnInfo.steps.length !== 0" :class="currentView == 0 ? 'animated faster fadeInLeft preview-learn-content-wrap':'animated fadeOutRight preview-learn-content-wrap'">
+                            <p class="content-type-label">内容:{{orderLearnInfo.steps[stepIndex].resource.length}}个</p>
                             <div class="content-file-wrap">
-                                <NoData style="margin-top:30px;" v-if="orderLearnInfo.content[contentIndex].files.length == 0"></NoData>
-                                <p v-for="(item,index) in orderLearnInfo.content[contentIndex].files">{{item.fileName}}</p>
+                                <NoData style="margin-top:30px;" v-if="orderLearnInfo.steps[stepIndex].resource.length == 0"></NoData>
+                                <p v-for="(item,index) in orderLearnInfo.steps[stepIndex].resource">{{item.fileName}}</p>
                             </div>
-                            <p class="content-type-label">题目:{{orderLearnInfo.content[contentIndex].questions.length}}道</p>
+                            <p class="content-type-label">题目:{{orderLearnInfo.steps[stepIndex].item.length}}道</p>
                             <div class="content-question-wrap">
-                                <NoData v-if="orderLearnInfo.content[contentIndex].questions.length == 0" style="margin-top:30px;"></NoData>
-                                <QuestionList v-else :questions="orderLearnInfo.content[contentIndex].questions"></QuestionList>
+                                <NoData v-if="orderLearnInfo.steps[stepIndex].item.length == 0" style="margin-top:30px;"></NoData>
+                                <QuestionList v-else :questions="orderLearnInfo.steps[stepIndex].item"></QuestionList>
                             </div>
                         </div>
                     </div>
                 </Split>
-
-
             </div>
-
-
         </div>
+        <Modal v-model="addStepStatus"
+               title="添加学习阶段"
+               class="dark-iview-modal dark-iview-input"
+               @on-ok="confirmAddStep">
+            <span>名称:</span>
+            <Input v-model="newStepName" placeholder="请输入名称..." style="width: calc(100% - 50px);" />
+        </Modal>
     </div>
 </template>
 <script>
     import NoData from '@/common/NoData.vue'
-    import JSONPath from 'jsonpath'
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
     import ChooseContent from '@/components/learnactivity/ChooseContent.vue'
+    import ManageUnit from "./ManageUnit.vue"
     export default {
         components: {
             NoData,
             QuestionList,
-            ChooseContent
+            ChooseContent,
+            ManageUnit
         },
         data() {
             return {
+                newStepName:'',
+                addStepStatus: false,
                 currentView: 0,
                 split1: 0.2,
                 currentCreateType: 0,
-                value: '',
-                currentContentInfo: {},
-                contentIndex: 0,
-                subjectList: [],
+                stepIndex: 0,
                 classroomList: [],
                 columns: [
                     {
@@ -145,49 +160,42 @@
                 ],
                 orderLearnInfo: {
                     name: '',
-                    subject: '',
+                    periodCode: '',
+                    subjectCode:'',
                     target: [],
-                    isPass: '',
-                    notice: '',
-                    content: [
-                        {
-                            name: "一次函数导入",
-                            files: [],
-                            questions: []
-                        },
-                        {
-                            name: "一次函数基础fsdfas fdsffg fd sgdfs gdhfgjgh ",
-                            files: [],
-                            questions: []
-                        },
-                        {
-                            name: "一次函数中阶",
-                            files: [],
-                            questions: []
-                        },
-                        {
-                            name: "一次函数高阶",
-                            files: [],
-                            questions: []
-                        },
-                        {
-                            name: "一次函数总结",
-                            files: [],
-                            questions: []
-                        }
-                    ]
+                    isOrder: '',
+                    creator:'',
+                    introduce: '',
+                    type:'',
+                    steps: []
                 }
             }
         },
         methods: {
+            chooseUnit(data) {
+                this.orderLearnInfo.steps.push(data)
+            },
+            confirmAddStep() {
+                this.orderLearnInfo.steps.push(
+                    {
+                        name: this.newStepName,
+                        resource: [],
+                        item:[]
+                    }
+                )
+                this.newStepName = ''
+            },
+            saveData() {
+                this.addStepStatus = true
+            },
             getSelectedQuestion(data) {
-                this.orderLearnInfo.content[this.contentIndex].questions.push(data.question)
+                this.orderLearnInfo.steps[this.stepIndex].item.push(data.question)
             },
             cancelFile(data) {
-                this.orderLearnInfo.content[this.contentIndex].files = data.files
+                this.orderLearnInfo.steps[this.stepIndex].resource = data.files
             },
             getSelectFile(data) {
-                this.orderLearnInfo.content[this.contentIndex].files.push(data.file)
+                this.orderLearnInfo.steps[this.stepIndex].resource.push(data.file)
             },
             setCurrentView(index) {
                 this.currentView = index
@@ -196,26 +204,26 @@
                 this.currentCreateType = index
             },
             addContent() {
-                this.contentIndex = (++this.contentIndex) % 5
+                this.stepIndex = (++this.stepIndex) % 5
             },
             setClassName(row, index) {
-                if (index == this.contentIndex) {
+                if (index == this.stepIndex) {
                     return 'ivu-table-row-highlight'
                 }
             },
             getCurrentItem(row, index) {
-                this.contentIndex = index
+                this.stepIndex = index
                 this.currentView = 0
             },
             dragOrder(index1, index2) {
                 if (index1 > index2) {
-                    let item = this.orderLearnInfo.content[index1];
-                    this.orderLearnInfo.content.splice(index1, 1);
-                    this.orderLearnInfo.content.splice(index2, 0, item);
+                    let item = this.orderLearnInfo.steps[index1];
+                    this.orderLearnInfo.steps.splice(index1, 1);
+                    this.orderLearnInfo.steps.splice(index2, 0, item);
                 } else if (index1 < index2) {
-                    let item = this.orderLearnInfo.content[index1];
-                    this.orderLearnInfo.content.splice(index2, 0, item);
-                    this.orderLearnInfo.content.splice(index1, 1);
+                    let item = this.orderLearnInfo.steps[index1];
+                    this.orderLearnInfo.steps.splice(index2, 0, item);
+                    this.orderLearnInfo.steps.splice(index1, 1);
                 }
             }
         }

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

@@ -30,6 +30,7 @@
 
         .unit-list-item {
             width: 100%;
+            cursor:pointer;
             padding: 10px 10px 10px 0px;
             color: white;
             border-bottom: 1px solid @borderColor;

+ 116 - 14
TEAMModelOS/ClientApp/src/view/selflearning/ManageUnit.vue

@@ -1,26 +1,28 @@
 <template>
     <div class="manage-unit-container">
-        <div class="unit-list-wrap">
+        <div class="unit-list-wrap" :style="{'padding-left':type==1 ? '15px':'0px' }">
             <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>
+                <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>
+                <span v-if="type == 1" class="unit-main-action" @click="editUnit"><Icon type="ios-create-outline" size="20"/>编辑内容</span>
+                <span v-if="type == 1" class="unit-main-action"><Icon type="ios-send" size="20" />发布内容</span>
+                <span v-if="type == 0" class="unit-main-action" @click="chooseUnit"><Icon type="md-checkmark" size="20" style="margin-right:5px;"/>选择</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">
+                        <Loading v-show="isLoading"></Loading>
+                        <div v-show="!isLoading" :class="isLoading ? 'content-file-item':'content-file-item animated fadeIn'" 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" />
@@ -36,65 +38,161 @@
                             <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="删除"/>
+                                <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>
+                        <NoData v-if="unitList[currentUnitIndex].length == 0" style="margin-top:120px;"></NoData>
+                        <Loading v-show="isLoading"></Loading>
+                        <QuestionList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :questions="unitList[currentUnitIndex].item"></QuestionList>
+
                     </div>
-                    
+
                 </vuescroll>
             </div>
         </div>
+        <Modal v-model="editUnitStatus"
+               title="编辑最小单元"
+               @on-ok="confirmEdit">
+            <p>确认跳转到最小单元编辑页面?</p>
+        </Modal>
     </div>
 </template>
 <script>
     import NoData from '@/common/NoData.vue'
+    import Loading from '@/common/Loading.vue'
+    import QuestionList from '@/components/learnactivity/QuestionList.vue'
     export default {
+        props: {
+            type: {
+                default:1
+            }
+        },
         components: {
-            NoData
+            NoData,
+            QuestionList,
+            Loading
         },
         data() {
             return {
+                editUnitStatus: false,
+                isLoading: false,
                 unitList: [],
                 currentUnitIndex:0
             }
         },
         methods: {
+            chooseUnit() {
+                this.$emit('chooseUnit',this.unitList[this.currentUnitIndex])
+            },
+            confirmEdit() {
+                let unitInfo = this.unitList[this.currentUnitIndex]
+                this.$router.push({
+                    name: 'createLearnUnit',
+                    params: {
+                        unitInfo
+                    }
+                })
+            },
+            editUnit() {
+                this.editUnitStatus = true
+            },
+            /**
+             * 列表选择
+             * @param index
+             */
             selectUnit(index) {
                 this.currentUnitIndex = index
                 this.findResourceById()
+                this.findQuestionById()
+            },
+            /**
+             * 通过id查询题目信息
+             * */
+            findQuestionById() {
+                if (this.unitList.length > 0) {
+                    this.isLoading = true
+                    if (!this.unitList[this.currentUnitIndex].requestedI) {
+                        this.$api.learnActivity.FindQuestionById(this.unitList[this.currentUnitIndex].item).then(
+                            res => {
+                                if (res.error == null) {
+                                    //if (res.result.data.length == this.unitList[this.currentUnitIndex].resource.length) {
+                                    this.unitList[this.currentUnitIndex].item.length = 0
+                                    this.$set(this.unitList[this.currentUnitIndex],'item',res.result.data)
+                                    //this.unitList[this.currentUnitIndex].item = res.result.data
+                                    this.unitList[this.currentUnitIndex].requestedI = true
+                                    //} else {
+                                    //    this.$Message.error("数据错误")
+                                    //}
+                                    console.log(this.unitList)
+                                } else {
+                                    this.$Message.error("API ERROR!")
+                                    setTimeout(() => {
+                                        this.isLoading = false
+                                    }, 500)
+                                }
+                            },
+                            err => {
+                                this.$Message.error("API ERROR!")
+                                setTimeout(() => {
+                                    this.isLoading = false
+                                },500)
+                            }
+                        )
+                    }else {
+                        setTimeout(() => {
+                            this.isLoading = false
+                        }, 200)
+                    }
+                }
             },
+            /**
+             * 通过id查询内容信息
+             * */
             findResourceById() {
                 if (this.unitList.length > 0) {
-                    if (!this.unitList[this.currentUnitIndex].requested) {
+                    this.isLoading = true
+                    if (!this.unitList[this.currentUnitIndex].requestedR) {
+
                         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
+                                    this.unitList[this.currentUnitIndex].requestedR = true
                                     //} else {
                                     //    this.$Message.error("数据错误")
                                     //}
                                 } else {
                                     this.$Message.error("API ERROR!")
                                 }
+                                setTimeout(() => {
+                                    this.isLoading = false
+                                }, 500)
                             },
                             err => {
                                 this.$Message.error("API ERROR!")
+                                setTimeout(() => {
+                                    this.isLoading = false
+                                }, 500)
                             }
                         )
                     } else {
-                        this.$Message.info("已经通过id请求过数据!")
+                        setTimeout(() => {
+                            this.isLoading = false
+                        }, 200)
                     }
                 }
             },
+            /**
+             * 查询最小单元列表
+             * */
             getUnit() {
+                this.isLoading = true
                 let requestData = {
                     scopeCode: this.$store.state.schoolBaseInfo.demoLoginInfo.TEAMModelId
                 }
@@ -104,6 +202,7 @@
                             this.unitList = res.result.data
                             if (this.unitList.length > 0) {
                                 this.findResourceById()
+                                this.findQuestionById()
                             }
                         } else {
                             this.$Message.error('API ERROR!')
@@ -125,4 +224,7 @@
     @import "./ManageUnit.less";
 </style>
 <style lang="less">
+    .unit-content-detail #loadingBox {
+        margin-top: 88px !important;
+    }
 </style>