Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/develop3.0' into develop3.0

osbert 5 anni fa
parent
commit
2d7e026ca5
25 ha cambiato i file con 1446 aggiunte e 396 eliminazioni
  1. 1 1
      TEAMModelOS.SDK/Module/AzureBlob/Implements/AzureBlobDBRepository.cs
  2. 12 0
      TEAMModelOS/ClientApp/src/api/learnActivity.js
  3. 12 12
      TEAMModelOS/ClientApp/src/common/CollapseMenuLayout.vue
  4. 8 10
      TEAMModelOS/ClientApp/src/common/UploadFile.vue
  5. 6 15
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue
  6. 182 0
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.less
  7. 375 0
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue
  8. 102 0
      TEAMModelOS/ClientApp/src/components/selflearn/OrderLearnInfo.less
  9. 216 0
      TEAMModelOS/ClientApp/src/components/selflearn/OrderLearnInfo.vue
  10. 1 1
      TEAMModelOS/ClientApp/src/components/selflearn/OrderLearnList.vue
  11. 53 0
      TEAMModelOS/ClientApp/src/components/selflearn/UnitInfo.less
  12. 134 0
      TEAMModelOS/ClientApp/src/components/selflearn/UnitInfo.vue
  13. 1 1
      TEAMModelOS/ClientApp/src/components/selflearn/UnitList.vue
  14. 30 0
      TEAMModelOS/ClientApp/src/css/dark-iview-form.less
  15. 1 1
      TEAMModelOS/ClientApp/src/css/dark-iview-modal.less
  16. 1 1
      TEAMModelOS/ClientApp/src/router/routes.js
  17. 2 0
      TEAMModelOS/ClientApp/src/view/selflearning/ManageHomeWork.vue
  18. 115 31
      TEAMModelOS/ClientApp/src/view/selflearning/ManageVote.vue
  19. 0 92
      TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.less
  20. 188 209
      TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.vue
  21. 1 1
      TEAMModelOS/ClientApp/src/view/teachcontent/CreateLearnUnit.vue
  22. 2 2
      TEAMModelOS/ClientApp/src/view/teachcontent/CreateOrderLearn.vue
  23. 1 1
      TEAMModelOS/ClientApp/src/view/teachcontent/index.less
  24. 1 17
      TEAMModelOS/ClientApp/src/view/teachcontent/index.vue
  25. 1 1
      TEAMModelOS/Controllers/Syllabus/ResourceController.cs

+ 1 - 1
TEAMModelOS.SDK/Module/AzureBlob/Implements/AzureBlobDBRepository.cs

@@ -569,7 +569,7 @@ namespace TEAMModelOS.SDK.Module.AzureBlob.Implements
 
             // Return the URI string for the container, including the SAS token.
             
-            return (blobContainer.Uri.Scheme+ "//"+ blobContainer.Uri.Host.ToString() , blobContainer.Name, sasContainerToken);
+            return (blobContainer.Uri.Scheme+ "://"+ blobContainer.Uri.Host.ToString() , blobContainer.Name, sasContainerToken);
         }
         public (string, string) GetContainerSasUriRead(string containerName, string storedPolicyName = null)
         {

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

@@ -145,5 +145,17 @@ export default {
     */
     FindSelfLearn: function (data) {
         return post('/api/Learn/FindLearningAutonomous', data)
+    },
+    /*
+    *删除编序式活动
+    */
+    DeleteLeanProcess: function (data) {
+        return post('/api/Learn/DeleteLeanProcess', data)
+    },
+    /*
+    *删除最小单元
+    */
+    DeleteUnit: function (data) {
+        return post('/api/Learn/DeleteUnit', data)
     }
 }

+ 12 - 12
TEAMModelOS/ClientApp/src/common/CollapseMenuLayout.vue

@@ -160,18 +160,18 @@
                                 router: '/home/knowledge',
                                 tag:'T'
                             },
