Sfoglia il codice sorgente

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

liqk 4 anni fa
parent
commit
d54b5ac32f

+ 6 - 1
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/paper-test.css

@@ -53,8 +53,13 @@
     padding: 2px 5px;
 }
 .select-item{
+   color: white;
     background-color:#00ac60 !important;
-} 
+}
+.wrong-item{
+   color: white;
+   background-color:#ff5508 !important;
+}
 .lesson-test-pop .testTitle {
     background-color: #ffffff;
     color: #24b880;

+ 1 - 0
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.vue

@@ -277,6 +277,7 @@
 				} else {
 					this.collapseList = [...this.exerciseList.keys()];
 				}
+				console.log(this.collapseList)
 			},
 
 			/**

+ 1 - 1
TEAMModelOS/ClientApp/src/components/selflearn/ExerciseList.vue

@@ -193,7 +193,7 @@ export default {
             filterGrade: [false],
             filterSubject: [false],
             totalNum: 0,
-            pageSize: 20,
+            pageSize: 10,
             pageNum: 1,
             currentPage: 1,
             collapseList: [],

+ 54 - 22
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue

@@ -9,10 +9,10 @@
                 {{$t("studentWeb.exam.report.anwser")}}
             </span>
             <h4 v-show='testState == 2'>{{$t("studentWeb.exam.report.noRes")}}</h4>
-            <Row :gutter="20" v-if='testState == 3'>
+            <!-- <Row :gutter="20" v-if='testState == 3'>
                 <i-col :xs="24" :sm="24" :md="24" :lg="12">
                     <Row :gutter="20">
-                        <!-- 得分 -->
+                        得分
                         <i-col :xs="24" :sm="24" :md="12" :lg="12">
                             <Card class="score-card">
                                 <p class="card-title">{{$t('studentWeb.exam.score')}}</p>
@@ -21,7 +21,7 @@
                                 </div>
                             </Card>
                         </i-col>
-                        <!-- 难易度 -->
+                        难易度
                         <i-col :xs="24" :sm="24" :md="12" :lg="12">
                             <Card class="score-card">
                                 <p class="card-title">{{$t('studentWeb.exam.difficulty')}}</p>
@@ -33,7 +33,7 @@
                         </i-col>
                     </Row>
                     <Row :gutter="20">
-                        <!-- 班平均分 -->
+                        班平均分
                         <i-col :xs="24" :sm="24" :md="12" :lg="12">
                             <Card class="score-card">
                                 <p class="card-title">{{$t('studentWeb.exam.average')}}</p>
@@ -42,7 +42,7 @@
                                 </div>
                             </Card>
                         </i-col>
-                        <!-- 得分题目数 -->
+                        得分题目数
                         <i-col :xs="24" :sm="24" :md="12" :lg="12">
                             <Card class="score-card">
                                 <p class="card-title">{{$t("studentWeb.exam.report.getScore")}}</p>
@@ -51,7 +51,7 @@
                                 </div>
                             </Card>
                         </i-col>
-                        <!-- 知识点 -->
+                        知识点
                         <i-col :xs="24" :sm="24" :md="24" :lg="24" style="display:none">
                             <Card class="comment-card">
                                 <p class="card-title">{{$t('studentWeb.exam.smartComment')}}</p>
@@ -72,6 +72,54 @@
                         <LessonTestReportCharts></LessonTestReportCharts>
                     </Card>
                 </i-col>
+            </Row> -->
+            <Row :gutter="20" v-if='testState == 3'>
+                <i-col :xs="24" :sm="24" :md="24" :lg="24">
+                    <Row :gutter="20">
+                        <!-- 得分 -->
+                        <i-col :xs="24" :sm="24" :md="12" :lg="6">
+                            <Card class="score-card">
+                                <p class="card-title">{{$t('studentWeb.exam.score')}}</p>
+                                <div class="card-content">
+                                    <span class="myscore">{{testScore}}</span> / {{ paperInfo.score }}
+                                </div>
+                            </Card>
+                        </i-col>
+                        <!-- 难易度 -->
+                        <i-col :xs="24" :sm="24" :md="12" :lg="6">
+                            <Card class="score-card">
+                                <p class="card-title">{{$t('studentWeb.exam.difficulty')}}</p>
+                                <div class="difficulty-rate">
+                                    <Rate class allow-half disabled v-model="difficultyRate" />
+                                    <span class="difficulty-rate-num">{{difficultyRate }}</span>
+                                </div>
+                            </Card>
+                        </i-col>
+                        <!-- 班平均分 -->
+                        <i-col :xs="24" :sm="24" :md="12" :lg="6">
+                            <Card class="score-card">
+                                <p class="card-title">{{$t('studentWeb.exam.average')}}</p>
+                                <div class="card-content">
+                                    <span class="myscore">--</span>
+                                </div>
+                            </Card>
+                        </i-col>
+                        <!-- 得分题目数 -->
+                        <i-col :xs="24" :sm="24" :md="12" :lg="6">
+                            <Card class="score-card">
+                                <p class="card-title">{{$t("studentWeb.exam.report.getScore")}}</p>
+                                <div class="card-content">
+                                    <span class="myscore">{{rightAns.right}}</span> / {{rightAns.all}}
+                                </div>
+                            </Card>
+                        </i-col>
+                    </Row>
+                </i-col>
+                <i-col :xs="24" :sm="24" :md="24" :lg="24">
+                    <!-- <Card class="chart-card"> -->
+                        <LessonTestReportCharts></LessonTestReportCharts>
+                    <!-- </Card> -->
+                </i-col>
             </Row>
         </div>
         <div class="QAsheet" v-if='testState != 1'>
@@ -90,22 +138,6 @@
                         {{$t("studentWeb.exam.report.noScore")}}: {{rightAns.noAns}}
                     </Checkbox>
                 </CheckboxGroup>
-                
-                <!-- <label class="checkAns">
-                    <input type="checkbox" value="right" v-model="checkedAns" />
-                    <span>{{$t("studentWeb.exam.report.right")}}: {{rightAns.right}}</span>
-                    <div class="rightBtn"></div>
-                </label>
-                <label class="checkAns">
-                    <input type="checkbox" value="wrong" v-model="checkedAns" />
-                    <span>{{$t("studentWeb.exam.report.wrong")}}: {{ examInfo.stuScore.length - rightAns.right - rightAns.noAns}}</span>
-                    <div class="wrongBtn"></div>
-                </label>
-                <label class="checkAns" v-show=" rightAns.noAns != 0 ">
-                    <input type="checkbox" value="noAns" v-model="checkedAns" />
-                    <span>{{$t("studentWeb.exam.report.noScore")}}: {{ rightAns.noAns}}</span>
-                    <div class="noAnsBtn"></div>
-                </label> -->
                 <svg-icon icon-class="AnsWerDetail" :class="{ ansDetail: !closeAnsDetail, closeAnsDetail: closeAnsDetail,}" />
                 <button :class="['wrong-exercises', rightAns.wrong != 0 ? 'wrong' : 'nowrong']" @click="showTest">
                     {{$t("studentWeb.exam.report.wrongPractice")}}

+ 21 - 4
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReportCharts/LessonTestReportCharts.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="lessontest-report-charts">
-    <Carousel
+    <!-- <Carousel
       v-model="value2"
       :autoplay="setting.autoplay"
       :dots="setting.dots"
@@ -8,11 +8,28 @@
       :trigger="setting.trigger"
       :arrow="setting.arrow"
     >
-      <CarouselItem class="demo-carousel"><ScoreBarChart></ScoreBarChart></CarouselItem>
+      <CarouselItem class="demo-carousel"><ScoreBarChart></ScoreBarChart></CarouselItem> -->
       <!-- 知识点的类型在LessonTestReport 的 paperInfo.points -->
-      <CarouselItem class="demo-carousel"><KeyPointPerformChart></KeyPointPerformChart></CarouselItem>
+      <!-- <CarouselItem class="demo-carousel"><KeyPointPerformChart></KeyPointPerformChart></CarouselItem>
       <CarouselItem class="demo-carousel"><RecognizePerformChart></RecognizePerformChart></CarouselItem>
-    </Carousel>
+    </Carousel> -->
+    <Row :gutter="20">
+      <i-col :xs="24" :sm="24" :md="24" :lg="8">
+        <Card>
+          <ScoreBarChart></ScoreBarChart>
+        </Card>
+      </i-col>
+      <i-col :xs="24" :sm="24" :md="24" :lg="8">
+        <Card>
+          <KeyPointPerformChart></KeyPointPerformChart>
+        </Card>
+      </i-col>
+      <i-col :xs="24" :sm="24" :md="24" :lg="8">
+        <Card>
+          <RecognizePerformChart></RecognizePerformChart>
+        </Card>
+      </i-col>
+    </Row>
   </div>
 </template>
 

+ 4 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperTest.vue

@@ -65,7 +65,7 @@
                 <span class="myTestProgresstitle">{{$t("studentWeb.exam.testpop.completion")}}</span>
                 <Progress style="margin-top:15px" :percent="completeRate" />
             </div>
-            <button v-if="closeTest" class="submitBtn" @click="openWarmMessage(2)" :class="{ hintClick:hintHandon() }">{{isWrong ? $t("studentWeb.exam.testpop.submitted1") : $t("studentWeb.exam.testpop.submitted")}}</button>
+            <button v-if="closeTest" class="submitBtn" @click="openWarmMessage(isWrong ? 4 : 2)" :class="{ hintClick:hintHandon() }">{{isWrong ? $t("studentWeb.exam.testpop.submitted1") : $t("studentWeb.exam.testpop.submitted")}}</button>
             <button v-if="!closeTest" class="submitBtn" :class="{ hintClick:hintHandon()  }">{{$t("studentWeb.exam.testpop.finish")}}</button>
         </div>
         <Row :gutter="30">
@@ -200,7 +200,7 @@
                     <div class="que-box">
                         <div v-for="(item,index) in examInfo" :key="index"
                              @click="gototheQues(index +1)"
-                             :class="[(checkers[index] && checkers[index].length > 0) ? 'has-ans':'ans-box',index == queNo ?'select-item':'']">
+                             :class="[(checkers[index] && checkers[index].length > 0) ? 'has-ans':'ans-box',index == queNo ? 'select-item' :'']">
                             <span style="padding:5px 5px;cursor:pointer"> {{ item.parent == undefined ? index +1 : item.paperIndex }}</span>
                         </div>
                     </div>
@@ -475,6 +475,8 @@
                             this.showMessageNum = 2
                         }
                     }
+                } else if (showMessageNum == 4) {
+                    this.showMessageNum = 4
                 } else return;
             },
             //关闭提示信息

+ 5 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/settings.js

@@ -44,8 +44,8 @@ export default {
 	status1:'已加入',
 	status2:'收到邀请',
 	status3:'申请中',
-	openList: '开放平台列表',
-	openInfo: '平台信息',
+	openList: '开放平台应用列表',
+	openInfo: '应用信息',
 	openName: '应用名称',
 	opName: "开放平台应用",
 	token: 'ApiToken',
@@ -58,6 +58,7 @@ export default {
 	apiMethod: '请求方法',
 	apiParams: '参数示例',
 	openKeep: '保存平台',
+	edit: "编辑应用",
 	unedit: '取消编辑',
 	delModal1: "您确定删除",
 	delModal2: "吗?",
@@ -68,6 +69,8 @@ export default {
 	keepModal2: "保存失败",
 	refreshModal1: "刷新成功",
 	refreshModal2: "刷新失败",
+	refreshModal3: "刷新后,原有的金钥会失效,您确定要刷新吗?",
+	refreshModal4: "已取消刷新",
 	copyModal1: "复制成功",
 	copyModal2: "复制失败",
 	openModal1: "应用列表获取失败",

+ 1 - 0
TEAMModelOS/ClientApp/src/utils/blobTool.js

@@ -472,6 +472,7 @@ export default class BlobTool {
      * 2、目标url(sourceUrl)如果需要授权的容器,则url需要凭借授权。
      */
     copyBlob(targetUrl, sourceUrl, sas) {
+		console.log(...arguments)
         return new Promise((r, j) => {
             let newBlob = this.containerClient.getBlobClient(targetUrl)
             let encodeUrl = encodeURI(sourceUrl)

+ 6 - 2
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.css

@@ -45,7 +45,7 @@
 .open-mgmt .open-mgmt-right .open-action {
   display: flex;
 }
-.open-mgmt .open-mgmt-right .open-action > div:first-child {
+.open-mgmt .open-mgmt-right .open-action:nth-of-type(2) > div:first-child {
   margin-right: 20px;
 }
 .open-mgmt .open-mgmt-right .open-action > div > span {
@@ -101,7 +101,11 @@
 }
 .open-mgmt .open-mgmt-right .open-right-info .open-api .open-api-table {
   padding: 20px;
-  /* .ivu-checkbox-inner{
+  /* .ivu-table-wrapper{
+                        box-shadow: 0px 0px 10px 2px #ccc;
+                    }
+
+                    .ivu-checkbox-inner{
                         background-color: white;
                     } */
 }

+ 11 - 4
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.less

@@ -59,7 +59,7 @@
         .open-action{
             display: flex;
 
-            & > div:first-child{
+            &:nth-of-type(2) > div:first-child{
                 margin-right: 20px;
                 
             }
@@ -126,7 +126,6 @@
             
             .open-api{
                 width: 70%;
-                // padding: 20px 20px 20px 20px;
 
                 .open-api-header{
                     height: 40px;
@@ -135,7 +134,11 @@
                 .open-api-table{
                     padding: 20px;
 
-                    /* .ivu-checkbox-inner{
+                    /* .ivu-table-wrapper{
+                        box-shadow: 0px 0px 10px 2px #ccc;
+                    }
+
+                    .ivu-checkbox-inner{
                         background-color: white;
                     } */
                 }
@@ -164,16 +167,20 @@
     }
 }
 
-.open-list,
+.open-list/* {
+    border-bottom: 1px solid #e1e1e1;
+} */,
 .open-header,
 .open-info-header,
 .open-api-header{
     border-bottom: 1px solid #424242;
+    // border-bottom: 1px solid #909090;
 }
 
 .open-mgmt-left,
 .open-info{
     border-right: 1px solid #424242;
+    // border-right: 1px solid #909090;
 }
 
 .open-header,

+ 123 - 108
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.vue

@@ -6,12 +6,10 @@
             <div class="open-header">
                 <span>{{ $t("settings.openList") }}</span>
                 <div class="open-action">
+                    <!-- <Icon type="md-add" size="18" style="margin-right: 10px" color="rgb(115 115 115)" @click="editOpen(true, true)" /> -->
                     <Icon type="md-add" size="18" style="margin-right: 10px" color="#0094FF" @click="editOpen(true, true)" />
-                    <!-- <Icon type="ios-add" size="18" style="margin-right: 10px" color="#0094FF" @click="editOpen(true, true)" /> -->
-                    <Icon type="ios-create" size="18" style="margin-right: 10px" color="#0094FF" @click="editOpen(true, false)" />
-                    <!-- <Icon type="ios-create-outline" size="18" style="margin-right: 10px" color="#0094FF" @click="editOpen(true, false)" /> -->
+                    
                     <Icon type="md-trash" size="18" color="#0094FF" @click="delOpen" />
-                    <!-- <Icon type="ios-trash-outline" size="18" color="#0094FF" @click="delOpen" /> -->
                 </div>
             </div>
             <vuescroll>
@@ -30,6 +28,12 @@
         <div class="open-mgmt-right">
             <div class="open-header">
                 <span>{{ $t("settings.openInfo") }}</span>
+                <div class="open-action" @click="editOpen(true, false)" v-show="!isEdit">
+                    <div>
+                        <Icon type="ios-create" size="18" color="#0094FF" />
+                        <span>{{ $t("settings.edit") }}</span>
+                    </div>
+                </div>
                 <div class="open-action" v-show="isEdit">
                     <div @click="keepMgmt(true)">
                         <Icon type="md-checkmark-circle" size="18" color="#0094FF" />
@@ -61,6 +65,9 @@
                                     </FormItem>
                                     <FormItem :label="$t('settings.token')" class="api-token" v-show="!isEdit">
                                         <div class="api-icon">
+                                            <!-- 隐藏 -->
+                                            <Icon :type="isTokenShow ? 'md-eye' : 'md-eye-off'" size="18" style="margin-right: 10px" color="#0094FF" @click="isTokenShow = !isTokenShow" />
+                                            <!-- <Icon type="md-eye" size="18" style="margin-right: 10px" color="#0094FF" /> -->
                                             <!-- 刷新 -->
                                             <Icon type="md-refresh" size="18" style="margin-right: 10px" color="#0094FF" @click="refresh" />
                                             <!-- 复制 -->
@@ -69,9 +76,10 @@
                                         <Input
                                             v-model="openMgInfo.token"
                                             type="textarea"
-                                            :autosize="{ minRows: 2 }"
+                                            :autosize="{ minRows: 10 }"
                                             class="open-info-disabled"
                                             readonly
+                                            v-show="isTokenShow"
                                         ></Input>
                                     </FormItem>
                                     <FormItem :label="$t('settings.des')">
@@ -122,6 +130,7 @@ export default {
         return {
             isLoading: false,
             isLoadList: false,
+            isTokenShow: false,
             schoolCode: this.$store.state.userInfo.schoolCode,
             openList: [], //开放平台列表
             openMgInfo: {}, //平台信息
@@ -197,25 +206,9 @@ export default {
                             list.sort((a, b) => {
                                 return a.auth - b.auth
                             })
-                            // 根据当前应用已有的auths,在list 加上_checked
-                            /* if(this.openMgInfo.auths.length > 0) {
-                                list.map(item => {
-                                    this.openMgInfo.auths.map(items => {
-                                        if(item.auth == items) {
-                                            this.apiListNow.push({...item})
-                                            item._checked = true
-                                        }
-                                    })
-                                })
-                            } */
                         }
                         this.apiList = list
                         this.selectApi()
-                        /* if(this.apiListNow.length > 0) {
-                            this.apiListNow.map(item => {
-                                item._disabled = true
-                            })
-                        } */
                     }
                 }, err => {
                     this.$Message.warning(this.$t('settings.openModal2'))
@@ -224,76 +217,6 @@ export default {
                     }, 1000)
             })
         },
-        // 编辑、新增
-        editOpen (isEdit, isAdd) {
-            this.apiListCol.unshift({
-                type: 'selection',
-                width: 80,
-                align: 'center',
-            })
-            this.isEdit = isEdit
-            this.isAdd = isAdd
-            // 新增
-            if(isAdd) {
-                var defaultInfo = {
-                    auths: [],
-                    code: this.schoolCode,
-                    descr: null,
-                    name: this.$t('settings.opName'),
-                    school: this.schoolCode,
-                    status: 0,
-                }
-                this.openList.unshift(defaultInfo)
-                this.openMgInfo = defaultInfo
-                this.nowIndex = 0
-                this.apiListSelect = this._.cloneDeep(this.apiList)
-            }
-        },
-        // 删除应用
-        delOpen () {
-            var titWord = this.$t("settings.delModal1") + this.openMgInfo.name + this.$t("settings.delModal2")
-            this.$Modal.confirm({
-                title: `${titWord}`,
-                onOk: () => {
-                    let req = {
-                        id: this.openMgInfo.id,
-                        code: this.schoolCode
-                    }
-                    this.$api.openMgmt.delOpen(req).then(
-                        res => {
-                            this.openList.splice(this.nowIndex, 1)
-                            if(this.openList.length == this.nowIndex) {
-                                this.nowIndex = 0
-                            }
-                            this.openMgInfo = this._.cloneDeep(this.openList[this.nowIndex])
-                            this.selectApi()
-                            this.$Message.success(this.$t('settings.delModal3'))
-                        }, err => {
-                            this.$Message.error(this.$t('settings.delModal4'))
-                            setTimeout(() => {
-                                this.isLoading = false
-                            }, 1000)
-                        }
-                    )
-                },
-                onCancel: () => {
-                    this.$Message.info(this.$t('settings.delModal5'));
-                },
-            })
-        },
-        list (index) {
-            if(index != this.nowIndex) {
-                // this.getApiList()
-                this.nowIndex = index
-                var info = this.openList[index]
-                this.openMgInfo = info
-                if(this.isEdit) {
-                    this.isEdit = !this.isEdit
-                    this.apiListCol.splice(0, 1)
-                }
-                this.selectApi()
-            }
-        },
         // 筛选出该应用已有的api
         selectApi() {
             this.apiListNow = []
@@ -312,6 +235,90 @@ export default {
             }
             this.apiListSelect = listSel
         },
+        // 编辑、新增
+        editOpen (isEdit, isAdd) {
+            this.isTokenShow = false
+            if(this.isEdit) {
+                return
+            } else {
+                this.apiListCol.unshift({
+                    type: 'selection',
+                    width: 80,
+                    align: 'center',
+                })
+                this.isEdit = isEdit
+                this.isAdd = isAdd
+                // 新增
+                if(isAdd) {
+                    var defaultInfo = {
+                        auths: [],
+                        code: this.schoolCode,
+                        descr: null,
+                        name: this.$t('settings.opName'),
+                        school: this.schoolCode,
+                        status: 0,
+                    }
+                    this.openList.unshift(defaultInfo)
+                    this.openMgInfo = defaultInfo
+                    this.nowIndex = 0
+                    this.apiListSelect = this._.cloneDeep(this.apiList)
+                }
+            }
+        },
+        // 删除应用
+        delOpen () {
+            if(this.isEdit) {
+                return
+            } else {
+                var titWord = this.$t("settings.delModal1") + this.openMgInfo.name + this.$t("settings.delModal2")
+                this.$Modal.confirm({
+                    title: `${titWord}`,
+                    onOk: () => {
+                        let req = {
+                            id: this.openMgInfo.id,
+                            code: this.schoolCode
+                        }
+                        this.$api.openMgmt.delOpen(req).then(
+                            res => {
+                                this.openList.splice(this.nowIndex, 1)
+                                if(this.openList.length == this.nowIndex) {
+                                    this.nowIndex = 0
+                                }
+                                this.openMgInfo = this._.cloneDeep(this.openList[this.nowIndex])
+                                this.selectApi()
+                                this.isTokenShow = false
+                                this.$Message.success(this.$t('settings.delModal3'))
+                            }, err => {
+                                this.$Message.error(this.$t('settings.delModal4'))
+                                setTimeout(() => {
+                                    this.isLoading = false
+                                }, 1000)
+                            }
+                        )
+                    },
+                    onCancel: () => {
+                        this.$Message.info(this.$t('settings.delModal5'));
+                    },
+                })
+            }
+        },
+        list (index) {
+            if(index != this.nowIndex) {
+                this.isTokenShow = false
+                if(this.isEdit) {
+                    if(this.isAdd) {
+                        this.openList.splice(0, 1)
+                        index = index - 1
+                    }
+                    this.isEdit = !this.isEdit
+                    this.apiListCol.splice(0, 1)
+                }
+                this.nowIndex = index
+                var info = this._.cloneDeep(this.openList[index])
+                this.openMgInfo = info
+                this.selectApi()
+            }
+        },
         // 保存平台信息
         keepMgmt (type) {
             // this.isEdit = type
@@ -341,16 +348,9 @@ export default {
                         if (res) {
                             console.log(res.app);
                             this.openMgInfo = res.app
-                            if(this.isAdd) {
-                                this.refresh()
-                            }
+                            this.refreshToken()
                             this.getOpenList()
                             this.selectApi()
-                            /* this.apiListNow.map(item => {
-                                if(!item._disabled) {
-                                    item._disabled = true
-                                }
-                            }) */
                             this.$Message.success(this.$t('settings.keepModal1'));
                         }
                     }, err => {
@@ -369,6 +369,19 @@ export default {
         },
         // 刷新token
         refresh() {
+            if(this.isTokenShow) {
+                this.$Modal.confirm({
+                    title: this.$t('settings.refreshModal3'),
+                    onOk: () => {
+                        this.refreshToken()
+                    },
+                    onCancel: () => {
+                        this.$Message.info(this.$t('settings.refreshModal4'));
+                    },
+                })
+            }
+        },
+        refreshToken() {
             let req = {
                 id: this.openMgInfo.id,
                 code: this.openMgInfo.school
@@ -390,15 +403,17 @@ export default {
             })
         },
         copyToken() {
-            var that = this;
-            this.$copyText(this.openMgInfo.token).then(
-                function(e) {
-                    that.$Message.success(that.$t('settings.copyModal1'));
-                },
-                function(e) {
-                    that.$Message.error(that.$t('settings.copyModal2'));
-                }
-            );
+            if(this.isTokenShow) {
+                var that = this;
+                this.$copyText(this.openMgInfo.token).then(
+                    function(e) {
+                        that.$Message.success(that.$t('settings.copyModal1'));
+                    },
+                    function(e) {
+                        that.$Message.error(that.$t('settings.copyModal2'));
+                    }
+                );
+            }
         },
         selectionChange(selection) {
             /* selection.map(item => {

+ 2 - 0
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.less

@@ -55,6 +55,7 @@
 			color: #bdbdbd;
 			position: relative;
 			
+			
 			&::before {
 				content: '';
 				display: inline-block;
@@ -105,6 +106,7 @@
 						font-size: 16px;
 						font-weight: bold;
 						margin: 10px 0;
+						padding-right: 10px;
 					}
 					&-info{
 						span{

+ 159 - 75
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -19,12 +19,19 @@
 		<div class="syllabus-content">
 			<div class="syllabus-left">
 				<div class="syllabus-content-header">
-					<span>册别清单</span>
-					<span class="syllabus-content-header-tools">
-						<Icon type="md-create" @click="doEditVolume" />
-						<Icon type="md-trash" @click="doDeleteVolume" />
-						<Icon type="md-add" @click="doAddVolume" />
-					</span>
+					<div v-if="!isSearchVolume">
+						<span>册别清单</span>
+						<span class="syllabus-content-header-tools">
+							<Icon type="md-search" @click="doSearchVolume" />
+							<Icon type="md-create" @click="doEditVolume" />
+							<Icon type="md-trash" @click="doDeleteVolume" />
+							<Icon type="md-add" @click="doAddVolume" />
+						</span>
+					</div>
+					<div style="width: 90%;" v-else>
+						<Input v-model="searchVolumeVal"  placeholder="输入册别名称..." 
+						icon="ios-close-circle-outline" @on-click="onCloseSearch" @on-change="onSearchChange"/>
+					</div>
 				</div>
 				<vuescroll>
 					<EmptyData :top="100" v-if="!volumeList.length"></EmptyData>
@@ -60,7 +67,7 @@
 					<span>关联资源</span>
 					<span class="syllabus-content-header-tools">
 						<!-- <Icon type="md-add" @click="onAddResource" v-if="curNode.id"/> -->
-						<Dropdown @on-click="onAddResource">
+						<Dropdown @on-click="onAddResource" v-if="curNode.id">
 							<a href="javascript:void(0)" style="color: #ddd;">
 								添加资源
 								<Icon type="ios-arrow-down"></Icon>
@@ -182,7 +189,7 @@
 			<Button slot="footer" @click="onRelateContent" style="margin-bottom: 20px;" class="modal-btn">确认</Button>
 		</Modal>
 
-		<!-- 新增课纲节点弹窗 -->
+		<!-- 预览试题试卷弹窗 -->
 		<Modal v-model="isPreviewPaper" width="900" footer-hide class="tree-modal tree-paper-modal">
 			<div class="paper-box" v-if="previewPaper">
 				<p class="paper-title">{{ previewPaper.name }}</p>
@@ -194,7 +201,6 @@
 			<ExerciseList :propsList="questionList" ref="exList" isAnalysis></ExerciseList>
 		</Modal>
 
-
 		<!--文件预览-->
 		<div v-if="previewStatus" class="image-viewer">
 			<div style="width:fit-content;position:relative;margin:auto;">
@@ -218,6 +224,7 @@
 </template>
 
 <script>
+	import BlobTool from '@/utils/blobTool.js'
 	import Tree from "@/components/syllabus/DragTree";
 	import ChooseContent from '@/components/selflearn/NewChooseContent'
 	import ExerciseList from '@/components/evaluation/ExerciseList.vue'
@@ -229,14 +236,17 @@
 		},
 		data() {
 			return {
+				containerClient:null,
 				docType:['doc','docx'],
 				excelType:['xls','csv','xlsx'],
 				pptType:['ppt','pptx'],
 				folder: '',
+				searchVolumeVal:'',
 				isPreviewPaper: false,
 				previewStatus: false,
 				hasModify: false,
 				isLoading: false,
+				isSearchVolume: false,
 				isAddLoading: false,
 				isShowLinkModal: false,
 				isUploadModal: false,
@@ -253,6 +263,7 @@
 				subjectList: [],
 				semesterList: [],
 				volumeList: [],
+				originVolumeList:[],
 				questionList: [],
 				schoolInfo: null,
 				previewFile: {},
@@ -292,8 +303,13 @@
 		created() {
 			this.isSchool = this.$route.name === 'syllabus'
 			this.getSchoolInfo()
+			this.initBlobTool()
 		},
 		methods: {
+			async initBlobTool(){
+				let n = this.$route.name === 'syllabus'  ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
+				this.containerClient = new BlobTool(n.url, n.name, n.sas, this.curScope)
+			},
 			/* 获取学校基础信息 */
 			getSchoolInfo() {
 				this.$store.dispatch("user/getSchoolProfile").then((res) => {
@@ -339,6 +355,7 @@
 					if (!res.error) {
 						this.isLoading = false
 						this.volumeList = res.volumes.reverse()
+						this.originVolumeList = JSON.parse(JSON.stringify(this.volumeList))
 						res.volumes.length && this.onVolumeClick(res.volumes[0], 0)
 					} else {
 						this.$Message.warning(res.error);
@@ -366,6 +383,22 @@
 				this.isEditVolume = false
 				this.isAddVolumeModal = true
 			},
+			/* 搜索册别 */
+			doSearchVolume(){
+				this.isSearchVolume = true
+			},
+			/* 搜索词汇发生变化 */
+			onSearchChange(){
+				this.volumeList = this.originVolumeList.filter(i => i.name.indexOf(this.searchVolumeVal) > -1)
+				this.volumeList.length && this.onVolumeClick(this.volumeList[0], 0)
+			},
+			/* 关闭搜索 */
+			onCloseSearch(){
+				this.isSearchVolume = false
+				this.searchVolumeVal = ''
+				this.volumeList = JSON.parse(JSON.stringify(this.originVolumeList))
+				this.volumeList.length && this.onVolumeClick(this.volumeList[0], 0)
+			},
 			/* 编辑当前册别 */
 			doEditVolume() {
 				this.addVolumeForm = {
@@ -505,7 +538,7 @@
 						link: [file.url],
 						title: file.name,
 						type: file.type,
-						cntr: 'syllabus'
+						cntr: this.curCode
 					})
 				})
 				this.hasModify = true
@@ -513,29 +546,51 @@
 				this.$Message.success('上传成功')
 				console.log(result)
 			},
-			getFileUrl(val) {
-				console.log(val)
+			/* 获取关联的内容数据,需要进行相应的文件拷贝 */
+			async onSelectFile() {
+				return new Promise(async (r,j) => {
+					let list = this.$refs.chooseContentRef.selectedFiles
+					if(!list.length){
+						r(200)
+					}else{
+						let promiseArr = []
+						let privateSas = await this.$tools.getPrivateSas()
+						let schoolSas = await this.$tools.getSchoolSas()
+						let curResourceArr = this.$refs.treeRef.curNode.rnodes
+						for(let i = 0 ; i < list.length ; i++){
+							promiseArr.push(new Promise((r2,j2) => {
+								let file = list[i]
+								let sas = file.scope === 'school' ? schoolSas.sas : privateSas.sas
+								this.containerClient.copyBlob('syllabus/' + file.name,file.url,sas).then(res => {
+									curResourceArr.push({
+										type: file.type,
+										title: file.name,
+										id: this.$tools.guid(),
+										code: this.curCode,
+										scope: file.scope,
+										cntr: file.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
+											.userInfo.TEAMModelId,
+										link: [file.url]
+									})
+									r2(200)
+									
+								}).catch(err => {
+									console.log(err)
+									j2(err)
+								})
+							}))
+						}
+						Promise.all(promiseArr).then(result => {
+							r(200)
+						}).catch(err => {
+							console.log(err)
+							j(err)
+						})
+					}
+				})
+				
 			},
-			/* 关联内容 */
-			onSelectFile() {
-				let list = this.$refs.chooseContentRef.selectedFiles
-				console.log('关联的内容文件',list)
-				if(!list.length) return
-				// let curResourceArr = this.$refs.treeRef.curNode.rnodes
-				// list.forEach(i => {
-				// 	curResourceArr.push({
-				// 		type: 'item',
-				// 		title: i.question,
-				// 		id: i.id,
-				// 		code: i.code,
-				// 		scope: i.scope,
-				// 		cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
-				// 			.userInfo.TEAMModelId,
-				// 		link: [i.blob]
-				// 	})
-				// })
-			},
-			/* 关联题目 */
+			/* 获取关联的试题数据 */
 			onSelectQuestion(val) {
 				let list = this.$refs.chooseContentRef.$refs.exListRef.selectItems
 				if(!list.length) return
@@ -555,6 +610,7 @@
 					}
 				})
 			},
+			/* 获取关联的试卷数据 */
 			onSelectPaper(){
 				let list = this.$refs.chooseContentRef.$refs.paperListRef.checkedPaperList
 				if(!list.length) return
@@ -573,20 +629,20 @@
 						})
 					}
 				})
-				console.log(curResourceArr)
 			},
-			// 拿到当前选择的资源内容 进行节点关联
+			/* 点击确认 去获取关联的内容数据、试题试卷数据 */
 			onRelateContent() {
 				let curResourceArr = this.$refs.treeRef.curNode.rnodes
-				console.log(this.relateFiles)
-				console.log(this.$refs.treeRef.curNode)
-				this.onSelectFile()
-				this.onSelectQuestion()
-				this.onSelectPaper()
-				// this.$refs.treeRef.curNode.rnodes = this.relateFiles
-				console.log(curResourceArr)
-				this.isRelateContentModal = false
-				this.hasModify = true
+				this.onSelectFile().then(res => {
+					this.onSelectQuestion()
+					this.onSelectPaper()
+					// this.$refs.treeRef.curNode.rnodes = this.relateFiles
+					console.log(curResourceArr)
+					this.isRelateContentModal = false
+					this.hasModify = true
+				}).catch(err=> {
+					this.$Message.error(err)
+				})
 			},
 			/* 预览关联资源 */
 			async onPreview(item) {
@@ -602,6 +658,9 @@
 							blob: item.link[0],
 							scope: item.scope
 						}]
+						this.$nextTick(() => {
+							this.$refs.exList.collapseList = [0]
+						})
 						this.isPreviewPaper = true
 						break;
 					case 'paper':