-                            {
-                                icon: '',
-                                name: '自学单元',
-                                router: '/home/manageUnit',
-                                tag:'T'
-                            },
-                            {
-                                icon: '',
-                                name: '编序式学习',
-                                router: '/home/manageOrderLearn',
-                                tag:'T'
-                            }
+                            //{
+                            //    icon: '',
+                            //    name: '自学单元',
+                            //    router: '/home/manageUnit',
+                            //    tag:'T'
+                            //},
+                            //{
+                            //    icon: '',
+                            //    name: '编序式学习',
+                            //    router: '/home/manageOrderLearn',
+                            //    tag:'T'
+                            //}
                         ]
                     },
                     {

+ 8 - 10
TEAMModelOS/ClientApp/src/common/UploadFile.vue

@@ -24,6 +24,7 @@ import { Array } from 'core-js'
         data() {
             return {
                 urlString: '',
+                blobContainer:'',
                 containerURL: undefined,
                 sasString: '',
                 uploadedList: [],
@@ -97,7 +98,7 @@ import { Array } from 'core-js'
                  * v12
                  * */
                 const blobServiceClient = new BlobServiceClient('https://teammodelostest.blob.core.chinacloudapi.cn' + this.sasString);
-                const containerName = "teammodelos"
+                const containerName = this.blobContainer
                 this.containerURL = blobServiceClient.getContainerClient(containerName);
             },
             dataURLtoFile(dataurl, filename) {
@@ -149,7 +150,7 @@ import { Array } from 'core-js'
                             const blockBlobClient = this.containerURL.getBlockBlobClient(this.pathName + "/compress" + file.name)
                             blockBlobClient.uploadBrowserData(resultFile).then(
                                 res => {
-                                    fileInfo['compressUrl'] = this.urlString + '/' + this.pathName + '/compress' + file.name
+                                    fileInfo['compressUrl'] = this.urlString + '/' + this.blobContainer + '/' + this.pathName + '/compress' + file.name
                                     this.$emit('successData', fileInfo)
                                 },
                                 err => {
@@ -194,7 +195,7 @@ import { Array } from 'core-js'
                         const blockBlobClient = this.containerURL.getBlockBlobClient(this.pathName + "/" + posterName)
                         blockBlobClient.uploadBrowserData(resultFile).then(
                             res => {
-                                fileInfo['compressUrl'] = this.urlString + '/' + this.pathName + '/' + posterName
+                                fileInfo['compressUrl'] = this.urlString + '/' + this.blobContainer + '/' + this.pathName + '/' + posterName
                                 this.$emit('successData', fileInfo)
                             },
                             err => {
@@ -206,14 +207,14 @@ import { Array } from 'core-js'
                 }
             },
             uploadToBlob(file) {
-
+                console.log(file)
                 let fileItem = {}
                 fileItem['fileName'] = file.name
-                fileItem['blobUrl'] = this.urlString + '/' + this.pathName + '/' + file.name
+                fileItem['blobUrl'] = this.urlString + '/' + this.blobContainer+ '/' + this.pathName + '/' + file.name
                 fileItem['extension'] = file.name.substring(file.name.lastIndexOf('.') + 1)
                 fileItem['size'] = file.size
                 fileItem['status'] = 0
-                fileItem['contentType'] = file.type
+                fileItem['contentType'] = file.type == '' ? file.name.substring(file.name.lastIndexOf('.') + 1) :  file.type
                 let type = 'other'
                 for (let item in this.contentTypes) {
                     if (this.contentTypes[item].indexOf(fileItem.extension.toUpperCase()) !== -1) {
@@ -289,7 +290,6 @@ import { Array } from 'core-js'
                 }
 
                 let extension = file.name.substring(file.name.lastIndexOf('.') + 1, file.name.length)
-                console.log(extension)
                 if (this.format.length > 0 && this.format.indexOf(extension) == -1) {
                     this.$Message.error({
                         content: "文件类型不支持",
@@ -302,6 +302,7 @@ import { Array } from 'core-js'
                     (res) => {
                         if (res.error == null) {
                             this.sasString = res.result.data.SAS
+                            this.blobContainer = res.result.data.Container
                             this.urlString = res.result.data.Url
                             this.initBlob()
                             this.uploadToBlob(file)
@@ -341,7 +342,6 @@ import { Array } from 'core-js'
         },
         mounted() {
             //this.uploadedList = []
-            console.log(this.defaultFileList)
             this.uploadedList = this.defaultFileList
         },
         created() {
@@ -350,8 +350,6 @@ import { Array } from 'core-js'
         watch: {
             defaultFileList: {
                 handler: function (o, n) {
-                    console.log(o)
-                    console.log(n)
                     this.uploadedList = this.defaultFileList
                 },
                 deep: true

+ 6 - 15
TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue

@@ -12,14 +12,14 @@
 
             <FormItem label="发布时间" prop="publishModel">
                 <RadioGroup v-model="hwForm.publishModel">
-                    <Radio label="0" :disabled="currentState !== 100">立即发布</Radio>
-                    <Radio label="1" :disabled="currentState !== 100">定时发布</Radio>
+                    <Radio label="0" :disabled="currentState !== 100 && !isAdd">立即发布</Radio>
+                    <Radio label="1" :disabled="currentState !== 100 && !isAdd">定时发布</Radio>
                 </RadioGroup>
 
                 <DatePicker v-if="hwForm.publishModel === '1'"
                             type="datetime"
                             :editable="isDateEdit"
-                            :disabled="currentState !== 100"
+                            :disabled="currentState !== 100 && !isAdd"
                             placeholder="请选择发布时间"
                             v-model="hwForm.startTime"
                             style="margin-top:10px"></DatePicker>
@@ -35,17 +35,7 @@
             </FormItem>
 
             <FormItem label="作业附件" prop="attachment">
-                <!--<Upload multiple
-                        type="drag"
-                        ref="upload"
-                        :before-upload="handleBeforeUpload"
-                        action="//jsonplaceholder.typicode.com/posts/">
-                    <div style="padding: 20px 0">
-                        <Icon type="ios-folder-open" size="52"></Icon>
-                        <p>选择或者直接拖拽文件上传</p>
-                    </div>
-                </Upload>-->
-                <UploadFile @successData="getFileUrl" :uploadUrl="uploadUrl" :pathName="userInfo.TEAMModelId.replace('#','')" :quality="1"></UploadFile>
+                <UploadFile ref="uploadRef" @successData="getFileUrl" :uploadUrl="uploadUrl" :pathName="userInfo.TEAMModelId.replace('#','')" :quality="1"></UploadFile>
             </FormItem>
 
             <FormItem label="作业记录" prop="isReset" v-show="editable && isEdit">
@@ -85,6 +75,7 @@
         components: { UploadFile },
         data() {
             return {
+                isAdd:true,
                 isEdit: false,
                 isBtnLoading: false,
                 isDateEdit:false,
@@ -160,7 +151,7 @@
                         params.endTime = Math.round(this.hwForm.endTime.getTime())
                         params.description = this.hwForm.description
                         params.other = this.hwForm.other
-                        params.resource = []
+                        params.resource = this.uploadFileList
                         if (this.isEdit) {
                             params.id = this.editInfo.id
                         }

+ 182 - 0
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.less

@@ -0,0 +1,182 @@
+@main-bgColor: rgb(40,40,40); //主背景颜色
+@borderColor: #424242;
+@primary-color:#0fb68b;
+@primary-textColor: #fff; //文本主颜色
+@second-textColor: #CBCBCB; //文本副级颜色
+@primary-fontSize: 14px;
+@second-fontSize: 16px;
+
+.component-hw-form {
+    padding: 20px 20px 50px 20px;
+
+    .ivu-form .ivu-form-item-label {
+        color: @second-textColor;
+    }
+
+    .ivu-form-item:not(:first-child) {
+        margin-top: 30px;
+    }
+
+    .ivu-form .btn-save {
+        width: 48%;
+        background: @primary-color;
+        border: none;
+        height: 38px;
+    }
+
+    .ivu-form .btn-reset {
+        width: 48%;
+        border: none;
+        height: 38px;
+    }
+
+    .ivu-input::-webkit-input-placeholder {
+        color: #939393;
+    }
+
+    .ivu-input, .ivu-select-single .ivu-select-selection,
+    .ivu-select-multiple .ivu-select-selection {
+        background: #353535;
+        border: none;
+        margin-top: 10px;
+        height: 40px;
+        line-height: 40px;
+        color: @primary-textColor;
+    }
+
+    .ivu-select-multiple .ivu-select-selection{
+        height:auto;
+    }
+
+    .ivu-tag {
+        border: none;
+        background: @primary-color;
+        height: 28px;
+        line-height: 28px;
+
+        i{
+            top:8px;
+            color:#fff;
+        }
+
+        .ivu-tag-text {
+            color: #fff;
+        }
+    }
+
+    .ivu-select {
+        color: @second-textColor;
+    }
+
+    .ivu-input-prefix i, .ivu-input-suffix i {
+        line-height: 60px;
+    }
+
+    .ivu-select-single .ivu-select-selection .ivu-select-placeholder,
+    .ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,
+    .ivu-select-single .ivu-select-selection .ivu-select-selected-value {
+        height: 40px;
+        line-height: 40px;
+    }
+
+    .ivu-date-picker {
+        width: 100%;
+        margin-top: -20px;
+    }
+
+    .ivu-radio-wrapper, .ivu-checkbox-wrapper {
+        color: @second-textColor;
+    }
+
+    .ivu-radio-wrapper:not(:first-child),
+    .ivu-checkbox-wrapper:not(:first-child) {
+        margin-left: 15px;
+    }
+
+    .ivu-radio-inner:after {
+        background: @primary-color;
+    }
+
+    .ivu-upload-drag {
+        background: #353535;
+        margin-top: 10px;
+        border: 1px dashed #6c6e71;
+        color: @second-textColor;
+
+        .ivu-icon {
+            color: @primary-color;
+            font-weight: bold;
+        }
+    }
+
+    .ivu-checkbox-checked .ivu-checkbox-inner {
+        border-color: @primary-color;
+        background: @primary-color;
+    }
+
+    .ivu-upload-list-file,
+    .ivu-upload-list-file > span i {
+        color: @second-textColor;
+        margin-right: 5px;
+    }
+
+    .ivu-upload-list-file:hover {
+        background: #3b3b3b;
+
+        span {
+            color: @second-textColor;
+        }
+    }
+
+    .ivu-upload-list-remove {
+        margin-top: 5px;
+        font-size: 22px;
+    }
+
+    .ivu-select-single .ivu-select-selection .ivu-select-placeholder {
+        color: #939393;
+    }
+
+    .w-e-toolbar {
+        background: @main-bgColor !important;
+        border-color: @borderColor !important;
+        margin-top: 10px;
+        z-index: 1 !important;
+
+        .w-e-menu {
+            z-index: 1 !important;
+        }
+    }
+
+    .w-e-text-container {
+        background: #3b3b3b;
+        border-color: @borderColor !important;
+        z-index: 1 !important;
+    }
+
+    .w-e-text {
+        color: #fff;
+        /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
+        &::-webkit-scrollbar {
+            width: 4px;
+            height: 16px;
+            background-color: #0E0D0D;
+        }
+        /*定义滚动条轨道 内阴影+圆角*/
+        &::-webkit-scrollbar-track {
+            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
+            border-radius: 10px;
+            background-color: #484848;
+        }
+        /*定义滑块 内阴影+圆角*/
+        &::-webkit-scrollbar-thumb {
+            border-radius: 0;
+            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
+            background-color: #989191;
+        }
+    }
+
+    .w-e-toolbar .w-e-menu:hover i {
+        color: #fff;
+    }
+}

+ 375 - 0
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue

@@ -0,0 +1,375 @@
+<template>
+    <div class="component-hw-form">
+        <Form ref="hwForm" :model="hwForm" label-position="top" :rules="ruleValidate" :disabled="!editable">
+            <FormItem label="投票名称" prop="name">
+                <Input v-model="hwForm.name" placeholder="请输入投票名称"></Input>
+            </FormItem>
+            <FormItem label="投票对象" prop="target">
+                <Select multiple v-model="hwForm.target" placeholder="请选择投票发布对象">
+                    <Option v-for="item in classRooms" :value="item.classroomCode" :key="item.classroomCode">{{ item.classroomName }}</Option>
+                </Select>
+            </FormItem>
+
+            <FormItem label="发布时间" prop="publishModel">
+                <RadioGroup v-model="hwForm.publishModel">
+                    <Radio label="0" :disabled="currentState !== 100 && !isAdd">立即发布</Radio>
+                    <Radio label="1" :disabled="currentState !== 100 && !isAdd">定时发布</Radio>
+                </RadioGroup>
+
+                <DatePicker v-if="hwForm.publishModel === '1'"
+                            type="datetime"
+                            :editable="isDateEdit"
+                            :disabled="currentState !== 100 && !isAdd"
+                            placeholder="请选择发布时间"
+                            v-model="hwForm.startTime"
+                            style="margin-top:10px"></DatePicker>
+            </FormItem>
+
+            <FormItem label="结束时间" prop="endTime">
+                <DatePicker type="datetime" :editable="isDateEdit" placeholder="请选择投票结束时间" v-model="hwForm.endTime"></DatePicker>
+            </FormItem>
+
+            <FormItem label="投票描述" prop="description">
+                <div ref="descriptionEditor" style="text-align:left"></div>
+            </FormItem>
+
+            <FormItem label="选项设置" prop="attachment">
+                <div v-for="(item,index) in voteOptions" :key="index">
+                    <div :ref="'voteOption'+index" style="text-align:left;height:50px" class="option-editor" @click="optionClick(item)"></div>
+                </div>
+            </FormItem>
+
+            <FormItem label="投票记录" prop="isReset" v-show="editable && isEdit">
+                <CheckboxGroup v-model="hwForm.isReset">
+                    <Checkbox label="reset">清空投票提交记录</Checkbox>
+                </CheckboxGroup>
+            </FormItem>
+
+            <FormItem label="其他" prop="other">
+                <CheckboxGroup v-model="hwForm.other">
+                    <Checkbox label="view">开放观摩</Checkbox>
+                    <Checkbox label="comment">开放互评</Checkbox>
+                </CheckboxGroup>
+            </FormItem>
+
+            <FormItem v-show="editable">
+                <Button type="primary" class="btn-save" @click="handleSubmit('hwForm')" :loading="isBtnLoading">保存</Button>
+                <Button @click="handleReset('hwForm')" class="btn-reset" style="margin-left: 8px">重置</Button>
+            </FormItem>
+        </Form>
+    </div>
+</template>
+<script>
+    import E from 'wangeditor'
+    import UploadFile from '@/common/UploadFile.vue'
+    export default {
+        props: {
+            editItem: {
+                default: null,
+                type: Object
+            },
+            editable: {
+                default: false,
+                type: Boolean
+            }
+        },
+        components: { UploadFile },
+        data() {
+            return {
+                isAdd:true,
+                isEdit: false,
+                isBtnLoading: false,
+                isDateEdit:false,
+                currentState:0,
+                editInfo: null,
+                userInfo:this.$store.state.userInfo,
+                descriptionEditor: null,
+                classRooms: [],
+                uploadFileList:[],
+                uploadUrl:'',
+                defaultConfig: {
+                  uploadImgServer: '/api/file/uploadWangEditor', // 图片上传地址
+                  showLinkImg: false, // 是否展示网络图片链接上传
+                  uploadFileName: 'files', // 上传图片后台获取的文件名
+                  menus:this.$tools.wangEditorMenu
+                },
+                voteOptions: new Array(4),
+                hwForm: {
+                    name: '',
+                    target: [],
+                    endTime: '',
+                    publishModel:'0',
+                    startTime:'',
+                    description: '',
+                    isReset:[],
+                    other: []
+                },
+                defaultParams: {
+                    scopeCode: "",
+                    name: "",
+                    target: [],
+                    publishModel: "0",
+                    startTime: 0,
+                    endTime: 0,
+                    resource: []
+                },
+                uploadList:[],
+                ruleValidate: {
+                    name: [
+                        { required: true, message: '投票名称不能为空', trigger: 'blur' }
+                    ],
+                    publishModel: [
+                        { required: true, trigger: 'change' }
+                    ],
+                    description: [
+                        { required: true, message: '投票描述不能为空', trigger: 'blur' }
+                    ],
+                    target: [
+                        { required: true, message: '投票对象不能为空' }
+                    ],
+                    endTime: [
+                        { required: true, type: 'date', message: '请设置结束时间', trigger: 'change' }
+                    ]
+                    
+                }
+            }
+        },
+        methods: {
+            /**
+             * 提交新增投票表单
+             * @param name FormName
+             */
+            handleSubmit(name) {
+                this.$refs[name].validate((valid) => {
+                    if (valid && this.getSimpleText(this.hwForm.description)) {
+                        let params = Object.assign({}, this.defaultParams)
+                        let target = []
+                        let isReset = this.hwForm.isReset.length > 0
+                        params.scopeCode = this.userInfo.TEAMModelId
+                        params.name = this.hwForm.name
+                        params.publishModel = this.hwForm.publishModel
+                        params.startTime = this.hwForm.publishModel === '1' ? Math.round(this.hwForm.startTime.getTime()) : 0
+                        params.endTime = Math.round(this.hwForm.endTime.getTime())
+                        params.description = this.hwForm.description
+                        params.other = this.hwForm.other
+                        params.resource = this.uploadFileList
+                        if (this.isEdit) {
+                            params.id = this.editInfo.id
+                        }
+
+                        /** 替换投票对象格式 */
+                        this.hwForm.target.forEach(item => {
+                            target.push({
+                                classroomCode: item,
+                                classroomName: this.classRooms.filter(i => i.classroomCode === item)[0].classroomName,
+                                scopeCode: this.classRooms.filter(i => i.classroomCode === item)[0].scopeCode
+                            })
+                        })
+                        params.target = target
+                        this.isBtnLoading = true
+                        this.saveorUpdataHw({ homeWork: params, reset: isReset }).then(res => {
+                            this.$Message.success(this.isEdit ? '修改成功!' : '添加成功!')
+                            this.$emit('onAddSuccess')
+                            this.isBtnLoading = false
+                        }).catch(error => {
+                            console.log(error)
+                        })
+                    } else {
+                        this.$Message.error('请将信息填写完整')
+                    }
+                })
+            },
+
+            initEditors() {
+                // Editor默认配置
+                if (this.voteOptions.length > 0) {
+                    this.voteOptions.forEach((item, i) => {
+                        let that = this
+                        let editor = new E(that.$refs['voteOption' + i][0])
+                        console.log(editor)
+                        editor.customConfig = this.defaultConfig
+
+                        // 选项编辑器失焦隐藏工具栏
+                        editor.customConfig.onblur = function () {
+                            let allToolbars = document.getElementsByClassName('option-editor')
+                            for (let i = 0; i < allToolbars.length; i++) {
+                                if (allToolbars[i].children.length) {
+                                    allToolbars[i].children[0].style.visibility = 'hidden'
+                                }
+                            }
+                        }
+
+                        // 选项编辑器内容发生变化时
+                        editor.customConfig.onchange = (html) => {
+                            let key = String.fromCharCode(64 + parseInt(i + 1))
+                            let codeArr = this.voteOptionsContent.map(item => item.code)
+                            // 如果已经编辑过则 修改选项内容
+                            if (codeArr.indexOf(key) !== -1) {
+                                this.voteOptionsContent[codeArr.indexOf(key)].value = html
+                            } else { // 否则创建新选项
+                                let option = {
+                                    code: key,
+                                    value: html
+                                }
+                                this.voteOptionsContent.push(option)
+                            }
+                        }
+                        editor.create()
+
+                        // 如果是编辑状态 则将选项内容回显
+                        //if (Object.keys(this.editInfo).length > 0) {
+                        //    editor.txt.html(this.editInfo.options[i].value)
+                        //}
+                    })
+                }
+            },
+
+            // 模拟选项聚焦事件
+            optionClick(index) {
+                let allToolbars = document.getElementsByClassName('option-editor')
+                let that = this
+                for (let i = 0; i < allToolbars.length; i++) {
+                    allToolbars[i].children[0].style.visibility = 'hidden'
+                }
+                setTimeout(function () {
+                    let currentToolBar = that.$refs['voteOption' + index][0].children[0]
+                    currentToolBar.style.visibility = 'visible'
+                }, 100)
+            },
+
+            /**
+             * 获取当前教师的所有教室数据
+             * @param teacherId 老师的醍摩豆ID
+             */
+            getClassrooms(teacherId) {
+                return new Promise((r, j) => {
+                    this.$api.learnActivity.FindClassroomByTeacherId(teacherId).then(res => {
+                        if (!res.error && res.result.data) {
+                            r(res.result.data)
+                        } else {
+                            j(500)
+                            this.$Message.error('获取数据失败')
+                        }
+                    })
+                })
+                
+            },
+
+            // 提取富文本内容中的文本
+            getSimpleText(html) {
+                var msg = html.replace(/<(?!img|video).*?>/g, '')// 执行替换成空字符
+                return msg.replace(/&nbsp;/ig, '')
+            },
+
+            /**
+             * 重置表单
+             * @param name
+             */
+            handleReset(name) {
+                this.$refs[name].resetFields();
+                this.descriptionEditor.txt.clear()
+
+            },
+
+            /** 附件上传之前钩子 限制附件上传个数 */
+            handleBeforeUpload () {
+                const check = this.uploadList.length < 5;
+                if (!check) {
+                    this.$Notice.warning({
+                        title: '最多只能上传5个附件'
+                    });
+                }
+                return check;
+            },
+
+            /**
+             * 新增投票或者编辑投票
+             * @param data
+             */
+            saveorUpdataHw(data) {
+                return new Promise((r, j) => {
+                    this.$api.learnActivity.SaveorUpdataHomeWork(data).then(res => {
+                        if (!res.error) {
+                            r(res.result.data)
+                        } else {
+                            j(res.error)
+                        }
+                    })
+                })
+                
+            },
+
+            /**
+             * 回显投票详情
+             * @param item
+             */
+            doRender(item) {
+                console.log(item)
+                this.hwForm = {
+                    name: item.name,
+                    target: item.target.map(item => item.classroomCode),
+                    publishModel: item.publishModel,
+                    startTime: item.publishModel === '0' ? '' : new Date(item.startTime),
+                    endTime: new Date(item.endTime),
+                    description: item.description,
+                    other: item.other,
+                    isReset:[]
+                }
+                this.currentState = item.state
+                this.descriptionEditor.txt.html(item.description)
+            },
+
+
+            getFileUrl(file) { // 获取文件地址
+                console.log(file)
+                this.uploadFileList.push({
+                    fileName: file.fileName,
+                    type: file.type,
+                    size: file.size,
+                    blobUrl: file.blobUrl,
+                    sha1Code: file.sha1Code,
+                    compressUrl: file.compressUrl
+                })
+
+                console.log(this.uploadFileList)
+            },
+        },
+        mounted() {
+            console.log("1111")
+            this.initEditors()
+
+            /** 获取可选教室列表 */
+            this.getClassrooms(this.userInfo.TEAMModelId).then(res => this.classRooms = res)
+
+
+            /** 初始化投票详情的富文本编辑器 */
+            let descriptionEditor = new E(this.$refs.descriptionEditor)
+            descriptionEditor.customConfig = this.defaultConfig
+            descriptionEditor.customConfig.onchange = (html) => { this.hwForm.description = html }
+            descriptionEditor.create()
+            this.descriptionEditor = descriptionEditor
+        },
+        watch: {
+            editItem: {
+                handler(newValue) {
+                    /** 编辑回显 */
+                    if (newValue) {
+                        this.doRender(newValue)
+                        this.isEdit = true
+                        this.editInfo = newValue
+                    } else {
+                        /** 新增 */
+                        this.handleReset('hwForm')
+                        this.isEdit = false
+                        this.editInfo = null
+                    }
+                },
+                deep: true
+            }
+        }
+    }
+</script>
+
+<style lang="less">
+@import "./BaseHwForm.less";
+</style>

+ 102 - 0
TEAMModelOS/ClientApp/src/components/selflearn/OrderLearnInfo.less

@@ -0,0 +1,102 @@
+@main-bgColor: rgb(40,40,40); //主背景颜色
+@borderColor: #424242;
+@primary-textColor: #fff; //文本主颜色
+@second-textColor: #a5a5a5; //文本副级颜色
+@primary-fontSize: 14px;
+@second-fontSize: 16px;
+
+.order-learn-main-label {
+    width: 100%;
+    height: 45px;
+    line-height: 45px;
+    border-bottom: 1px solid @borderColor;
+    color: @second-textColor;
+}
+.base-info-wrap {
+    width: 100%;
+    padding-top: 20px;
+
+    .base-info-item {
+        margin-bottom: 20px;
+    }
+
+    .base-info-label {
+        color: @second-textColor;
+        display: inline-block;
+        width: 80px;
+        font-size: 15px;
+        margin-bottom: 5px;
+    }
+
+    .base-info-value {
+        color: white;
+        font-size: 16px;
+        border-bottom: 1px solid #202020;
+        padding-bottom: 4px;
+    }
+}
+.order-learn-content-wrap {
+    width: 100%;
+    height: 100%;
+    padding-left: 18px;
+
+    .order-learn-content-label {
+        color: white;
+        line-height: 13px;
+        margin-top: 15px;
+        padding: 5px;
+        padding-left: 8px;
+        border-left: 2px solid white;
+        background: #333333;
+    }
+
+    .order-learn-file-wrap {
+        color: white;
+        margin-top: 5px;
+
+        .order-learn-file-item {
+            margin-bottom: 2px;
+            font-size: 16px;
+
+            .file-item-action {
+                display: none;
+                float: right;
+                padding-right: 20px;
+            }
+
+            .action-icon {
+                margin-right: 10px;
+                font-size: 16px;
+                cursor: pointer;
+
+                &:hover {
+                    color: aqua;
+                }
+            }
+
+            &:hover {
+                background: #404040;
+                padding-left: 5px;
+                border-radius: 5px;
+            }
+
+            &:hover .file-item-action {
+                display: inline-block;
+            }
+        }
+    }
+}
+
+.order-learn-step-item {
+    /*margin-top:10px;*/
+    border-bottom: 1px solid @borderColor;
+    font-size: 15px;
+    line-height: 40px;
+    height: 40px;
+    color: white;
+    cursor: pointer;
+}
+
+.order-learn-step-item-active {
+    background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
+}

+ 216 - 0
TEAMModelOS/ClientApp/src/components/selflearn/OrderLearnInfo.vue

@@ -0,0 +1,216 @@
+<template>
+    <Split v-model="split1" v-if="orderLearnInfo !== undefined">
+        <div slot="left">
+            <div class="order-learn-main-label">
+                基础信息
+            </div>
+            <NoData v-if="orderLearnInfo == undefined" style="margin-top:150px;"></NoData>
+            <div class="base-info-wrap" v-else>
+                <div class="base-info-item">
+                    <span class="base-info-label">
+                        名称:
+                    </span>
+                    <p class="base-info-value">
+                        {{orderLearnInfo.name}}
+                    </p>
+                </div>
+                <div class="base-info-item">
+                    <span class="base-info-label">
+                        学段:
+                    </span>
+                    <p class="base-info-value">
+
+                        <!--{{orderLearnInfo.periodCode}}-->
+                        小学
+                    </p>
+                </div>
+                <div class="base-info-item">
+                    <span class="base-info-label">
+                        学科:
+                    </span>
+                    <p class="base-info-value">
+                        {{orderLearnInfo.subjectCode}}
+                    </p>
+                </div>
+                <div class="base-info-item">
+                    <span class="base-info-label">
+                        创建时间:
+                    </span>
+                    <p class="base-info-value">
+                        2020/04/02
+                    </p>
+                </div>
+                <div class="base-info-item">
+                    <p class="base-info-label">
+                        说明:
+                    </p>
+                    <p class="base-info-value">
+                        {{orderLearnInfo.introduce}}
+                    </p>
+                </div>
+            </div>
+        </div>
+        <div slot="right" class="order-learn-content-wrap">
+            <div style="height:100%;" class="dark-iview-split">
+                <Split v-model="split2">
+                    <div slot="left">
+                        <div class="order-learn-main-label">
+                            学习阶段
+                        </div>
+                        <NoData v-if="orderLearnInfo == undefined"></NoData>
+                        <div v-else>
+                            <div v-for="(item,index) in orderLearnInfo.steps" @click="selectStep(index)" :class="currentStepIndex == index ? 'order-learn-step-item order-learn-step-item-active':'order-learn-step-item'">
+                                <span>
+                                    {{item.name}}
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                    <div slot="right" style="padding-left:18px;height:100%;">
+                        <div class="order-learn-main-label">
+                            自学内容
+                        </div>
+                        <div style="height:calc(100% - 45px);">
+                            <vuescroll>
+                                <p class="order-learn-content-label">
+                                    内容:{{orderLearnInfo == undefined ? 0 : orderLearnInfo.steps[currentStepIndex].resource.length}}
+                                </p>
+                                <div style="min-height:220px;">
+                                    <Loading v-show="isLoading"></Loading>
+                                    <ContentFileList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :resources="orderLearnInfo.steps[currentStepIndex].resource"></ContentFileList>
+                                </div>
+                                <p class="order-learn-content-label" style="margin-bottom: 15px;">
+                                    题目:{{orderLearnInfo == undefined ? 0 : orderLearnInfo.steps[currentStepIndex].item.length}}
+                                </p>
+                                <div class="unit-content-detail">
+                                    <NoData v-if="orderLearnInfo == undefined" style="margin-top:120px;"></NoData>
+                                    <Loading v-show="isLoading"></Loading>
+                                    <QuestionList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :questions="orderLearnInfo.steps[currentStepIndex].item" style="margin-top:12px;"></QuestionList>
+                                </div>
+                            </vuescroll>
+                        </div>
+                    </div>
+                </Split>
+            </div>
+
+        </div>
+    </Split>
+</template>
+<script>
+    import QuestionList from '@/components/learnactivity/QuestionList.vue'
+    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import NoData from '@/common/NoData.vue'
+    import Loading from '@/common/Loading.vue'
+    export default {
+        components: {
+            QuestionList, ContentFileList, NoData, Loading
+        },
+        props: {
+            orderLearnInfo: {
+                default: () => {
+                    return undefined
+                },
+                type: Object
+            }
+        },
+        watch: {
+            orderLearnInfo: {
+                handler(o, n) {
+                    this.findQuestionById()
+                    this.findResourceById()
+                },
+                deep: true
+            }
+        },
+        data() {
+            return {
+                currentStepIndex: 0,
+                split1: 0.2,
+                split2: 0.2,
+                isLoading: false
+            }
+        },
+        methods: {
+            selectStep(index) {
+                this.currentStepIndex = index
+                this.findQuestionById()
+                this.findResourceById()
+            },
+            /**
+             * 通过id查询内容信息
+             * */
+            findResourceById() {
+                if (this.orderLearnInfo != undefined) {
+                    this.isLoading = true
+                    if (!this.orderLearnInfo.steps[this.currentStepIndex].requestedR) {
+                        this.$api.learnActivity.FindSyllabusResourceById(this.orderLearnInfo.steps[this.currentStepIndex].resource).then(
+                            res => {
+                                if (res.error == null) {
+                                    this.orderLearnInfo.steps[this.currentStepIndex].resource.length = 0
+                                    this.orderLearnInfo.steps[this.currentStepIndex].resource = res.result.data
+                                    this.orderLearnInfo.steps[this.currentStepIndex].requestedR = true
+                                } 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查询题目信息
+             * */
+            findQuestionById() {
+                if (this.orderLearnInfo != undefined) {
+                    this.isLoading = true
+                    if (!this.orderLearnInfo.steps[this.currentStepIndex].requestedI) {
+                        this.$api.learnActivity.FindQuestionById(this.orderLearnInfo.steps[this.currentStepIndex].item).then(
+                            res => {
+                                if (res.error == null) {
+                                    this.orderLearnInfo.steps[this.currentStepIndex].item.length = 0
+                                    this.$set(this.orderLearnInfo.steps[this.currentStepIndex], 'item', res.result.data)
+                                    this.orderLearnInfo.steps[this.currentStepIndex].requestedI = true
+                                    console.log(this.orderLearnInfo)
+                                } 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)
+                    }
+                }
+            },
+        }
+    }
+</script>
+<style scoped lang="less">
+    @import "./OrderLearnInfo.less";
+</style>
+<style>
+
+</style>

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

@@ -11,7 +11,7 @@
                 <span>{{item.steps.length}}</span>
             </div>
         </div>
-        <NoData v-if="orderLearnList.length == 0"></NoData>
+        <NoData v-if="orderLearnList.length == 0" style="margin-top:150px;"></NoData>
     </div>
 </template>
 <script>

+ 53 - 0
TEAMModelOS/ClientApp/src/components/selflearn/UnitInfo.less

@@ -0,0 +1,53 @@
+@main-bgColor: rgb(40,40,40); //主背景颜色
+@borderColor: #424242;
+@primary-textColor: #fff; //文本主颜色
+@second-textColor: #a5a5a5; //文本副级颜色
+@primary-fontSize: 14px;
+@second-fontSize: 16px;
+
+.unit-main-wrap {
+    width: 100%;
+    height: 100%;
+
+    .unit-main-header {
+        height: 40px;
+        line-height: 40px;
+        border-bottom: 1px solid @borderColor;
+    }
+
+    .unit-main-action {
+        float: right;
+        margin-right: 45px;
+        display: inline-block;
+        cursor: pointer;
+        color: white;
+
+        &:hover {
+            color: aqua;
+        }
+    }
+
+    .unit-main-label {
+        color: @second-textColor;
+    }
+
+    .unit-content-wrap {
+        width: 100%;
+        height: 100%;
+
+        .unit-content-label {
+            color: white;
+            line-height: 13px;
+            margin-top: 15px;
+            padding: 5px;
+            padding-left: 8px;
+            border-left: 2px solid white;
+            background: #333333;
+        }
+
+        .unit-content-detail {
+            min-height: 240px;
+            width: 100%;
+        }
+    }
+}

+ 134 - 0
TEAMModelOS/ClientApp/src/components/selflearn/UnitInfo.vue

@@ -0,0 +1,134 @@
+<template>
+    <div class="unit-main-wrap">
+        <div class="unit-content-wrap" v-if="unitInfo != undefined">
+            <vuescroll>
+                <p class="unit-content-label">自学内容:{{unitInfo.resource.length}}</p>
+                <div class="unit-content-detail">
+                    <Loading v-show="isLoading"></Loading>
+                    <ContentFileList v-show="!isLoading" :resources="unitInfo.resource"></ContentFileList>
+                </div>
+
+                <p class="unit-content-label">题目:{{unitInfo.item.length}}</p>
+                <div class="unit-content-detail">
+                    <NoData v-if="unitInfo.length == 0" style="margin-top:120px;"></NoData>
+                    <Loading v-show="isLoading"></Loading>
+                    <QuestionList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :questions="unitInfo.item" style="margin-top:12px;"></QuestionList>
+                </div>
+            </vuescroll>
+        </div>
+    </div>
+</template>
+<script>
+    import QuestionList from '@/components/learnactivity/QuestionList.vue'
+    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import NoData from '@/common/NoData.vue'
+    import Loading from '@/common/Loading.vue'
+    export default {
+        props: {
+            unitInfo: {
+                default: () => {
+                    return undefined
+                },
+                type: Object
+            }
+        },
+        watch: {
+            unitInfo: {
+                handler(o, n) {
+                    console.log('watch')
+                    this.findQuestionById()
+                    this.findResourceById()
+                },
+                deep: true
+            }
+        },
+        components: {
+            QuestionList, ContentFileList, NoData,Loading
+        },
+        data() {
+            return {
+                isLoading: false
+            }
+        },
+        methods: {
+            /**
+             * 通过id查询内容信息
+             * */
+            findResourceById() {
+                if (this.unitInfo != undefined) {
+                    this.isLoading = true
+                    if (!this.unitInfo.requestedR) {
+                        this.$api.learnActivity.FindSyllabusResourceById(this.unitInfo.resource).then(
+                            res => {
+                                if (res.error == null) {
+                                    this.unitInfo.resource.length = 0
+                                    this.unitInfo.resource = res.result.data
+                                    this.unitInfo.requestedR = true
+                                } 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查询题目信息
+             * */
+            findQuestionById() {
+                if (this.unitInfo != undefined) {
+                    this.isLoading = true
+                    if (!this.unitInfo.requestedI) {
+                        this.$api.learnActivity.FindQuestionById(this.unitInfo.item).then(
+                            res => {
+                                if (res.error == null) {
+                                    this.unitInfo.item.length = 0
+                                    this.$set(this.unitInfo, 'item', res.result.data)
+                                    this.unitInfo.requestedI = true
+                                    console.log(this.unitInfo)
+                                } 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)
+                    }
+                }
+            }
+        }
+    }
+
+</script>
+<style scoped lang="less">
+    @import "./UnitInfo.less";
+</style>
+<style>
+    .unit-content-wrap #loadingBox {
+        margin-top: 88px !important;
+    }
+</style>

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

@@ -5,7 +5,7 @@
             <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"></NoData>
+        <NoData v-if="unitList.length == 0" style="margin-top:150px;"></NoData>
     </div>
 </template>
 <script>

+ 30 - 0
TEAMModelOS/ClientApp/src/css/dark-iview-form.less

@@ -25,4 +25,34 @@
     color: white;
     border-color: #606060;
   }
+}
+
+.dark-iview-form {
+    .ivu-form .ivu-form-item-label {
+        color: #CBCBCB;
+    }
+
+    .ivu-input {
+        background: none !important;
+        color: white;
+        border-color: #606060;
+    }
+
+    .ivu-input-number, .ivu-input-number-small input {
+        background: none;
+        font-size: 16px;
+        color: white;
+    }
+
+    .ivu-input-number, .ivu-input-number-default input {
+        background: none;
+        border-color: #606060;
+        color: white;
+    }
+
+    .ivu-select-selection {
+        background: none;
+        color: white;
+        border-color: #606060;
+    }
 }

+ 1 - 1
TEAMModelOS/ClientApp/src/css/dark-iview-modal.less

@@ -1,7 +1,7 @@
 .dark-iview-modal {
   .ivu-modal-content {
     background: #404040;
-    color: white;
+    /*color: white;*/
   }
 
   .ivu-modal-header {

+ 1 - 1
TEAMModelOS/ClientApp/src/router/routes.js

@@ -259,7 +259,7 @@ export const routes = [
             //},
             {
                 path: 'SelfLearn',
-                name: 'SelfLearn',
+                name: 'selfLearn',
                 component: resolve => require(['@/view/selfstudy/SelfLearn.vue'], resolve)
             },
             {

+ 2 - 0
TEAMModelOS/ClientApp/src/view/selflearning/ManageHomeWork.vue

@@ -99,6 +99,8 @@
             /** 新增作业 */
             goToCreate() {
                 this.$refs.editForm.handleReset('hwForm')
+                this.$refs.editForm.$refs.uploadRef.clearUploadedList()
+                this.$refs.editForm.isAdd = true
                 this.isEdit = false
                 this.editItem = null
                 this.editable = true

+ 115 - 31
TEAMModelOS/ClientApp/src/view/selflearning/ManageVote.vue

@@ -1,18 +1,28 @@
 <template>
     <div class="hw-container">
-        <!-- 作业活动列表 -->
+        <!-- 投票活动列表 -->
         <div class="hw-col hw-list-box">
             <div class="hw-box-header">
                 <span>投票活动列表</span>
                 <Icon type="md-add" class="to-create-icon" @click="goToCreate" />
             </div>
             <vuescroll>
+                <Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadList"></Loading>
                 <div class="hw-item-wrap">
-                    <div class="hw-item" v-for="(item,index) in hwList" :key="index">
-                        <p class="hw-item-name">测试作业名称</p>
-                        <div class="hw-item-info">
-                            <span class="hw-item-nums">提交人数: 10 / 20</span>
-                            <span class="hw-item-status">进行中</span>
+                    <div v-if="hwList.length === 0">
+                        <EmptyBox :top="50"></EmptyBox>
+                    </div>
+                    <div style="width:100%" v-else>
+                        <div :class='["hw-item",index === activeHwIndex ? "item-active":""]'
+                             v-for="(item,index) in hwList"
+                             :key="index"
+                             @click="onHwClick(item,index)">
+                            <p class="hw-item-name">{{ item.name }}</p>
+                            <div class="hw-item-info">
+                                <span class="hw-item-nums">提交人数: 10 / 20</span>
+                                <span class="hw-item-status"
+                                      :style="{ background: (item.state === 100 ? '#0BADD4' : item.state === 200 ? '#0fb68b' : '#949594')}">{{ item.state === 100 ? '待发布' : item.state === 200 ? '进行中' : '已结束' }}</span>
+                            </div>
                         </div>
                     </div>
 
@@ -20,32 +30,32 @@
             </vuescroll>
         </div>
 
-        <!-- 作业基础信息展示 -->
-        <div class="hw-col hw-info-box">
+        <!-- 投票基础信息展示 -->
+        <div class="hw-col hw-info-box" v-show="currentHw.state === 100">
             <div class="hw-box-header">
-                <span>作业详情</span>
+                <span>投票详情</span>
                 <div class="hw-box-header-tools">
-                    <span class="hw-box-header-tools-tool"><Icon type="md-create" size="18" title="编辑" /></span>
+                    <span class="hw-box-header-tools-tool" v-show="currentHw.state !== 300"><Icon type="md-create" size="18" title="编辑" @click="onEditHw" /></span>
                 </div>
             </div>
             <vuescroll>
                 <div class="hw-info-wrap">
-                    <BaseHwForm></BaseHwForm>
+                    <BaseVoteForm :editItem="currentHw"></BaseVoteForm>
                 </div>
             </vuescroll>
         </div>
 
-        <!-- 作业提交数据 -->
-        <div class="hw-col hw-data-box">
+        <!-- 投票提交数据 -->
+        <div class="hw-col hw-data-box" :style="{ width: currentHw.state === 100 ? '55%' : '85%' }">
             <div class="hw-box-header">
-                <span>作业数据</span>
+                <span>投票数据</span>
                 <div class="hw-box-header-tools">
                     <span class="hw-box-header-tools-tool"><Icon type="md-podium" />数据分析</span>
                 </div>
             </div>
             <vuescroll>
                 <div class="hw-data-wrap">
-                    <BaseHwTable></BaseHwTable>
+                    <BaseHwTable :studentsList="studentsList"></BaseHwTable>
                 </div>
             </vuescroll>
         </div>
@@ -53,62 +63,136 @@
         <!-- 完善试卷信息 -->
         <Modal v-model="addHwModal"
                class-name="hw-modal"
-               title="新增作业"
+               :title="isEdit ? '修改投票' : '新增投票'"
                footer-hide
                width="600px">
             <div class="hw-modal-box">
                 <vuescroll>
-                    <BaseHwForm></BaseHwForm>
+                    <BaseVoteForm @onAddSuccess="onAddSuccess" :editItem="editItem" :editable="editable" ref="editForm"></BaseVoteForm>
                 </vuescroll>
             </div>
         </Modal>
     </div>
 </template>
 <script>
-    import BaseHwForm from '@/components/learnactivity/BaseHwForm'
+    import EmptyBox from '@/common/EmptyData'
+    import Loading from '@/common/Loading'
+    import BaseVoteForm from '@/components/learnactivity/BaseVoteForm'
     import BaseHwTable from '@/components/learnactivity/BaseHwTable'
     export default {
-        components: { BaseHwForm, BaseHwTable },
+        components: { BaseVoteForm, BaseHwTable, EmptyBox, Loading },
         data() {
             return {
-                addHwModal:false,
-                hwList: new Array(5).fill('1')
+                isLoadList: false,
+                isEdit: false,
+                editable: false,
+                hwList: [],
+                studentsList: [],
+                currentHw: {},
+                editItem: {},
+                activeHwIndex: 0,
+                addHwModal: false,
             }
         },
         methods: {
+            /** 新增投票 */
             goToCreate() {
+                this.$refs.editForm.handleReset('hwForm')
+                this.$refs.editForm.isAdd = true
+                this.isEdit = false
+                this.editItem = null
+                this.editable = true
+                this.addHwModal = true
+            },
+
+            /** 获取投票列表 */
+            getHomeWorkList() {
+                this.isLoadList = true
+                let params = { scopeCode: this.$store.state.userInfo.TEAMModelId }
+                this.$api.learnActivity.FindHomeWork(params).then(res => {
+                    if (!res.error && res.result.data) {
+                        this.hwList = res.result.data
+                        this.onHwClick(res.result.data[0], 0)
+                        this.isLoadList = false
+                    } else {
+                        this.$Message.error('获取数据失败')
+                    }
+                })
+            },
+
+            /**
+             * 投票点击事件
+             * @param item
+             * @param index
+             */
+            onHwClick(item, index) {
+                this.currentHw = item
+                this.activeHwIndex = index
+                this.getHwStudents(item.id)
+            },
+
+
+            /**
+             * 获取投票关联的学生清单
+             * @param hwId 投票ID
+             */
+            getHwStudents(hwId) {
+                this.$api.learnActivity.FindStudentByHwId({ homeWorkId: hwId }).then(res => {
+                    if (!res.error && res.result.data) {
+                        this.studentsList = res.result.data
+                    } else {
+                        this.$Message.error('获取数据失败')
+                    }
+                })
+            },
+
+            /** 投票编辑事件 */
+            onEditHw() {
+                this.editItem = this.currentHw
+                this.isEdit = true
+                this.editable = true
                 this.addHwModal = true
+            },
+
+
+            /** 新增投票成功回调 */
+            onAddSuccess() {
+                this.addHwModal = false
+                this.getHomeWorkList()
             }
+        },
+        mounted() {
+            this.getHomeWorkList()
         }
     }
 </script>
 <style lang="less" scoped>
-    @import "./ManageVote.less";
+    @import "./ManageHomeWork.less";
 </style>
 <style>
     .hw-modal .ivu-modal-content {
-        background:#454545;
+        background: #454545;
         font-family: '微軟正黑體', 'Heiti TC' !important;
     }
 
     .hw-modal .ivu-modal-body {
-        padding:0;
+        padding: 0;
     }
 
     .hw-modal .ivu-modal-header p,
     .hw-modal .ivu-modal-header-inner {
-        color:#fff;
-        font-size:18px;
-        font-weight:bold;
+        color: #fff;
+        font-size: 18px;
+        font-weight: bold;
     }
 
     .hw-modal .ivu-modal-header {
-        border-bottom:none;
+        border-bottom: none;
     }
 
     .hw-modal .hw-modal-box {
-        height:600px;
-        max-height:600px;
-        padding:15px;
+        height: 600px;
+        max-height: 600px;
+        padding: 15px;
     }
 </style>

+ 0 - 92
TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.less

@@ -65,103 +65,11 @@
         }
     }
 
-    .order-learn-main-label {
-        width: 100%;
-        height: 45px;
-        line-height: 45px;
-        border-bottom: 1px solid @borderColor;
-        color: @second-textColor;
-    }
 
     .order-learn-main-body {
         width: 100%;
         height: ~"calc(100% - 45px)";
 
-        .order-learn-step-item {
-            /*margin-top:10px;*/
-            border-bottom: 1px solid @borderColor;
-            font-size: 15px;
-            line-height: 40px;
-            height: 40px;
-            color: white;
-            cursor: pointer;
-        }
-
-        .order-learn-step-item-active {
-            background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
-        }
-
-        .order-learn-content-wrap {
-            width: 100%;
-            height: 100%;
-            padding-left: 18px;
-
-            .order-learn-content-label {
-                color: white;
-                line-height: 13px;
-                margin-top: 15px;
-                padding: 5px;
-                padding-left: 8px;
-                border-left: 2px solid white;
-                background: #333333;
-            }
-
-            .order-learn-file-wrap {
-                color: white;
-                margin-top: 5px;
-
-                .order-learn-file-item {
-                    margin-bottom: 2px;
-                    font-size:16px;
-                    .file-item-action {
-                        display: none;
-                        float: right;
-                        padding-right: 20px;
-                    }
-
-                    .action-icon{
-                        margin-right:10px;
-                        font-size:16px;
-                        cursor:pointer;
-                        &:hover{
-                            color:aqua;
-                        }
-                    } 
-                    &:hover {
-                        background: #404040;
-                        padding-left: 5px;
-                        border-radius: 5px;
-                    }
-                    &:hover .file-item-action{
-                        display:inline-block;
-                    }
-                }
-            }
-        }
-
-        .base-info-wrap {
-            width: 100%;
-            padding-top: 20px;
-
-            .base-info-item {
-                margin-bottom: 20px;
-            }
-
-            .base-info-label {
-                color: @second-textColor;
-                display: inline-block;
-                width: 80px;
-                font-size: 15px;
-                margin-bottom:5px;
-            }
-
-            .base-info-value {
-                color: white;
-                font-size: 16px;
-                border-bottom: 1px solid #202020;
-                padding-bottom: 4px;
-            }
-        }
     }
 }
 .to-create-icon {

+ 188 - 209
TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.vue

@@ -5,14 +5,14 @@
                 <div class="dark-iview-tabs-line" style="padding-top:10px;">
                     <Tabs v-model="listType" @on-click="toggleList">
                         <div slot="extra">
-                            <Icon type="md-add" class="to-create-icon" @click="goToCreate" title="删除" />
-                            <Icon type="md-trash" class="to-create-icon" @click="toggleList" title="新增" />
-                            <Icon type="md-create" class="to-create-icon" @click="toggleList" title="编辑" />
+                            <Icon type="md-add" class="to-create-icon" @click="createData" title="新增" />
+                            <Icon type="md-trash" :color="editIconStatus ? 'white':'#808080'" :style="{'cursor': editIconStatus ? 'pointer':'not-allowed'}" class="to-create-icon" @click="deleteData" title="删除" />
+                            <Icon type="md-create" :color="editIconStatus ? 'white':'#808080'" :style="{'cursor': editIconStatus ? 'pointer':'not-allowed'}" class="to-create-icon" @click="editInfo" title="编辑" />
                         </div>
-                        <TabPane :label="tabLabelOrder" name="order">
+                        <TabPane label="编序式单元" name="order">
                             <OrderLearnList :class="listType == 0 ? 'animated fadeIn':''" @selectIndex="selectOrderLearn" :orderLearnList="orderLearnList"></OrderLearnList>
                         </TabPane>
-                        <TabPane :label="tabLabelUnit" name="unit">
+                        <TabPane label="学习单元" name="unit">
                             <UnitList :class="listType == 1 ? 'animated fadeIn':''" @selectIndex="selectOrderLearn" :unitList="unitList"></UnitList>
                         </TabPane>
                     </Tabs>
@@ -24,119 +24,60 @@
             <div class="main-bar-wrap">
                 <span :class="currentTabIndex == 0 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(0)">详细信息</span>
                 <span :class="currentTabIndex == 1 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(1)">活动数据</span>
-                <span class="main-bar-action-btn" @click="editInfo()">
-                    <Icon type="ios-create-outline" size="20" />
-                    编辑内容
-                </span>
-                <span class="main-bar-action-btn">
-                    <Icon type="ios-send" size="20" />
-                    发布活动
+                <span class="main-bar-action-btn" @click="publishActivity">
+                    <Icon type="ios-send" size="20" />发布活动
                 </span>
             </div>
-            <div class="order-learn-main-body dark-iview-split">
-
-                <Split v-model="split1">
-                    <div slot="left">
-                        <div class="order-learn-main-label">
-                            基础信息
-                        </div>
-                        <NoData v-if="orderLearnList.length == 0"></NoData>
-                        <div class="base-info-wrap" v-if="orderLearnList.length > 0">
-                            <div class="base-info-item">
-                                <span class="base-info-label">
-                                    名称:
-                                </span>
-                                <p class="base-info-value">
-                                    {{orderLearnList[currentLearnIndex].name}}
-                                </p>
-                            </div>
-                            <div class="base-info-item">
-                                <span class="base-info-label">
-                                    学段:
-                                </span>
-                                <p class="base-info-value">
-
-                                    <!--{{orderLearnList[currentLearnIndex].periodCode}}-->
-                                    小学
-                                </p>
-                            </div>
-                            <div class="base-info-item">
-                                <span class="base-info-label">
-                                    学科:
-                                </span>
-                                <p class="base-info-value">
-                                    {{orderLearnList[currentLearnIndex].subjectCode}}
-                                </p>
-                            </div>
-                            <div class="base-info-item">
-                                <span class="base-info-label">
-                                    创建时间:
-                                </span>
-                                <p class="base-info-value">
-                                    2020/04/02
-                                </p>
-                            </div>
-                            <div class="base-info-item">
-                                <p class="base-info-label">
-                                    说明:
-                                </p>
-                                <p class="base-info-value">
-                                    {{orderLearnList[currentLearnIndex].introduce}}
-                                </p>
-                            </div>
-                        </div>
-                    </div>
-                    <div slot="right" class="order-learn-content-wrap">
-                        <div style="height:100%;" class="dark-iview-split">
-                            <Split v-model="split2">
-                                <div slot="left">
-                                    <div class="order-learn-main-label">
-                                        学习阶段
-                                    </div>
-                                    <NoData v-if="orderLearnList.length == 0"></NoData>
-                                    <div v-if="orderLearnList.length > 0">
-                                        <div v-for="(item,index) in orderLearnList[currentLearnIndex].steps" @click="selectStep(index)" :class="currentStepIndex == index ? 'order-learn-step-item order-learn-step-item-active':'order-learn-step-item'">
-                                            <span>
-                                                {{item.name}}
-                                            </span>
-                                        </div>
-                                    </div>
-                                </div>
-                                <div slot="right" style="padding-left:18px;height:100%;">
-                                    <div class="order-learn-main-label">
-                                        自学内容
-                                    </div>
-                                    <div style="height:calc(100% - 45px);">
-                                        <vuescroll>
-                                            <p class="order-learn-content-label">
-                                                内容:{{orderLearnList.length == 0 ? 0 : orderLearnList[currentLearnIndex].steps[currentStepIndex].resource.length}}
-                                            </p>
-                                            <div style="min-height:220px;">
-                                                <Loading v-show="isLoading"></Loading>
-                                                <ContentFileList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :resources="orderLearnList[currentLearnIndex].steps[currentStepIndex].resource"></ContentFileList>
-                                            </div>
-                                            <p class="order-learn-content-label" style="margin-bottom: 15px;">
-                                                题目:{{orderLearnList.length == 0 ? 0 : orderLearnList[currentLearnIndex].steps[currentStepIndex].item.length}}
-                                            </p>
-                                            <div class="unit-content-detail">
-                                                <NoData v-if="orderLearnList.length == 0" style="margin-top:120px;"></NoData>
-                                                <Loading v-show="isLoading"></Loading>
-                                                <QuestionList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :questions="orderLearnList[currentLearnIndex].steps[currentStepIndex].item" style="margin-top:12px;"></QuestionList>
-                                            </div>
-                                        </vuescroll>
-                                    </div>
-                                </div>
-                            </Split>
-                        </div>
-
-                    </div>
-                </Split>
+            <div class="order-learn-main-body dark-iview-split" v-if="listType == 'order'">
+                <OrderLearnInfo :orderLearnInfo="orderLearnList[currentLearnIndex]"></OrderLearnInfo>
+            </div>
+            <div class="order-learn-main-body dark-iview-split" v-else>
+                <UnitInfo :unitInfo="unitList[currentUnitIndex]"></UnitInfo>
             </div>
         </div>
         <Modal v-model="editStatus"
-               title="编辑内容"
+               :title="listType == 'order' ? '编辑编序式教材' : '编辑自学单元'"
                @on-ok="confirmEdit">
-            <p>确认跳转到编序式教材编辑页面?</p>
+            <p>确认跳转到<span style="padding:0px 5px;">{{ listType == 'order' ? '编序式教材':'自学单元'}}</span>编辑页面?</p>
+        </Modal>
+        <Modal v-model="deleteStatus"
+               :title="listType == 'order' ? '删除编序式教材' : '删除自学单元'"
+               @on-ok="confirmDelete">
+            <p>确认删除<span style="color:blue;padding:0px 5px;font-weight:600;" v-if="deleteStatus">{{ listType == 'order' ? orderLearnList[currentLearnIndex].name : unitList[currentUnitIndex].name}}</span>?</p>
+        </Modal>
+        <Modal v-model="publishStatus"
+               title="发布自主学习活动"
+               class-name="dark-iview-modal dark-iview-form publish-modal"
+               @on-ok="confirmPublish">
+            <Form :model="activityInfo" label-colon label-position="left" :label-width="80">
+
+
+                <FormItem label="发布对象">
+                    <Select v-model="activityInfo.target">
+                        <Option v-for="item in targetList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+                    </Select>
+                </FormItem>
+                <FormItem label="发布方式">
+                    <RadioGroup v-model="activityInfo.publishType" style="color:white;">
+                        <Radio :label="item.value" v-for="item in publishTypeList">
+                            <span>{{ item.label }}</span>
+                        </Radio>
+                    </RadioGroup>
+                </FormItem>
+                <FormItem label="发布时间" v-show="activityInfo.publishType == 1">
+                    <DatePicker type="datetime" placeholder="设置开始时间" style="width: 100%;"></DatePicker>
+                </FormItem>
+                <FormItem label="活动类型">
+                    <RadioGroup v-model="activityInfo.type" style="color:white;">
+                        <Radio :label="item.value" v-for="item in activityTypeList">
+                            <span>{{ item.label }}</span>
+                        </Radio>
+                    </RadioGroup>
+                </FormItem>
+                <FormItem label="截止时间" v-show="activityInfo.type == 1">
+                    <DatePicker type="datetime" placeholder="设置截止时间" style="width: 100%;"></DatePicker>
+                </FormItem>
+            </Form>
         </Modal>
     </div>
 </template>
@@ -147,20 +88,49 @@
     import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
     import OrderLearnList from '@/components/selflearn/OrderLearnList.vue'
     import UnitList from '@/components/selflearn/UnitList.vue'
+    import OrderLearnInfo from '@/components/selflearn/OrderLearnInfo.vue'
+    import UnitInfo from '@/components/selflearn/UnitInfo.vue'
     export default {
         components: {
-            NoData, QuestionList, ContentFileList, Loading, OrderLearnList, UnitList
-
+            NoData, QuestionList, ContentFileList, Loading, OrderLearnList, UnitList,OrderLearnInfo,UnitInfo
         },
         data() {
             return {
+                targetList: [],
+                publishTypeList: [
+                    {
+                        value: '0',
+                        label:'立即发布'
+                    },
+                    {
+                        value: '1',
+                        label:'定时发布'
+                    }
+                ],
+                activityTypeList: [
+                    {
+                        value: '0',
+                        label:'自主学习'
+                    },
+                    {
+                        value: '1',
+                        label:'课前预习'
+                    },
+                ],
+                activityInfo: {
+                    type: '',
+                    endTime: 0,
+                    target: [],
+                    publishType: '',
+                    publishTime:0
+                },
                 currentTabIndex: 0,
                 listType: 'order',//order: 编序式教材 unit:学习单元
                 isLoading: false,
                 sasString: '',
+                publishStatus: false,
+                deleteStatus: false,
                 editStatus: false,
-                split1: 0.2,
-                split2: 0.2,
                 demoLoginInfo: {
                     user: 'admin',
                     TEAMModelId: 'habook#0001',
@@ -170,99 +140,115 @@
                 orderLearnList: [],
                 unitList: [],
                 currentLearnIndex: 0,
-                currentStepIndex: 0,
+                currentUnitIndex: 0
+            }
+        },
+        computed: {
+            editIconStatus(){
+                if (this.listType == 'order') {
+                    if (this.orderLearnList.length > 0) {
+                        return true
+                    } else {
+                        return false
+                    }
+                } else {
+                    if (this.unitList.length > 0) {
+                        return true
+                    } else {
+                        return false
+                    }
+                }
             }
         },
         methods: {
+
             /**
-             *
-             * */
-            tabLabelOrder(h) {
-                return h('span', '编序式单元')
+             * 发布活动
+            */
+            publishActivity() {
+                this.publishStatus = true
             },
-            tabLabelUnit(h) {
-                return h('span', '学习单元')
+            confirmPublish() {
+
             },
-            /**
-             * 切换列表类型
-             * */
-            toggleList() {
-                this.listType = 1 - this.listType
+            selectTab(index) {
+                this.currentTabIndex = index
+            },
+            createData() {
                 if (this.listType == 'order') {
-                    this.findOrderLearn()
+                    this.$router.push({
+                        name: 'createOrderLearn'
+                    })
                 } else {
-                    this.findUnit()
+                    this.$router.push({
+                        name: 'createLearnUnit'
+                    })
                 }
             },
             /**
-             * 通过id查询内容信息
+             * 删除编序式教材或自学单元
+             * */
+            deleteData() {
+                this.deleteStatus = true
+            },
+            /**
+             * 确认删除编序式教材或自学单元
              * */
-            findResourceById() {
-                if (this.orderLearnList.length > 0) {
-                    this.isLoading = true
-                    if (!this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedR) {
-                        this.$api.learnActivity.FindSyllabusResourceById(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource).then(
-                            res => {
-                                if (res.error == null) {
-                                    this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource.length = 0
-                                    this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource = res.result.data
-                                    this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedR = true
-                                } else {
-                                    this.$Message.error("API ERROR!")
-                                }
-                                setTimeout(() => {
-                                    this.isLoading = false
-                                }, 500)
-                            },
-                            err => {
-                                this.$Message.error("API ERROR!")
-                                setTimeout(() => {
-                                    this.isLoading = false
-                                }, 500)
+            confirmDelete() {
+                if (this.listType == 'order') {
+                    let requestData = {
+                        id: this.orderLearnList[this.currentLearnIndex].id,
+                        pk: this.orderLearnList[this.currentLearnIndex].scopeCode
+                    }
+                    this.$api.learnActivity.DeleteLeanProcess(requestData).then(
+                        res => {
+                            if (res.error == null) {
+                                let index = this.currentLearnIndex
+                                this.currentLearnIndex = 0
+                                this.orderLearnList.splice(index,1)
+                                this.$Message.success('删除成功!')
+
+                            } else {
+                                this.$Message.success('删除失败!')
                             }
-                        )
-                    } else {
-                        setTimeout(() => {
-                            this.isLoading = false
-                        }, 200)
+                        },
+                        err => {
+                            this.$Message.success('删除失败!')
+                        }
+                    )
+                } else {
+                    let requestData = {
+                        id: this.unitList[this.currentUnitIndex].id,
+                        pk: this.unitList[this.currentUnitIndex].scopeCode
                     }
+                    this.$api.learnActivity.DeleteUnit(requestData).then(
+                        res => {
+                            if (res.error == null) {
+                                let index = this.currentUnitIndex
+                                this.currentUnitIndex = 0
+                                this.unitList.splice(index,1)
+                                this.$Message.success('删除成功!')
+                            } else {
+                                this.$Message.success('删除失败!')
+                            }
+                        },
+                        err => {
+                            this.$Message.success('删除失败!')
+                        }
+                    )
                 }
             },
             /**
-             * 通过id查询题目信息
+             * 切换列表类型
              * */
-            findQuestionById() {
-                if (this.orderLearnList.length > 0) {
-                    this.isLoading = true
-                    if (!this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedI) {
-                        this.$api.learnActivity.FindQuestionById(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].item).then(
-                            res => {
-                                if (res.error == null) {
-                                    this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].item.length = 0
-                                    this.$set(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex], 'item', res.result.data)
-                                    this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedI = true
-                                    console.log(this.orderLearnList[this.currentLearnIndex])
-                                } 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)
-                    }
+            toggleList() {
+                if (this.listType == 'order') {
+                    this.findOrderLearn()
+                } else {
+                    this.findUnit()
                 }
             },
+            
             goToCreate() {
                 if (this.listType == 'order') {
                     this.$router.push({
@@ -289,25 +275,25 @@
                     })
                 } else {
                     //编辑最小单元
+                    let unitInfo = this.unitList[this.currentUnitIndex]
+                    this.$router.push({
+                        name: 'createLearnUnit',
+                        params: {
+                            unitInfo
+                        }
+                    })
                 }
 
             },
             editInfo() {
                 this.editStatus = true
             },
-            selectStep(index) {
-                this.currentStepIndex = index
-                this.findQuestionById()
-                this.findResourceById()
-            },
             selectOrderLearn(index) {
                 if (this.listType == 'order') {
                     this.currentStepIndex = 0
                     this.currentLearnIndex = index
-                    this.findQuestionById()
-                    this.findResourceById()
                 } else {
-
+                    this.currentUnitIndex = index
                 }
 
             },
@@ -323,8 +309,6 @@
                         res => {
                             if (res.error == null) {
                                 this.orderLearnList = res.result.data
-                                this.findResourceById()
-                                this.findQuestionById()
                             } else {
                                 this.$Message.error('API ERROR!')
                             }
@@ -333,9 +317,7 @@
 
                         }
                     )
-                } else {
-                    this.$Message.info('数据已加载')
-                }
+                } 
 
             },
             /**
@@ -350,10 +332,6 @@
                         res => {
                             if (res.error == null) {
                                 this.unitList = res.result.data
-                                if (this.unitList.length > 0) {
-                                    this.findResourceById()
-                                    this.findQuestionById()
-                                }
                             } else {
                                 this.$Message.error('API ERROR!')
                             }
@@ -362,9 +340,7 @@
 
                         }
                     )
-                } else {
-                    this.$Message.info('数据已加载')
-                }
+                } 
 
             }
         },
@@ -380,4 +356,7 @@
     .order-learn-content-wrap #loadingBox {
         margin-top: 88px !important;
     }
+    .publish-modal .ivu-picker-confirm-time {
+        color: #515a6e;
+    }
 </style>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/teachcontent/CreateLearnUnit.vue

@@ -92,7 +92,7 @@
             },
             confirmToManage() {
                 this.$router.push({
-                    name: 'manageUnit'
+                    name: 'selfLearn'
                 })
             },
             checkUnitName() {

+ 2 - 2
TEAMModelOS/ClientApp/src/view/teachcontent/CreateOrderLearn.vue

@@ -4,7 +4,7 @@
             <span class="order-learn-title">
                 创建编序式学习
             </span>
-            <Button class="btn-save" type="text" :loading="isLoading" ghost icon="ios-albums-outline" @click="saveData">保存评测</Button>
+            <Button class="btn-save" type="text" :loading="isLoading" ghost icon="ios-albums-outline" @click="saveData">保存数据</Button>
         </div>
         <div class="order-learn-main">
             <!-- 基础信息表单 -->
@@ -371,7 +371,7 @@
             },
             confirmToManage() {
                 this.$router.push({
-                    name: 'manageOrderLearn'
+                    name: 'selfLearn'
                 })
             },
             goToPreview() {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/teachcontent/index.less

@@ -278,7 +278,7 @@
 }
 
 .card-item {
-    width: 300px;
+    width: 285px;
     height: fit-content;
     max-height:200px;
     overflow:hidden;

+ 1 - 17
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -117,7 +117,7 @@
         </div>
         <Modal v-model="uploadStatus"
                :title="$t('teachContent.btnUpload')" class="upload-modal" @on-ok="confirmUpload" width="660" :mask-closable="false">
-            <UploadFile :defaultFileList="defaultList" @successData="getFileUrl" :uploadUrl="uploadUrl" :pathName="demoLoginInfo.TEAMModelId.replace('#','')" :quality="1"></UploadFile>
+            <UploadFile @successData="getFileUrl" :uploadUrl="uploadUrl" :pathName="demoLoginInfo.TEAMModelId.replace('#','')" :quality="1"></UploadFile>
         </Modal>
         <Modal v-model="previewStatus"
                :title="previewFile.fileName" width="800px" class="upload-modal" @on-cancel="closePreview">
@@ -148,22 +148,6 @@
         },
         data() {
             return {
-                defaultList: [
-                    {
-                        id: "00000000-0000-0000-0000-000000000000",
-                        scopeCode: "habook#0001",
-                        fileName: "202004160907504442 (1).xls",
-                        extension: "xls",
-                        type: "document",
-                        size: 43520,
-                        createTime: 1588214408000,
-                        relationNum: 0,
-                        blobUrl: "https://teammodelostest.blob.core.chinacloudapi.cn/teammodelos/habook0001/202004160907504442 (1).xls",
-                        compressUrl: null,
-                        range: "private",
-                        sha1Code: "d02892c5a1bda7f01cc6f0920430cc144bb4fcb0"
-                    }
-                ],
                 sasString: '',
                 urlString: '',
                 showType: true,

+ 1 - 1
TEAMModelOS/Controllers/Syllabus/ResourceController.cs

@@ -50,7 +50,7 @@ namespace TEAMModelOS.Controllers.Syllabus
                 {
                     if (item.id == null)
                     {
-                        item.id = new Guid().ToString(); //item.sha1Code + "-" + item.extension + "-" + item.size;
+                        item.id = Guid.NewGuid().ToString(); //item.sha1Code + "-" + item.extension + "-" + item.size;
                         
                     }
                 }