@@ -614,6 +673,9 @@
 						let fullPaper = await this.$evTools.getFullPaper(paper)
 						this.previewPaper = fullPaper
 						this.questionList = fullPaper.item
+						this.$nextTick(() => {
+							this.$refs.exList.collapseList = [...this.questionList.keys()]
+						})
 						this.isPreviewPaper = true
 						break;
 					case 'link':
@@ -638,7 +700,7 @@
 						break;
 				}
 			},
-			
+			/* 点击试卷列表预览试卷 */
 			async onPreviewPaper(paper){
 				let fullPaper = await this.$evTools.getFullPaper(paper)
 				this.previewPaper = fullPaper
@@ -647,14 +709,7 @@
 			},
 			/* 打开PDF文件进行预览 */
 			async openPdf(url,name){
-				// let pdfFile = await this.$tools.getFile(url)
-				// window.open(pdfFile,'PDF','width:50%;height:50%;top:100;left:100;');
-				// let ele=document.createElement('a')//创建a标签
-				//  ele.download=name//下载名称
-				//  ele.target="_blank"//新标签
-				//  ele.href=url//地址
-				//  ele.click()//点击a标签实现跳转
-				//  ele.remove()//移除a标签
+				return
 			},
 			/* 删除关联资源 */
 			onDeleteResource(item, index) {
@@ -662,11 +717,45 @@
 					title: this.$t('settings.modalTip4'),
 					content: '确定要移除该资源吗?',
 					onOk: () => {
-						this.$refs.treeRef.curNode.rnodes.splice(index, 1)
-						this.hasModify = true
+						// 需要删除blob对应目录下的文件
+						if(this.needDeleteFile(item)){
+							this.isLoading = true
+							this.deleteBlobPrefix(item).then(r => {
+								this.$Message.success(this.$t('evaluation.deleteSuc'))
+								this.$refs.treeRef.curNode.rnodes.splice(index, 1)
+								this.hasModify = true
+							}).catch(err => {
+								this.$Message.error(err)
+							}).finally(() => {
+								this.isLoading = false
+							})
+						}else{
+							this.$refs.treeRef.curNode.rnodes.splice(index, 1)
+							this.hasModify = true
+						}
+						
 					}
 				})
-
+			},
+			/* 删除blob指定试题目录下所有 */
+			deleteBlobPrefix(item) {
+				return new Promise((resolve, reject) => {
+					this.$api.blob.deletePrefix({
+						"cntr": item.cntr,
+						"prefix": "syllabus/" + item.title
+					}).then(
+						(res) => {
+							if (!res.error) {
+								resolve(200)
+							} else {
+								resolve(500)
+							}
+						},
+						(err) => {
+							reject(err)
+						}
+					)
+				})
 			},
 			/* 提交新增册别 */
 			handleSubmit() {
@@ -728,27 +817,13 @@
 				return name => {
 					return name.substr(name.lastIndexOf(".") + 1)
 				}
+			},
+			needDeleteFile(){
+				return item => {
+					return item.type !== 'item' && item.type !== 'paper' && item.type !== 'link'
+				}
 			}
 		},
-		mounted() {
-			// this.$EventBus.$on('onCheckPaper',list => {
-			// 	let curResourceArr = this.$refs.treeRef.curNode.rnodes
-			// 	list.forEach(i => {
-			// 		if(!curResourceArr.filter(j => j.type === 'paper').map(k => k.id).includes(i.id)){
-			// 			curResourceArr.push({
-			// 				type: 'paper',
-			// 				title: i.name,
-			// 				id: i.id,
-			// 				code: i.code,
-			// 				scope: i.scope,
-			// 				cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
-			// 					.userInfo.TEAMModelId,
-			// 				link: [i.blob]
-			// 			})
-			// 		}
-			// 	})
-			// })
-		}
 	}
 </script>
 
@@ -779,7 +854,16 @@
 			}
 		}
 	}
-
+	
+	.syllabus-content-header{
+		.ivu-input{
+			background-color: #262626;
+			border-color: #333;
+			font-size: 12px;
+			color: #ddd;
+		}
+	}
+	
 	.tree-upload-modal {
 		.ivu-modal-body {
 			padding: 10px 40px;