Explorar o código

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

liqk %!s(int64=4) %!d(string=hai) anos
pai
achega
0150702707

+ 3 - 3
TEAMModelOS/ClientApp/src/components/selflearn/NewChooseContent.vue

@@ -106,7 +106,7 @@
             </TabPane>
             <!-- 选择题库 -->
             <TabPane label="题目" name="question" v-if="showQuestion" tab="chooseContent">
-                <div class="tab-wrap">
+                <div class="tab-wrap" v-if="tabName === 'question'">
                     <vuescroll>
                         <ExerciseList ref="exListRef" @chooseQuChange="chooseQuChange"></ExerciseList>
 						<!-- <BaseExerciseList></BaseExerciseList> -->
@@ -115,7 +115,7 @@
             </TabPane>
 			<!-- 选择试卷 -->
 			<TabPane label="试卷" name="paper" v-if="showPaper" tab="chooseContent">
-			    <div class="tab-wrap">
+			    <div class="tab-wrap" v-if="tabName === 'paper'">
 			        <vuescroll>
 						<BasePaperList ref="paperListRef" chooseModel @previewPaper="onPreviewPaper"></BasePaperList>
 			        </vuescroll>
@@ -415,7 +415,7 @@ export default {
                     this.getFileList()
                     break
                 case 'question':
-                    this.queryQuestionByPage()
+                    // this.queryQuestionByPage()
                     break
                 default:
                     break

+ 0 - 8
TEAMModelOS/ClientApp/src/components/syllabus/DragTree.vue

@@ -60,16 +60,8 @@
 <script>
 	import '@/utils/Math.uuid'
 	import BlobTool from '@/utils/blobTool.js'
-	import BaseResource from '@/view/syllabus/newSyllabus/operation/BaseResource'
-	import BaseKnowledge from '@/view/syllabus/newSyllabus/operation/BaseKnowledge'
-	import BaseQuestionList from '@/common/BaseQuestionList'
 	export default {
 		props: ['volume', 'treeData', 'editable'],
-		components: {
-			BaseResource,
-			BaseKnowledge,
-			BaseQuestionList
-		},
 		data() {
 			return {
 				isFalse: false,

+ 4 - 3
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/settings.js

@@ -56,16 +56,17 @@ export default {
 	openStatus: '状态',
 	enable: '启用',
 	disable: '禁用',
-	webhook: "webhook配置",
-	authorization: "Token(authorization)",
+	webhook: "通知接口配置",
+	authorization: "接口密钥",
 	domainName: "域名",
-	subNews: "订阅通知",
+	subNews: "订阅通知接口",
 	apiType1: "数据写入接口",
 	apiType2: "数据读取接口",
 	apiName: '接口名称',
 	apiAddress: '接口地址',
 	apiMethod: '请求方法',
 	apiParams: '参数示例',
+	newName: "通知名称",
 	openKeep: '保存平台',
 	edit: "编辑应用",
 	unedit: '取消编辑',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/syllabus.js

@@ -1,4 +1,5 @@
 export default{
+	noPreview:'该类型文件不支持预览!',
 	praviteSyllabus:'个人课纲',
 	fromCreate:'我创建的课纲',
 	fromShare:'他人分享的课纲',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/syllabus.js

@@ -1,4 +1,5 @@
 export default {
+	noPreview:'該類型檔案不支持預覽!',
 	praviteSyllabus: '個人課綱',
 	fromCreate: '我創建的課綱',
 	fromShare: '他人分享的課綱',

+ 1 - 1
TEAMModelOS/ClientApp/src/utils/editorTools.js

@@ -409,7 +409,7 @@ export default {
 		      // 公式输入插件
 		      constructor(editors) {
 		        const $elem = $(
-		        	'<div class="w-e-menu" style="color:red"><i class="ivu-icon ivu-icon-logo-tumblr" style="font-size: 20px;"></i></div>'
+		        	'<div class="w-e-menu" style="color:red"><i class="icon iconfont icon-function" style="font-size: 20px;font-weight:bold"></i></div>'
 		        );
 		        super($elem, editors);
 		      }

+ 14 - 5
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue

@@ -51,9 +51,11 @@
 		    <NewChooseContent :showSyllabus="isFalse"
 		                   :showOther="isFalse"
 		                   :showQuestion="isFalse"
+						   :showPaper="isFalse"
 						   :defaultFiles="curRepair.blobUrl"
 						   ref="chooseContentRef"
-		                   @on-file-change="onSelectFile"></NewChooseContent>
+		                   @on-file-change="onSelectFile"
+						   v-if="isRelatedContent"></NewChooseContent>
 		
 		    <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">{{$t('evaluation.confirm')}}</Button>
 		</Modal>
@@ -71,7 +73,7 @@
 			<p style="margin: 15px 2px;">{{ $t('evaluation.repairResourse.link')}}{{ isSiteLink ?  '' : $t('evaluation.repairResourse.tip1')}}</p>
 			
 			<!-- 选择内容 -->
-			<Button type="info" @click="isRelatedContent = true" v-if="isSiteLink">{{$t('evaluation.newExercise.chooseContent')}}</Button>
+			<Button type="info" @click="doSelectContent" v-if="isSiteLink">{{$t('evaluation.newExercise.chooseContent')}}</Button>
 			<!-- 手动输入 -->
 			<Input v-model="curOutLink" v-if="!isSiteLink" :placeholder="$t('evaluation.repairResourse.place2')" @on-enter="onAddOutLink"/>
 			<!-- 链接link列表 -->
@@ -135,6 +137,15 @@
 				this.defaultFiles = []
 			},
 			
+			doSelectContent(){
+				this.isRelatedContent = true
+				this.$nextTick(() => {
+					if(this.$refs.chooseContentRef){
+						this.$refs.chooseContentRef.clickTab('content')
+					}
+				})
+			},
+			
 			/* 回车添加外部资源链接 */
 			onAddOutLink(){
 				if(this.isURL(this.curOutLink)){
@@ -219,9 +230,7 @@
 		},
 
 		mounted() {
-			if(this.$refs.chooseContentRef){
-				this.$refs.chooseContentRef.clickTab('content')
-			}
+			
 
 		},
 		watch:{

+ 7 - 1
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue

@@ -412,7 +412,7 @@ import { json } from 'd3'
                     this.$Message.error(this.$t('knowledge.warn'))
 					this.isLoadBlocks = false
 				})
-                that.setCount = true  //开始监听数据
+                // that.setCount = true  //开始监听数据
 			},
 
 			// 根据学科获取学科下所有知识点数据
@@ -548,6 +548,7 @@ import { json } from 'd3'
 				this.editBlock = {}
 				this.isAddBlock = false // 关闭窗口
 				this.blockCounts = []
+				this.updated = true
 			},
 
 			// 添加知识点完成
@@ -565,6 +566,7 @@ import { json } from 'd3'
 				this.originPointList = [...this.pointList]
 				this.isAddPoint = false // 关闭窗口
 				this.isEditPoint = false
+				this.updated = true
 				setTimeout(function () {
 					that.isLoadPoints = false
 				}, 400)
@@ -618,6 +620,7 @@ import { json } from 'd3'
 								that.isLoading = false
                                 that.$Message.success(this.$t('knowledge.delSuccess'))
 							}, 1000)
+							this.updated = true
 						} else {
                             this.$Message.success(this.$t('knowledge.delFail'))
 						}
@@ -640,6 +643,7 @@ import { json } from 'd3'
 						this.actionPoint(data, 0)
 						this.originPointList = [...this.pointList]
                         this.isLoadPoints = false
+						this.updated = true
 					}
 				})
 			},
@@ -655,6 +659,7 @@ import { json } from 'd3'
 						if (this.currentBlock.points.includes(data)) {
 							this.currentBlock.points.splice(this.currentBlock.points.indexOf(data), 1)
 							this.originBlockList = [...this.blockList]
+							this.updated = true
 						} else {
                             this.$Message.error(this.$t('knowledge.moveFail'))
 						}
@@ -728,6 +733,7 @@ import { json } from 'd3'
 					this.activeBlockIndex = null
 					this.curBlockPoints = []
                     this.$Message.success(this.$t('knowledge.success'))
+					this.updated = true
 				}
 			},
 

+ 305 - 248
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="open-mgmt">
-        <Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoading"></Loading>
+        <Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoading" />
         <!-- 列表 -->
         <div class="open-mgmt-left">
             <div class="open-header">
@@ -8,16 +8,15 @@
                 <div class="open-action">
                     <!-- <Icon type="md-add" size="18" style="margin-right: 10px" color="rgb(115 115 115)" @click="editOpen(true, true)" /> -->
                     <Icon type="md-add" title="新增" size="18" style="margin-right: 10px" color="#FFF" @click="editOpen(true, true)" />
-                    
                     <Icon type="md-trash" title="删除" size="18" color="#FFF" @click="delOpen" />
                 </div>
             </div>
             <vuescroll>
                 <div class="open-left-list">
-                    <div :class="['open-list', index == nowIndex ? 'list-select': '']"
-                        v-for="(item, index) in openList"
-                        :key="index"
-                        @click="list(index)"
+                    <div :class="['open-list', index == nowIndex ? 'list-select' : '']"
+                         v-for="(item, index) in openList"
+                         :key="index"
+                         @click="list(index)"
                     >
                         <span>{{ item.name }}</span>
                     </div>
@@ -48,80 +47,95 @@
             <div class="open-right-info">
                 <div class="open-info">
                     <vuescroll>
-                        <div class=" dark-iview-form">
+                        <div class="dark-iview-form">
                             <!-- <div class="open-mgmt-info"> -->
-                                <Form :model="openMgInfo" label-position="top">
-                                    <div class="open-mgmt-info">
-                                        <FormItem :label="$t('settings.openName')">
-                                            <Input v-model="openMgInfo.name"
-                                                :class="isEdit ? '' : 'open-info-disabled'"
-                                                :readonly="isEdit ? false : true"></Input>
-                                        </FormItem>
-                                        <FormItem :label="$t('settings.token')" class="api-token" v-show="!isEdit">
-                                            <div class="api-icon">
-                                                <!-- 隐藏 -->
-                                                <Icon :type="isTokenShow ? 'md-eye' : 'md-eye-off'" :title="isTokenShow ? '隐藏' : '显示'" size="18" style="margin-right: 10px" color="#FFF" @click="isTokenShow = !isTokenShow" />
-                                                <!-- 刷新 -->
-                                                <Icon type="md-refresh" title="刷新" v-show="isTokenShow" size="18" style="margin-right: 10px" color="#FFF" @click="refresh" />
-                                                <!-- 复制 -->
-                                                <Icon type="ios-copy" title="复制" v-show="isTokenShow" size="18" color="#FFF" @click="copyToken" />
-                                            </div>
-                                            <Input
-                                                v-model="openMgInfo.token"
-                                                type="textarea"
-                                                :autosize="{ minRows: 10 }"
-                                                class="open-info-disabled"
-                                                readonly
-                                                v-show="isTokenShow"
-                                            ></Input>
-                                        </FormItem>
-                                        <FormItem :label="$t('settings.des')">
-                                            <Input v-model="openMgInfo.descr"
-                                                type="textarea"
-                                                :autosize="{ minRows: 2 }"
-                                                :class="isEdit ? '' : 'open-info-disabled'"
-                                                :readonly="isEdit ? false : true"></Input>
-                                        </FormItem>
-                                        <FormItem :label="$t('settings.openStatus')">
-                                            <RadioGroup v-model="openMgInfo.status">
-                                                <Radio :label="1" :disabled="isEdit ? false : true">{{ $t("settings.enable") }}</Radio>
-                                                <Radio :label="0" :disabled="isEdit ? false : true">{{ $t("settings.disable") }}</Radio>
-                                            </RadioGroup>
-                                        </FormItem>
-                                    </div>
-                                    <p>{{ $t('settings.webhook') }}</p>
-                                    <div class="open-mgmt-info">
-                                        <FormItem :label="$t('settings.domainName')">
-                                            <Input v-model="openMgInfo.domain"
-                                                :class="isEdit ? '' : 'open-info-disabled'"
-                                                :readonly="isEdit ? false : true"></Input>
-                                        </FormItem>
-                                        <FormItem :label="$t('settings.authorization')">
-                                            <Input v-model="openMgInfo.webhookToken"
-                                                type="textarea"
-                                                :autosize="{ minRows: 2 }"
-                                                :class="isEdit ? '' : 'open-info-disabled'"
-                                                :readonly="isEdit ? false : true"></Input>
-                                        </FormItem>
-                                        <FormItem :label="$t('settings.subNews')">
-                                            <CheckboxGroup v-model="openMgInfo.webhooks">
-                                                <Checkbox v-for="(item, index) in webhook"
-                                                          :label="item.auth"
-                                                          :disabled="isEdit ? false : true"
-                                                          :key="index"
-                                                >
-                                                    <span>{{ item.name}}</span>
-                                                </Checkbox>
-                                            </CheckboxGroup>
-                                        </FormItem>
-                                    </div>
-                                </Form>
-                            </div>
+                            <Form :model="openMgInfo" label-position="top">
+                                <div class="open-mgmt-info">
+                                    <FormItem :label="$t('settings.openName')">
+                                        <Input v-model="openMgInfo.name"
+                                               :class="isEdit ? '' : 'open-info-disabled'"
+                                               :readonly="isEdit ? false : true"
+                                        ></Input>
+                                    </FormItem>
+                                    <FormItem :label="$t('settings.token')" class="api-token" v-show="!isEdit">
+                                        <div class="api-icon">
+                                            <!-- 隐藏 -->
+                                            <Icon :type="isTokenShow ? 'md-eye' : 'md-eye-off'"
+                                                  :title="isTokenShow ? '隐藏' : '显示'"
+                                                  size="18"
+                                                  style="margin-right: 10px"
+                                                  color="#FFF"
+                                                  @click="isTokenShow = !isTokenShow"
+                                            />
+                                            <!-- 刷新 -->
+                                            <Icon type="md-refresh"
+                                                  title="刷新"
+                                                  v-show="isTokenShow"
+                                                  size="18"
+                                                  style="margin-right: 10px"
+                                                  color="#FFF"
+                                                  @click="refresh"
+                                            />
+                                            <!-- 复制 -->
+                                            <Icon type="ios-copy"
+                                                  title="复制"
+                                                  v-show="isTokenShow"
+                                                  size="18"
+                                                  color="#FFF"
+                                                  @click="copyToken"
+                                            />
+                                        </div>
+                                        <Input v-model="openMgInfo.token"
+                                               type="textarea"
+                                               :autosize="{ minRows: 10 }"
+                                               class="open-info-disabled"
+                                               readonly
+                                               v-show="isTokenShow"
+                                        ></Input>
+                                    </FormItem>
+                                    <FormItem :label="$t('settings.des')">
+                                        <Input v-model="openMgInfo.descr"
+                                               type="textarea"
+                                               :autosize="{ minRows: 2 }"
+                                               :class="isEdit ? '' : 'open-info-disabled'"
+                                               :readonly="isEdit ? false : true"
+                                        ></Input>
+                                    </FormItem>
+                                    <FormItem :label="$t('settings.openStatus')">
+                                        <RadioGroup v-model="openMgInfo.status">
+                                            <Radio :label="1" :disabled="isEdit ? false : true">
+                                                {{ $t("settings.enable") }}
+                                            </Radio>
+                                            <Radio :label="0" :disabled="isEdit ? false : true">
+                                                {{ $t("settings.disable") }}
+                                            </Radio>
+                                        </RadioGroup>
+                                    </FormItem>
+                                </div>
+                                <p>{{ $t("settings.webhook") }}</p>
+                                <div class="open-mgmt-info">
+                                    <FormItem :label="$t('settings.domainName')">
+                                        <Input v-model="openMgInfo.domain"
+                                               :class="isEdit ? '' : 'open-info-disabled'"
+                                               :readonly="isEdit ? false : true"
+                                        ></Input>
+                                    </FormItem>
+                                    <FormItem :label="$t('settings.authorization')">
+                                        <Input v-model="openMgInfo.webhookToken"
+                                               type="textarea"
+                                               :autosize="{ minRows: 2 }"
+                                               :class="isEdit ? '' : 'open-info-disabled'"
+                                               :readonly="isEdit ? false : true"
+                                        ></Input>
+                                    </FormItem>
+                                </div>
+                            </Form>
+                        </div>
                         <!-- </div> -->
                     </vuescroll>
                 </div>
                 <div class="open-api dark-iview-table dark-iview-page dark-iview-tabs-card">
-                <!-- <div class="open-api"> -->
+                    <!-- <div class="open-api"> -->
                     <Tabs value="1">
                         <TabPane :label="$t('settings.apiType1')" name="1">
                             <div class="open-api-table">
@@ -158,6 +172,23 @@
                                 </Table>
                             </div>
                         </TabPane>
+                        <TabPane :label="$t('settings.subNews')" name="3">
+                            <div class="open-api-table">
+                                <Table ref="selection"
+                                       :loading="isLoadList"
+                                       :columns="apiListCol"
+                                       :data="isEdit ? newsListSel : newsListNow"
+                                       @on-selection-change="selectionChange3"
+                                >
+                                    <template slot-scope="{ row }" slot="name">
+                                        <span>{{ row.name }}</span>
+                                        <Poptip trigger="hover" :content="row.descr" placement="right">
+                                            <Icon type="ios-alert-outline" />
+                                        </Poptip>
+                                    </template>
+                                </Table>
+                            </div>
+                        </TabPane>
                     </Tabs>
                 </div>
             </div>
@@ -186,7 +217,7 @@ export default {
                 {
                     title: this.$t("settings.apiName"),
                     key: "name",
-                    slot: "name"
+                    slot: "name",
                 },
                 {
                     title: this.$t("settings.apiAddress"),
@@ -202,56 +233,93 @@ export default {
                 }, */
             ],
             apiList: [], //api原有列表
-            apiListR: [], //读取接口
-            apiListW: [], //写入接口
-            // apiListSelect: [], //api选择列表
-            // apiListNow: [], //当前应用已有的api 列表
             apiListSelR: [], //已有的读取接口
             apiListSelW: [], //已有的写入接口
+            newsList: [], //原始通知列表
+            newsListNow: [], //已有的通知
             pageTotal: 0,
-            pageSizeOpts:[5, 10, 20, 30, 40],
-            webhook: [],
+            pageSizeOpts: [5, 10, 20, 30, 40],
             nowIndex: 0, //当前下标
             isEdit: false, //编辑状态
             isAdd: false, // 编辑/新增
         }
     },
-    mounted () {
+    mounted() {
         this.getOpenList()
-        this.getApiList()
-        this.getWebhook()
+    },
+    computed: {
+        // 读取接口
+        apiListR() {
+            if (this.apiList && this.openMgInfo && this.openMgInfo.auths) {
+                return this.apiList.filter((item) => {
+                    item._checked = this.openMgInfo.auths.includes(item.auth)
+                    return item.type == "r"
+                })
+            } else {
+                return []
+            }
+        },
+        // 写入接口
+        apiListW() {
+            if (this.apiList && this.openMgInfo && this.openMgInfo.auths) {
+                return this.apiList.filter((item) => {
+                    item._checked = this.openMgInfo.auths.includes(item.auth)
+                    return item.type == "w"
+                })
+            } else {
+                return []
+            }
+        },
+        // 通知
+        newsListSel() {
+            if (this.newsList && this.openMgInfo && this.openMgInfo.webhooks) {
+                return this.newsList.filter((item) => {
+                    item._checked = this.openMgInfo.webhooks.includes(item.auth)
+                    return item
+                })
+            } else {
+                return []
+            }
+        },
     },
     methods: {
         // 获取应用列表
         getOpenList() {
             this.isLoading = true
             let list = []
-            let req = {code: this.schoolCode}
+            let req = { code: this.schoolCode }
             this.$api.openMgmt.getOpenList(req).then(
-                res => {
+                (res) => {
                     if (res) {
                         list = [...res.apps]
                         // 没有创建时间,暂时倒序
                         list.reverse()
                         this.openList = list
                         this.openMgInfo = this._.cloneDeep(this.openList[this.nowIndex])
-                        this.isLoading = false
+                        // this.isLoading = false
+                        this.getApiList()
+                        this.getWebhook()
                     }
-                }, err => {
-                    this.$Message.warning(this.$t('settings.openModal1'))
-                    setTimeout(() => {
+                },
+                (err) => {
+                    this.$Message.warning(this.$t("settings.openModal1"))
+                    /* setTimeout(() => {
                         this.isLoading = false
-                    }, 1000)
+                    }, 1000) */
+                }
+            ).finally(() => {
+                this.isLoading = false
             })
         },
         // 获取api 列表
         getApiList() {
             this.apiList = []
             let reqs = {}
-            this.$api.openMgmt.getApiList(reqs).then(res => {
+            this.$api.openMgmt.getApiList(reqs).then(
+                (res) => {
                     if (res) {
                         let list = [...res.apis]
-                        if(list.length > 0) {
+                        if (list.length > 0) {
                             // 根据auth 的大小进行排序
                             list.sort((a, b) => {
                                 return a.auth - b.auth
@@ -260,138 +328,117 @@ export default {
                         this.apiList = list
                         this.selectApi()
                     }
-                }, err => {
-                    this.$Message.warning(this.$t('settings.openModal2'))
-                    setTimeout(() => {
+                },
+                (err) => {
+                    this.$Message.warning(this.$t("settings.openModal2"))
+                    /* setTimeout(() => {
                         this.isLoadList = false
-                    }, 1000)
-            })
+                    }, 1000) */
+                }
+            )
         },
         // 获取订阅通知
         getWebhook() {
             let reqs = {}
-            this.$api.openMgmt.getWebhook(reqs).then(res => {
-                if(res) {
-                    res.webhooks.sort(function(a, b) {
+            this.$api.openMgmt.getWebhook(reqs).then((res) => {
+                if (res) {
+                    let list = res.webhooks
+                    list.sort(function (a, b) {
                         return a.auth - b.auth
                     })
-                    this.webhook = res.webhooks
+                    this.newsList = this._.cloneDeep(list)
+                    this.selectNews()
                 }
-            }).catch(err => {})
+            })
         },
         // 筛选出该应用已有的api
         selectApi() {
-            let listSel = this._.cloneDeep(this.apiList)
-            let apiNow = []
-            if(listSel.length > 0) {
-                if(this.openMgInfo.auths.length > 0) {
-                    listSel.map(item => {
-                        this.openMgInfo.auths.map(items => {
-                            if(item.auth == items) {
-                                apiNow.push({...item})
-                                item._checked = true
-                            }
-                        })
-                    })
-                }
-            }
-            let listArr = this.screenType(listSel)
-            this.apiListR = listArr.listR
-            this.apiListW = listArr.listW
-            let listSelArr = this.screenType(apiNow)
-            this.apiListSelR = listSelArr.listR
-            this.apiListSelW = listSelArr.listW
+            let schoolApi = this.apiList.filter((item) => {
+                return this.openMgInfo.auths.includes(item.auth)
+            })
+            this.apiListSelR = schoolApi.filter((item) => {
+                return item.type == "r"
+            })
+            this.apiListSelW = schoolApi.filter((item) => {
+                return item.type == "w"
+            })
         },
-        // 分出写入和读取接口
-        screenType(arr) {
-            let list = arr
-            let listArr = {
-                listR: [],
-                listW: []
-            }
-            for (let i = 0; i < list.length; i++) {
-                if(list[i].type == "r") {
-                    listArr.listR.push(list[i])
-                } else if(list[i].type == "w") {
-                    listArr.listW.push(list[i])
-                }
-            }
-            return listArr
+        // 筛选已有的通知
+        selectNews() {
+            this.newsListNow = this.newsList.filter((item) => {
+                return this.openMgInfo.webhooks.includes(item.auth)
+            })
         },
         // 编辑、新增
-        editOpen (isEdit, isAdd) {
+        editOpen(isEdit, isAdd) {
             this.isTokenShow = false
-            if(this.isEdit) {
-                return
-            } else {
+            if (!this.isEdit) {
                 this.apiListCol.unshift({
-                    type: 'selection',
+                    type: "selection",
                     width: 40,
-                    align: 'center',
+                    align: "center",
                 })
                 this.isEdit = isEdit
                 this.isAdd = isAdd
                 // 新增
-                if(isAdd) {
+                if (isAdd) {
                     var defaultInfo = {
                         auths: [],
-                        code: this.schoolCode,
+                        // code: this.schoolCode,
                         descr: null,
-                        name: this.$t('settings.opName'),
-                        school: this.schoolCode,
+                        name: this.$t("settings.opName"),
+                        // school: this.schoolCode,
                         status: 0,
+                        webhooks: [],
                     }
                     this.openList.unshift(defaultInfo)
                     this.openMgInfo = defaultInfo
                     this.nowIndex = 0
-                    let listArr = this.screenType(this.apiList)
-                    this.apiListR = listArr.listR
-                    this.apiListW = listArr.listW
                 }
             }
         },
         // 删除应用
-        delOpen () {
-            if(this.isEdit) {
-                return
-            } else {
+        delOpen() {
+            if (!this.isEdit) {
                 var titWord = this.$t("settings.delModal1") + this.openMgInfo.name + this.$t("settings.delModal2")
                 this.$Modal.confirm({
                     title: `${titWord}`,
                     onOk: () => {
+                        this.isLoading = true
                         let req = {
                             id: this.openMgInfo.id,
-                            code: this.schoolCode
+                            code: this.schoolCode,
                         }
                         this.$api.openMgmt.delOpen(req).then(
-                            res => {
+                            (res) => {
                                 this.openList.splice(this.nowIndex, 1)
-                                if(this.openList.length == this.nowIndex) {
+                                if (this.openList.length == this.nowIndex) {
                                     this.nowIndex = 0
                                 }
                                 this.openMgInfo = this._.cloneDeep(this.openList[this.nowIndex])
                                 this.selectApi()
+                                this.selectNews()
                                 this.isTokenShow = false
-                                this.$Message.success(this.$t('settings.delModal3'))
-                            }, err => {
-                                this.$Message.error(this.$t('settings.delModal4'))
-                                setTimeout(() => {
-                                    this.isLoading = false
-                                }, 1000)
+                                this.$Message.success(this.$t("settings.delModal3"))
+                            },
+                            (err) => {
+                                this.$Message.error(this.$t("settings.delModal4"))
                             }
-                        )
+                        ).finally(()=>{
+                            this.isLoading = false
+                        })
                     },
                     onCancel: () => {
-                        this.$Message.info(this.$t('settings.delModal5'));
+                        this.$Message.info(this.$t("settings.delModal5"))
                     },
                 })
             }
         },
-        list (index) {
-            if(index != this.nowIndex) {
+        list(index) {
+            if (index != this.nowIndex) {
                 this.isTokenShow = false
-                if(this.isEdit) {
-                    if(this.isAdd) {
+                if (this.isEdit) {
+                    if (this.isAdd) {
                         this.openList.splice(0, 1)
                         index = index - 1
                     }
@@ -399,74 +446,81 @@ export default {
                     this.apiListCol.splice(0, 1)
                 }
                 this.nowIndex = index
-                var info = this._.cloneDeep(this.openList[index])
-                this.openMgInfo = info
+                this.openMgInfo = this._.cloneDeep(this.openList[index])
                 this.selectApi()
+                this.selectNews()
             }
         },
         // 保存平台信息
-        keepMgmt (type) {
+        keepMgmt(type) {
             // this.isEdit = type
-            if(type) {
+            if (type) {
+                if(!this.openMgInfo.name) {
+                    this.$Message.warning("请输入应用名称")
+                    return
+                }
+                this.isLoading = true
                 let auths = []
                 let arr = this.apiListSelR.concat(this.apiListSelW)
-                if(arr.length > 0) {
-                    arr.map(item => {
+                if (arr.length > 0) {
+                    arr.map((item) => {
                         auths.push(item.auth)
                     })
                 }
-                let req = {}
-                if(this.isAdd) {
-                    req = this.openMgInfo
-                    req.auths = auths
-                } else{
-                    req = {
-                        id: this.openMgInfo.id,
-                        auths,
-                        code: this.schoolCode,
-                        descr: this.openMgInfo.descr,
-                        name: this.openMgInfo.name,
-                        school: this.schoolCode,
-                        status: this.openMgInfo.status,
-                        domain: this.openMgInfo.domain,
-                        webhookToken: this.openMgInfo.webhookToken,
-                        webhooks: this.openMgInfo.webhooks
-                    }
+                let webhooks = []
+                if (this.newsListNow.length > 0) {
+                    this.newsListNow.map((item) => {
+                        webhooks.push(item.auth)
+                    })
                 }
-                console.log(req);
-                this.$api.openMgmt.editOpenInfo(req).then(res => {
+                let req = {
+                    code: this.schoolCode,
+                    school: this.schoolCode,
+                    auths,
+                    webhooks
+                }
+                req = Object.assign(this.openMgInfo, req)
+                this.$api.openMgmt.editOpenInfo(req).then(
+                    (res) => {
                         if (res) {
-                            console.log(res.app);
+                            console.log(res.app)
                             this.openMgInfo = res.app
                             this.refreshToken()
-                            this.getOpenList()
+                            this.openList.splice(this.nowIndex, 1, this.openMgInfo)
+                            // this.getOpenList()
                             this.selectApi()
-                            this.$Message.success(this.$t('settings.keepModal1'));
+                            this.selectNews()
+                            this.$Message.success(this.$t("settings.keepModal1"))
                         }
-                    }, err => {
-                        this.$Message.warning(this.$t('settings.keepModal2'))
-                        setTimeout(() => {
-                            this.isLoading = false
-                        }, 1000)
+                    },
+                    (err) => {
+                        this.$Message.warning(this.$t("settings.keepModal2"))
+                        // setTimeout(() => {
+                        //     this.isLoading = false
+                        // }, 1000)
+                    }
+                ).finally(() => {
+                    this.isLoading = false
                 })
             } else {
-                this.openList = this.openList.filter(i => i.id)
+                this.openList = this.openList.filter((i) => i.id)
                 this.openMgInfo = this._.cloneDeep(this.openList[this.nowIndex])
                 this.selectApi()
+                this.selectNews()
             }
             this.apiListCol.splice(0, 1)
             this.isEdit = false
         },
         // 刷新token
         refresh() {
-            if(this.isTokenShow) {
+            if (this.isTokenShow) {
                 this.$Modal.confirm({
-                    title: this.$t('settings.refreshModal3'),
+                    title: this.$t("settings.refreshModal3"),
                     onOk: () => {
                         this.refreshToken()
                     },
                     onCancel: () => {
-                        this.$Message.info(this.$t('settings.refreshModal4'));
+                        this.$Message.info(this.$t("settings.refreshModal4"))
                     },
                 })
             }
@@ -474,35 +528,39 @@ export default {
         refreshToken() {
             let req = {
                 id: this.openMgInfo.id,
-                code: this.openMgInfo.school
+                code: this.openMgInfo.school,
             }
-            this.$api.openMgmt.getToken(req).then(res => {
+            this.$api.openMgmt.getToken(req).then(
+                (res) => {
                     if (res) {
                         this.openList[this.nowIndex].token = res.auth_token
                         this.openMgInfo.token = res.auth_token
-                        if(!this.isAdd) {
-                            this.$Message.success(this.$t('settings.refreshModal1'));
+                        if (!this.isAdd) {
+                            this.$Message.success(
+                                this.$t("settings.refreshModal1")
+                            )
                         }
-                        
                     }
-                }, err => {
-                    this.$Message.warning(this.$t('settings.refreshModal2'))
-                    setTimeout(() => {
+                },
+                (err) => {
+                    this.$Message.warning(this.$t("settings.refreshModal2"))
+                    /* setTimeout(() => {
                         this.isLoading = false
-                    }, 1000)
-            })
+                    }, 1000) */
+                }
+            )
         },
         copyToken() {
-            if(this.isTokenShow) {
-                var that = this;
+            if (this.isTokenShow) {
+                var that = this
                 this.$copyText(this.openMgInfo.token).then(
-                    function(e) {
-                        that.$Message.success(that.$t('settings.copyModal1'));
+                    function (e) {
+                        that.$Message.success(that.$t("settings.copyModal1"))
                     },
-                    function(e) {
-                        that.$Message.error(that.$t('settings.copyModal2'));
+                    function (e) {
+                        that.$Message.error(that.$t("settings.copyModal2"))
                     }
-                );
+                )
             }
         },
         // 写入接口
@@ -513,28 +571,28 @@ export default {
         selectionChange2(selection) {
             this.apiListSelR = selection
         },
-        selectMenu(name) {
-            console.log(name);
-            this.apiType = name
+        // 通知接口
+        selectionChange3(selection) {
+            this.newsListNow = selection
         },
-    }
+    },
 }
 </script>
 
 <style lang="less">
-    @import "./OpenMgmt2.less";
+@import "./OpenMgmt2.less";
 </style>
 
 <style lang="less">
-.open-mgmt{
-
-    .ivu-form-item:not(:first-child){
+.open-mgmt {
+    .ivu-form-item:not(:first-child) {
         margin-top: 30px;
     }
-    .ivu-form-item:last-child{
+    .ivu-form-item:last-child {
         margin-bottom: 70px;
     }
-    .ivu-radio-inner, .ivu-checkbox-inner {
+    .ivu-radio-inner,
+    .ivu-checkbox-inner {
         width: 18px;
         height: 18px;
         border-radius: 4px;
@@ -560,27 +618,27 @@ export default {
         border-color: #0094ff;
     }
 
-    .ivu-checkbox-disabled .ivu-checkbox-inner{
+    .ivu-checkbox-disabled .ivu-checkbox-inner {
         background-color: #0f0f0f;
         border-color: #4d4d4d;
     }
 
     .ivu-radio-wrapper,
-    .ivu-checkbox-wrapper{
+    .ivu-checkbox-wrapper {
         color: #a5a5a5;
     }
 
-    .ivu-checkbox{
+    .ivu-checkbox {
         margin-right: 0;
     }
 
-    .ivu-checkbox-wrapper{
+    .ivu-checkbox-wrapper {
         margin-left: 0;
         margin-right: 30px;
     }
 
-    .open-info-disabled{
-        .ivu-input{
+    .open-info-disabled {
+        .ivu-input {
             background: transparent;
             border: none;
             box-shadow: none;
@@ -590,30 +648,29 @@ export default {
         }
     }
 
-    .ivu-tabs-nav{
+    .ivu-tabs-nav {
         color: #a5a5a5;
 
-        .ivu-tabs-tab{
+        .ivu-tabs-tab {
             height: 40px;
         }
 
-        .ivu-tabs-ink-bar{
+        .ivu-tabs-ink-bar {
             border-bottom: 2px solid #1cc0f3;
         }
 
-        .ivu-tabs-tab-active{
+        .ivu-tabs-tab-active {
             font-size: 14px;
             color: #fff;
         }
 
-        .ivu-tabs-tab:hover{
+        .ivu-tabs-tab:hover {
             color: #fff;
         }
     }
 
-    .ivu-tabs-bar{
+    .ivu-tabs-bar {
         margin-left: 20px;
     }
-    
 }
 </style>

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

@@ -215,6 +215,7 @@
 					align-items: center;
 					
 					&:hover{
+						background-color: #1d1d1d;
 						.node-resource-tools{
 							display: flex;
 						}

+ 4 - 1
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -220,7 +220,7 @@
 
 		<!-- 关联内容弹窗 -->
 		<Modal v-model="isRelateContentModal" width="900" class="tree-modal add-volume-modal choose-content-modal">
-			<ChooseContent v-if="isRelateContentModal" ref="chooseContentRef" :showSyllabus="false"
+			<ChooseContent  ref="chooseContentRef" :showSyllabus="false"
 				@previewPaper="onPreviewPaper"></ChooseContent>
 			<Button slot="footer" @click="onRelateContent" style="margin-bottom: 20px;" class="modal-btn"
 				:loading="isRelateLoading">{{ $t('syllabus.confirm') }}</Button>
@@ -1358,6 +1358,9 @@
 					case 'link':
 						window.open(item.link);
 						break;
+					case 'other':
+						this.$Message.warning(this.$t('syllabus.noPreview'))
+						break;	
 					case 'doc':
 						let copyLink = JSON.parse(JSON.stringify(item.link))
 						let docSas = ''

+ 0 - 251
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/Index.less

@@ -1,251 +0,0 @@
-@main-bgColor:rgb(43,43,46); //主背景颜色
-@borderColor: #3d3d3d;
-@primary-textColor:#e0e0e0; //文本主颜色
-@second-textColor:#a5a5a5; //文本副级颜色
-@primary-fontSize:16px;
-@second-fontSize:14px;
-@title-fontSize:18px;
-
-.new-syllabus {
-
-
-    &-container {
-        height: 100%;
-        background: @main-bgColor;
-    }
-
-    &-header {
-        height:  60px;
-        border-bottom: 1px solid @borderColor;
-        .fl-row-center;
-        justify-content: space-between;
-        padding: 0 20px;
-        z-index: 1;
-
-
-        span {
-            margin-right: 10px;
-            color: @second-textColor;
-            border-bottom: 2px solid transparent;
-            font-size: @second-fontSize;
-            font-weight: bold;
-            padding: 5px 0;
-            cursor: pointer;
-        }
-
-        .tab-active {
-            border-color: @primary-textColor;
-            color: @primary-textColor;
-            font-size: @primary-fontSize;
-        }
-    }
-
-    &-content {
-        height: calc(100% - 50px);
-        width: 100%;
-        .fl-row-center;
-
-        .ns-col {
-            position: relative;
-            height: 100%;
-            overflow: hidden;
-            border-right: 1px solid @borderColor;
-
-
-
-            .ns-header {
-                padding: 0 15px;
-                height: 50px;
-                font-size: @primary-fontSize;
-                font-weight: bold;
-                color: @primary-textColor;
-                border-bottom: 1px solid @borderColor;
-
-                &-content {
-                    height: 50px;
-                    .fl-row-center;
-                    justify-content: space-between;
-                }
-            }
-
-
-            .gl {
-                width: 100%;
-                height: 100%;
-                padding: 0 0 0 10px;
-                overflow: hidden;
-                padding-bottom: 50px;
-
-
-                &-item {
-                    position: relative;
-                    width: 100%;
-                    padding: 20px 15px;
-                    border-bottom: 1px solid @borderColor;
-                    cursor: pointer;
-
-
-                    &:hover {
-                        .item-active;
-                    }
-
-                    &-name {
-                        font-size: @title-fontSize;
-                        color: @primary-textColor;
-                        font-weight: bold;
-                    }
-
-                    &-info {
-                        padding: 1px 0;
-                        font-size: @second-fontSize;
-                        color: @second-textColor;
-
-                        span {
-                            display: inline-block;
-                            width: 3px;
-                            height: 10px;
-                            margin-right: 5px;
-                            background: @second-textColor;
-                        }
-                    }
-                }
-            }
-
-            .vl {
-                .gl-item-info {
-                    span {
-                        margin-left: 5px
-                    }
-                }
-
-                .gl-item:hover {
-                    .btn-delete, .btn-edit, .btn-users {
-                        display: unset;
-                    }
-                }
-
-                .btn-delete {
-                    position: absolute;
-                    right: 30px;
-                    top: 44px;
-                    display: none;
-                }
-
-                .btn-users {
-                    position: absolute;
-                    right: 60px;
-                    top: 44px;
-                    display: none;
-                }
-
-                .btn-edit {
-                    position: absolute;
-                    right: 90px;
-                    top: 44px;
-                    display: none;
-                }
-
-                .count-nums{
-                    color:#0f9272;
-                    font-weight:bold;
-                }
-
-                .count-nums .ivu-icon{
-                    font-size:18px;
-                    color:#0f9272;
-                    margin:10px 0 0 10px;
-                }
-            }
-        }
-
-        .ns-col {
-            width: 15%;
-            // box-shadow: 6px 6px 9px 0px #000000;
-            z-index: 2;
-            // background: #171717;
-        }
-
-        .ns-col2 {
-            width: 19%;
-            // background: #202020;
-            // box-shadow: 6px 6px 9px 0px #000000;
-            z-index: 1;
-
-            .funnel-box {
-                .fl-col-center;
-                align-items: flex-start;
-                padding-bottom: 10px;
-
-                p {
-                    margin: 10px 5px;
-                }
-            }
-
-            .gl-item{
-                padding:10px 15px;
-            }
-        }
-
-        .ns-col3 {
-            width: 66%;
-            background: #2c2c2cd6;
-
-            .tree-info {
-                width: 100%;
-                height: 80px;
-                /*box-shadow: 0 0 10px 2px #212020;*/
-                padding: 0 30px;
-                justify-content: space-between;
-                .fl-row-center;
-
-                .ivu-icon {
-                    font-size: 26px;
-                    color: #fff;
-                    margin: 0 10px 0 10px;
-                }
-
-                .ivu-btn {
-                    background: transparent;
-                    border: none;
-                    color: #fff;
-                }
-
-                .tree-name {
-                    color: #fff;
-                    font-size: 22px;
-                    font-weight: bold;
-                }
-
-                .tree-version {
-                    color: #fff;
-                    font-size: 14px;
-                    letter-spacing: 1px;
-                    margin-left: 10px;
-                    font-weight: bold;
-                }
-            }
-        }
-    }
-}
-
-.fl-row-center{
-    display:flex;
-    align-items:center;
-}
-
-.fl-col-center {
-    display: flex;
-    flex-direction:column;
-    align-items: center;
-}
-
-.item-active {
-    background-image: -webkit-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-    background-image: -o-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-    background-image: -moz-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-    background-image: linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-}
-
-
-
-

+ 0 - 784
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/Index.vue

@@ -1,784 +0,0 @@
-<style lang="less" scoped>
-	@import "./Index.less";
-</style>
-
-<template>
-	<div class="new-syllabus-container">
-		<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-if="isLoading"></Loading>
-		<!-- 课纲头部 切换来源以及选择学段 -->
-		<div class="new-syllabus-header" v-if="isSchool">
-			<div class="new-syllabus-select">
-				<span>当前学段:</span>
-				<Select ref="periodSelect" v-model="currentPeriodIndex" style="width: 100px" @on-change="onPeriodChange">
-					<Option v-for="(item, index) in periodList" :value="index" :key="index">{{ item.name }}</Option>
-				</Select>
-			</div>
-		</div>
-		<!-- 课纲主体内容 -->
-		<div class="new-syllabus-content" :style="{ height: !isSchool ? '100%' : '' }">
-			<!-- 选择学科 -->
-			<div class="ns-col ns-col" v-if="isSchool">
-				<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadSubject"></Loading>
-				<div class="ns-header">
-					<!-- 切换头部以及搜索框 -->
-					<div class="ns-header-content" v-if="!isSearchSubject">
-						<span>
-							<Icon type="md-bookmark" color="#fff" size="20" />
-							<span style="margin-left: 5px">学科</span>
-						</span>
-						<Icon type="ios-search" color="#fff" size="18" style="cursor: pointer" @click="isSearchSubject = true" v-show="subjectList.length" />
-					</div>
-					<div class="ns-header-search" v-else>
-						<Input icon="ios-close" v-model="searchSubject" placeholder="搜索学科..." autofocus style="width: 100%" @on-click="onSearchSubjectClose"
-						 @on-change="onSearchSubjectChange" @on-enter="onSearchSubjectChange" />
-					</div>
-				</div>
-				<vuescroll>
-					<div v-if="subjectList.length === 0">
-						<EmptyData :top="50"></EmptyData>
-					</div>
-					<div class="gl">
-						<div :class="[
-                'gl-item',
-                index == activeSubjectIndex ? 'item-active' : '',
-              ]"
-						 v-for="(item, index) in subjectList" :key="index" @click="
-                hasModify
-                  ? handleConfirmSave({ index }, '2')
-                  : handleSubjectTap(index)
-              ">
-							<p class="gl-item-name">{{ item.name }}</p>
-							<p class="gl-item-info">
-								<span></span>册别数:0 {{ tabIndex === 0  ? schoolVolCount[index]  : privateVolCount[index]  }}
-							</p>
-						</div>
-					</div>
-				</vuescroll>
-			</div>
-			<!-- 选择册别 -->
-			<div class="ns-col ns-col2">
-				<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadVolumes"></Loading>
-				<div class="ns-header">
-					<!-- 切换头部以及搜索框 -->
-					<div class="ns-header-content" v-if="!isSearchVolume">
-						<span>
-							<Icon type="md-bookmarks" color="#fff" size="20" />
-							<span style="margin-left: 5px">册别</span>
-						</span>
-						<div>
-							<Icon type="md-add" v-if="($access.can('admin.*|Volumn_Add') || !isSchool)" color="#fff" size="18" style="cursor: pointer; margin-right: 10px"
-							 @click="onAddVolume" />
-							<Poptip title="筛选册别" placement="bottom-end" @on-popper-show="onPopperShow" v-if="isSchool">
-								<Icon type="ios-funnel" color="#fff" size="18" style="cursor: pointer; margin-right: 10px" />
-								<div class="funnel-box" slot="content">
-									<p>年级</p>
-									<Select v-model="filterGrade" style="width: 200px" @on-change="onFilterGrade">
-										<Option v-for="(item, index) in gradeList" :value="item.id" :key="index">{{ item.name }}</Option>
-									</Select>
-									<p>学期</p>
-									<Select v-model="filterSemester" style="width: 200px" @on-change="onFilterSemester">
-										<Option v-for="(item, index) in semesterList" :value="item.id" :key="index">{{ item.name }}</Option>
-									</Select>
-								</div>
-							</Poptip>
-							<Icon type="ios-search" color="#fff" size="18" style="cursor: pointer" @click="isSearchVolume = true" v-show="volumeList.length" />
-						</div>
-					</div>
-					<div class="ns-header-search" v-else>
-						<!-- 搜索册别部分 -->
-						<Input icon="ios-close" v-model="searchVolume" placeholder="搜索册别..." autofocus style="width: 100%" @on-click="onSearchVolumeClose"
-						 @on-change="onSearchVolumeChange" @on-enter="onSearchVolumeChange" />
-					</div>
-				</div>
-				<vuescroll>
-					<!-- 册别列表 -->
-					<div class="vl gl">
-						<div v-if="volumeList.length === 0">
-							<EmptyData :top="50"></EmptyData>
-						</div>
-						<div v-else>
-							<div :class="[
-                  'gl-item',
-                  index == activeVolumeIndex ? 'item-active' : '',
-                ]"
-							 v-for="(item, index) in volumeList" :key="index" @click="
-                  hasModify
-                    ? handleConfirmSave({ index, item }, '1')
-                    : handleVolumeTap(index, item)
-                ">
-								<p class="gl-item-name" :style="{ margin: !isSchool ? '10px 0' : '' }">
-									{{ item.volumeName }}
-								</p>
-								<p class="gl-item-info" v-if="isSchool">
-									{{ item.gradeName }}<span></span>{{ item.semesterName }}
-								</p>
-								<p class="gl-item-info" v-if="isSchool">
-									共编使用者:{{ item.editors ? item.editors.length : "0" }}
-								</p>
-								<div class="count-nums">
-									<Icon type="md-folder" title="内容资源数" style="margin-left: 0" />
-									{{ item.resourceCount }}
-									<Icon type="md-cube" title="关联题目数" />
-									{{ item.itemCount }}
-								</div>
-								<span class="btn-edit" :style="{ right: !isSchool ? '60px' : '90px' }" v-if="$access.can('admin.*|Volumn_Edit') || !isSchool"
-								 title="编辑" @click.stop="onEditVolume(item)">
-									<Icon type="md-create" size="20" color="#d2d2d2" /></span>
-								<span class="btn-users" v-if="$access.can('admin.*|Volumn_Edit') && isSchool" title="共编使用者管理" @click.stop="onEditEditors(item)">
-									<Icon type="md-people" size="22" color="#d2d2d2" /></span>
-								<span class="btn-delete" v-if="$access.can('admin.*|Volumn_Delete') || !isSchool" title="删除" @click.stop="onDeleteVolume(item)">
-									<Icon type="md-trash" size="22" color="#d2d2d2" /></span>
-							</div>
-						</div>
-					</div>
-				</vuescroll>
-			</div>
-			<!-- 展示课纲树形结构部分 -->
-			<div class="ns-col ns-col3" :style="{ width: !isSchool ? '81%' : '66%' }">
-				<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadSyllabus"></Loading>
-
-				<div v-if="volumeList.length === 0">
-					<EmptyData :top="100"></EmptyData>
-				</div>
-				<div v-else>
-					<div class="tree-info">
-						<div>
-							<Icon type="ios-book" />
-							<span class="tree-name">{{
-                volumeList[activeVolumeIndex].volumeName
-              }}</span>
-						</div>
-						<div>
-							<Button @click="onSaveSyllabus" type="text" :disabled="!hasModify" icon="md-folder" v-if="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1">存储变更</Button>
-						</div>
-					</div>
-					<Tree :volume="currentVolume" :treeData="treeData" ref="treeRef" :editable="$access.can('admin.*|Syllabus_Edit') || tabIndex === 1"
-					 @onTreeUpdate="onTreeUpdate"></Tree>
-				</div>
-			</div>
-		</div>
-
-		<!-- 新增册别弹窗 -->
-		<Modal v-model="isAddVolume" width="560" footer-hide class="add-volume-modal">
-			<div class="modal-header" slot="header">
-				{{ isEditVolume ? "编辑册别" : "新增册别" }}
-			</div>
-			<div class="modal-content">
-				<AddVolume :originData="originSchoolData" :periodIndex="currentPeriodIndex" :subjectIndex="currentSubjectIndex"
-				 :addType="addType" :editVolume="editVolume" @addFinish="onFinishAddVolume">
-				</AddVolume>
-			</div>
-		</Modal>
-
-		<!-- 共编使用者弹窗 -->
-		<Modal v-model="isEditEditors" width="760" footer-hide class="add-volume-modal">
-			<div class="modal-header" slot="header">共编使用者管理</div>
-			<div class="modal-content">
-				<AddEditors :editVolume="editVolume" @addFinish="onFinishAddVolume"></AddEditors>
-			</div>
-		</Modal>
-	</div>
-</template>
-
-<script>
-	import Tree from "@/components/syllabus/DragTree";
-	import AddVolume from "./operation/AddVolume";
-	import AddEditors from "./operation/AddEditors";
-	export default {
-		data() {
-			return {
-				isSchool: false,
-				currentParams: {
-					// 默认API传递参数
-					code: "",
-					periodId: "",
-					subjectId: "",
-					type: 0,
-					status: 1,
-				},
-				addType: "school",
-				isLoadSubject: false,
-				isLoadVolumes: false,
-				isLoadSyllabus: false,
-				isLoading: false,
-				volumnCounts: [],
-				currentPeriodIndex: null,
-				currentSubjectIndex: null,
-				currentVolume: null,
-				tabIndex: 0,
-				originData: {},
-				originSchoolData: {},
-				schoolVolCount: [], // 校本科目册别数量
-				privateVolCount: [], //个人科目册别数量
-				periodList: [],
-				gradeList: [],
-				semesterList: [],
-				subjectList: [],
-				originSubjectList: [],
-				volumeList: [],
-				originVolumeList: [],
-				treeData: [], // 课纲数据
-				activePeriodIndex: 0,
-				activeSubjectIndex: 0,
-				activeVolumeIndex: 0,
-				isSearchSubject: false,
-				isSearchVolume: false,
-				isAddVolume: false,
-				isEditVolume: false,
-				filterGrade: "all",
-				filterSemester: "all",
-				searchVolume: "",
-				searchSubject: "",
-				editVolume: null,
-				hasModify: false,
-				preSelectVal: null,
-				isEditEditors: false,
-			};
-		},
-		components: {
-			Tree,
-			AddVolume,
-			AddEditors,
-		},
-		created() {
-			/* 判断当前是个人课纲还是校本课纲 */
-			this.isSchool = this.$route.name === "syllabus";
-			if (this.isSchool) {
-				// 校本课纲 则通过学段科目信息区进行查询
-				this.initSchoolData().then((res) => {
-					this.initSyllabusCount();
-				});
-			} else {
-				// 个人课纲则直接根据老师CODE去查询所有个人册别
-				this.getVolumesData();
-			}
-		},
-		methods: {
-			// 获取当前学校学段学科等基本信息
-			initSchoolData() {
-				return new Promise((r, j) => {
-					this.$store.dispatch("user/getSchoolProfile").then((res) => {
-						let schoolBaseInfo = res.school_base;
-						if (schoolBaseInfo) {
-							this.originSchoolData = schoolBaseInfo; // 默认选择第一个
-							this.originData = schoolBaseInfo; // 默认选择第一个
-							if (schoolBaseInfo.period.length) {
-								this.periodList = schoolBaseInfo.period;
-								this.currentParams.code = schoolBaseInfo.id;
-								this.currentParams.periodId = schoolBaseInfo.period[0].id;
-								this.currentPeriodIndex = 0; // 默认选择第一个学段
-								this.onPeriodChange(0);
-							}
-						}
-					});
-				});
-			},
-
-			// 获取当前册别数量
-			initSyllabusCount() {
-				return;
-				if (this.volumnCounts.length) {
-					this.schoolVolCount = this.volumnCounts[this.currentPeriodIndex].map(
-						(i) => i[0]
-					);
-					this.privateVolCount = this.volumnCounts[this.currentPeriodIndex].map(
-						(i) => i[1]
-					);
-				} else {
-					this.$api.syllabus
-						.FindSyllabusCount({
-							code: this.$store.state.userInfo.schoolCode,
-						})
-						.then((res) => {
-							if (!res.error) {
-								this.$nextTick(() => {
-									this.volumnCounts = res;
-									this.schoolVolCount = res[this.currentPeriodIndex || 0].map(
-										(i) => i[0]
-									);
-									this.privateVolCount = res[this.currentPeriodIndex || 0].map(
-										(i) => i[1]
-									);
-								});
-							} else {
-								this.$Message.warning("获取数据失败");
-							}
-						});
-				}
-			},
-
-			// 根据学科获取所有册别信息
-			getVolumesData() {
-				let that = this;
-				this.currentParams.type = this.isSchool ? 0 : 1;
-				this.currentParams.code = this.isSchool ?
-					this.$store.state.userInfo.schoolCode :
-					this.$store.state.userInfo.TEAMModelId;
-				if (!this.isSchool) {
-					// 个人课纲 则规定查询参数
-					this.currentParams.periodId = null;
-					this.currentParams.gradeId = null;
-					this.currentParams.subjectId = null;
-				}
-				this.$api.syllabus.GetVolumes(this.currentParams).then((res) => {
-					if (res.volumes) {
-						let list = res.volumes;
-						list.forEach((item, index) => {
-							// 如果是校本册别 则需要匹配年级学期等信息
-							if (item.type === 0) {
-								const matchGrade = this.periodList[
-									this.currentPeriodIndex
-								].grades.filter((grade) => grade.id === item.gradeId);
-								const matchSemester = this.periodList[
-									this.currentPeriodIndex
-								].semesters.filter((semester) => semester.id === item.semesterId);
-								/* 如果匹配的到区班校信息则换取年级以及学期信息 如果匹配不要就说明 是旧数据 不做显示 */
-								if (matchGrade.length) {
-									item.gradeName = matchGrade[0].name;
-									item.semesterName = matchSemester[0].name;
-								} else {
-									list.splice(index, 1);
-								}
-							}
-						});
-						this.volumeList = list;
-						this.originVolumeList = list;
-						this.handleVolumeTap(0, list.length > 0 ? list[0] : null);
-						this.searchVolume = "";
-						setTimeout(function() {
-							that.isLoadVolumes = false;
-						}, 400);
-					} else {
-						this.$Message.warning("当前科目无册别数据");
-						that.isLoadVolumes = false;
-					}
-				});
-			},
-
-			// 根据册别CODE来获取对应树形课纲数据
-			getTreeByVolume(volumeCode) {
-				let that = this;
-				this.$api.syllabus
-					.GetTreeByVolume({
-						code: volumeCode,
-					})
-					.then((res) => {
-						if (!res.error && res) {
-							this.treeData = res;
-							setTimeout(function() {
-								that.isLoadSyllabus = false;
-							}, 400);
-						} else {
-							this.$Message.warning("获取数据失败");
-						}
-					});
-			},
-
-			// 校本课纲与个人课纲切换
-			//         async handleTabClick(index) {
-			//             this.tabIndex = index
-			//             this.currentParams.type = index
-			//             if (index === 0 && this.currentParams.TEAMModelId) {
-			//                 delete this.currentParams.TEAMModelId
-			//             } else {
-			//                 this.currentParams.TEAMModelId = this.$store.state.userInfo.TEAMModelId
-			//             }
-			//             this.addType = index === 0 ? 'school' : 'private'
-			// if(!this.periodList.length){
-			// 	await this.initSchoolData()
-			// }
-			// if(this.isSchool){
-			// 	this.onPeriodChange(this.currentPeriodIndex)
-			// }else{
-			// 	this.getVolumesData()
-			// }
-			//         },
-
-			// 学段 切换处理
-			onPeriodChange(index) {
-				if (this.$refs.periodSelect) {
-					this.preSelectVal = this.$refs.periodSelect.value;
-				}
-				if (this.hasModify) {
-					this.handleConfirmSave({}, "3");
-				} else {
-					let that = this;
-					this.isLoadSubject = true;
-					this.activePeriodIndex = index;
-					this.currentParams.periodId = this.originData.period[index].id;
-					this.subjectList = JSON.parse(
-						JSON.stringify(this.periodList[index].subjects)
-					); // 切换学段后更新 学科 列表
-					this.originSubjectList = JSON.parse(
-						JSON.stringify(this.periodList[index].subjects)
-					); // 筛选学科源数据
-					this.gradeList = JSON.parse(
-						JSON.stringify(this.periodList[index].grades)
-					); // 切换学段后更新 年级 列表
-					this.semesterList = JSON.parse(
-						JSON.stringify(this.periodList[index].semesters)
-					); // 切换学段后更新 学期 列表
-					if (this.subjectList.length) {
-						this.handleSubjectTap(0);
-						this.initSyllabusCount();
-					} else {
-						this.volumeList = [];
-					}
-
-					this.searchSubject = "";
-					setTimeout(function() {
-						that.isLoadSubject = false;
-					}, 400);
-				}
-			},
-
-			// 学科点击事件
-			handleSubjectTap(index) {
-				this.isLoadVolumes = true;
-				this.currentSubjectIndex = index;
-				this.currentParams.subjectId = this.subjectList[index].id;
-				this.activeSubjectIndex = index;
-				this.getVolumesData();
-			},
-
-			// 册别点击事件
-			handleVolumeTap(index, volume) {
-				this.activeVolumeIndex = index;
-				this.currentVolume = volume;
-				if (volume) {
-					this.isLoadSyllabus = true;
-					this.getTreeByVolume(volume.volumeCode);
-				}
-			},
-
-			// 添加册别完成
-			onFinishAddVolume(val) {
-				if (val) {
-					let isExist = this.volumeList.filter((item) => item.id === val).length; // 判断列表是否已存在该学期下的册别,有则更新,无则添加
-					if (isExist) {
-						this.$Message.success("更新成功");
-					} else {
-						this.$Message.success("添加新册别成功");
-						this.volumnCounts = [];
-						this.filterGrade = "all";
-						this.filterSemester = "all";
-					}
-
-					if (this.isSchool) {
-						this.handleSubjectTap(this.currentSubjectIndex); // 获取最新册别数据
-						this.initSyllabusCount();
-					} else {
-						this.getVolumesData();
-					}
-				}
-				this.isAddVolume = false; // 关闭窗口
-			},
-
-			// 删除册别事件
-			onDeleteVolume(data) {
-				data.status = 0;
-				this.$Modal.confirm({
-					title: "删除学科",
-					content: "<p>确认删除该册别?</p>",
-					okText: "确认",
-					cancelText: "取消",
-					onOk: () => {
-						this.isLoading = true;
-						this.$api.syllabus.DeleteVolume(data).then((res) => {
-							if (res) {
-								this.volumeList.splice(this.volumeList.indexOf(data), 1);
-								this.$Message.success("删除成功");
-								this.handleVolumeTap(
-									0,
-									this.volumeList.length ? this.volumeList[0] : null
-								);
-								this.volumnCounts = [];
-								this.initSyllabusCount();
-								this.isLoading = false;
-							} else {
-								this.$Message.success("删除失败");
-							}
-						});
-					},
-				});
-			},
-
-			// 编辑册别事件
-			onEditVolume(data) {
-				this.isAddVolume = true; // 打开新增窗口
-				this.isEditVolume = true; // 设置成编辑状态
-				this.editVolume = data;
-			},
-
-			// 新增册别事件
-			onAddVolume() {
-				this.isAddVolume = true;
-				this.isEditVolume = false;
-				this.editVolume = null;
-			},
-
-			// 管理共编使用者
-			onEditEditors(data) {
-				this.editVolume = data;
-				this.isEditEditors = true;
-			},
-
-			// 筛选年级事件
-			onFilterGrade(val) {
-				if (val === "all" && this.filterSemester === "all") {
-					this.volumeList = this.originVolumeList;
-				} else if (val !== "all" && this.filterSemester === "all") {
-					this.volumeList = this.originVolumeList.filter(
-						(item) => item.gradeId === val
-					);
-				} else if (val === "all" && this.filterSemester !== "all") {
-					this.volumeList = this.originVolumeList.filter(
-						(item) => item.semesterId === this.filterSemester
-					);
-				} else {
-					this.volumeList = this.originVolumeList.filter(
-						(item) =>
-						item.semesterId === this.filterSemester && item.gradeId === val
-					);
-				}
-
-				this.handleVolumeTap(
-					0,
-					this.volumeList.length > 0 ? this.volumeList[0] : null
-				); // 筛选完成 默认加载筛选结果第一个册别课纲
-			},
-
-			// 筛选学期事件
-			onFilterSemester(val) {
-				if (val === "all" && this.filterGrade === "all") {
-					this.volumeList = this.originVolumeList;
-				} else if (val !== "all" && this.filterGrade === "all") {
-					this.volumeList = this.originVolumeList.filter(
-						(item) => item.semesterId === val
-					);
-				} else if (val === "all" && this.filterGrade !== "all") {
-					this.volumeList = this.originVolumeList.filter(
-						(item) => item.gradeId === this.filterGrade
-					);
-				} else {
-					this.volumeList = this.originVolumeList.filter(
-						(item) => item.gradeId === this.filterGrade && item.semesterId === val
-					);
-				}
-
-				this.handleVolumeTap(
-					0,
-					this.volumeList.length > 0 ? this.volumeList[0] : null
-				); // 筛选完成 默认加载筛选结果第一个册别课纲
-			},
-
-			// 搜索册别输入框onchange事件
-			onSearchVolumeChange() {
-				this.volumeList = this.originVolumeList.filter(
-					(item) => item.volumeName.indexOf(this.searchVolume) > -1
-				);
-				if (this.volumeList.length) this.handleVolumeTap(0, this.volumeList[0]); // 获取筛选后的第一个册别课纲数据
-			},
-
-			// 清空科目搜索框
-			onSearchSubjectClose() {
-				this.searchSubject = "";
-				this.isSearchSubject = false;
-				this.subjectList = this.originSubjectList;
-				this.handleSubjectTap(0);
-			},
-
-			// 清空册别搜索框
-			onSearchVolumeClose() {
-				this.searchVolume = "";
-				this.isSearchVolume = false;
-				this.volumeList = this.originVolumeList;
-				this.handleVolumeTap(0, this.volumeList[0]);
-			},
-
-			// 搜索学科输入框onchange事件
-			onSearchSubjectChange() {
-				this.subjectList = this.originSubjectList.filter(
-					(item) => item.name.indexOf(this.searchSubject) > -1
-				);
-				if (this.subjectList.length) {
-					this.handleSubjectTap(0);
-				} else {
-					this.volumeList = [];
-					this.treeData = [];
-				}
-			},
-
-			// 显示后添加全部选项
-			onPopperShow() {
-				if (!this.gradeList.filter((item) => item.id === "all").length) {
-					this.gradeList.unshift({
-						name: "全部",
-						id: "all",
-					});
-					this.filterGrade = "all";
-				}
-				if (
-					!this.semesterList.filter((item) => item.semesterId === "all").length
-				) {
-					this.semesterList.unshift({
-						name: "全部",
-						id: "all",
-					});
-					this.filterSemester = "all";
-				}
-			},
-
-			// 存储变更保存最新课纲数据
-			onSaveSyllabus() {
-				this.isLoadSyllabus = true;
-				let latestTree = this.$refs.treeRef.treeDatas[0].children;
-				this.$api.syllabus.SaveOrUpdateAsTree(latestTree).then((res) => {
-					if (!res.error && res) {
-						this.treeData = res;
-						this.isLoadSyllabus = false;
-						this.hasModify = false;
-						this.$Message.success("保存成功");
-					} else {
-						this.$Message.warning("获取数据失败");
-					}
-				});
-			},
-
-			// 更新当前课纲数据
-			onTreeUpdate() {
-				this.handleVolumeTap(this.activeVolumeIndex, this.currentVolume);
-				this.$Message.success("更新完成");
-			},
-
-			// 判断用户是否放弃修改
-			handleConfirmSave(param, type) {
-				this.$Modal.confirm({
-					title: "修改提示",
-					content: "<p>您有未保存的课纲,将会丢失所有更改,确认放弃修改?</p>",
-					okText: "确认",
-					cancelText: "取消",
-					onOk: () => {
-						this.hasModify = false;
-						switch (type) {
-							case "1":
-								this.handleVolumeTap(param.index, param.item);
-								break;
-							case "2":
-								this.handleSubjectTap(param.index);
-								break;
-							case "3":
-								this.onPeriodChange(this.currentPeriodIndex);
-								break;
-							default:
-								break;
-						}
-					},
-					onCancel: () => {
-						switch (type) {
-							case "3":
-								this.currentPeriodIndex = this.preSelectVal;
-								break;
-							default:
-								break;
-						}
-					},
-				});
-			},
-		},
-		mounted() {},
-		watch: {
-			$route: {
-				handler: function(to, from) {
-					// this.handleTabClick(this.$route.name === 'syllabus' ? 0 : 1)
-				},
-				immediate: true,
-			},
-		},
-	};
-</script>
-
-<style>
-	.new-syllabus-header .ivu-select-single .ivu-select-selection,
-	.funnel-box .ivu-select-single .ivu-select-selection {
-		background: transparent;
-		color: #fbfbfb;
-		border: 1px solid #424242;
-	}
-
-	.ns-header-search {
-		line-height: 50px;
-	}
-
-	.ns-header .ivu-input {
-		background: #3c3c3c;
-		color: #fff;
-		border: none;
-		height: 35px;
-	}
-
-	.ns-header .ivu-input-icon {
-		font-size: 20px;
-		color: #cfc7c7;
-		line-height: 32px;
-		cursor: pointer;
-	}
-
-	.new-syllabus-header .ivu-select-single .ivu-select-arrow,
-	.funnel-box .ivu-select-single .ivu-select-arrow {
-		color: #fbfbfb;
-	}
-
-	.new-syllabus-header .ivu-input {
-		background: #3c3c3c;
-		color: #fff;
-		border: none;
-		height: 36px;
-		margin-top: 6px;
-	}
-
-	.new-syllabus-content .ns-header .ivu-input-icon {
-		font-size: 24px;
-		color: #cfc7c7;
-		line-height: 40px;
-		cursor: pointer;
-	}
-
-	/* 修改iview Modal样式 */
-
-	.add-volume-modal .ivu-modal-content {
-		background: #3c3c3c;
-		color: #fff;
-	}
-
-	.add-volume-modal .ivu-modal-header {
-		border-bottom: none;
-		font-size: 18px;
-		font-weight: bold;
-		padding: 25px;
-	}
-
-	.add-volume-modal .modal-content {
-		padding: 10px 35px 30px 35px;
-	}
-
-	/* 修改iview popper样式 */
-
-	.ns-col .ivu-poptip-inner {
-		background: #3c3c3c;
-	}
-
-	.ns-col .ivu-poptip-title:after {
-		background: #656565;
-		left: 16px;
-		right: 20px;
-	}
-
-	.ns-col .ivu-poptip-title-inner {
-		color: #fff;
-	}
-
-	.ns-col .ivu-poptip-popper[x-placement^="bottom"] .ivu-poptip-arrow:after {
-		border-bottom-color: #494949;
-	}
-</style>

+ 0 - 145
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/AddEditors.vue

@@ -1,145 +0,0 @@
-
-<template>
-    <div class="editor-container">
-        <p>当前册别 : <span class="volume-name">{{ editVolumeItem.volumeName }}</span></p>
-        <div class="fl-row-center" style="width:100%">
-            <div style="width:45%">
-                <p class="title">当前共编使用者</p>
-                <div class="show-wrap">
-                    <p v-for="(item,index) in currentList" :key="index">
-                        {{item}}
-                    </p>
-                </div>
-            </div>
-            <div class="tools">
-                <Button class="btn-move">移动  <Icon type="ios-arrow-forward" /></Button>
-            </div>
-            <div style="width:45%">
-                <p class="title">选择共编使用者</p>
-                <div class="show-wrap select-wrap">
-
-                </div>
-            </div>
-            </div>
-            <Button @click="handleSubmit" :loading="isLoading" class="btn-confirm">确认</Button>
-        </div>
-</template>
-
-<script>
-    export default {
-        props: ['editVolume'],
-        data() {
-            return {
-                editVolumeItem: {},
-                isLoading: false,
-                currentList: []
-            }
-        },
-        created() {
-
-        },
-        methods: {
-            // 提交添加
-            handleSubmit() {
-                this.isLoading = true
-                let params = {
-                    type: this.addVolumeType === 'school' ? 0 : 1,
-                    schoolCode: this.originDatas.schoolCode,
-                    periodCode: this.currentPeriod.periodCode,
-                    subjectCode: this.formTop.subject,
-                    gradeCode: this.formTop.grade,
-                    semesterCode: this.formTop.semester,
-                    volumeName: this.getNewVolumeName(),
-                    status: 1
-                }
-                if (this.editVolumeItem) {
-                    params.id = this.editVolumeItem.id
-                    params.volumeCode = this.editVolumeItem.volumeCode
-                }
-                if (this.addVolumeType === 'private') {
-                    params.TEAMModelId = this.$store.state.userInfo.TEAMModelId
-                }
-                this.$api.syllabus.SaveOrUpdateVolume(params).then(res => {
-                    if (!res.error && res.result.data) {
-                        this.$emit('addFinish', res.result.data.id)
-                    } else {
-                        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-                    }
-                    this.isLoading = false
-                    this.closeModal()
-                    this.editVolumeItem = {}
-                }).catch(err => {
-                    console.log(err)
-                    this.$Message.warning('操作失败')
-                    this.isLoading = false
-                })
-            },
-
-            // 添加完成 关闭窗口
-            closeModal() {
-                this.$emit('addFinish', false)
-                this.formTop.volume = ''
-            }
-        },
-        mounted() {
-        },
-        watch: {
-
-            editVolume: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.editVolumeItem = newValue
-                        console.log(newValue)
-                    }
-                }
-            }
-        }
-
-    }
-</script>
-
-<style>
-    .editor-container .volume-name{
-        font-size:16px;
-        margin-left:20px;
-    }
-
-    .editor-container .title {
-        margin:20px 0;
-    }
-
-    .editor-container .show-wrap {
-        width:100%;
-        height:420px;
-        background:#565656;
-        border-radius:6px;
-    }
-
-    .editor-container .btn-confirm {
-        width: 100%;
-        height: 40px;
-        margin-top:20px;
-        background: rgb(11, 151, 117);
-        border: none;
-        color:#fff;
-    }
-
-    .editor-container .btn-move {
-        width: 70px;
-        height: 30px;
-        background: #808080;
-        border: none;
-        color:#fff;
-    }
-
-    .editor-container .tools {
-        margin: 0 20px;
-    }
-
-    .fl-row-center {
-        display:flex;
-        flex-direction:row;
-        justify-content:space-between;
-        align-items:center;
-    }
-</style>

+ 0 - 206
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/AddVolume.vue

@@ -1,206 +0,0 @@
-
-<template>
-    <div class="form-container">
-        <Form :model="formTop" label-position="top">
-            <FormItem label="科目" v-if="isSchool">
-                <Select v-model="formTop.subject" disabled>
-                    <Option v-for="(item,index) in currentPeriod.subjects" :value="item.id" :key="index">{{ item.name }}</Option>
-                </Select>
-            </FormItem>
-            <FormItem label="年级" v-if="isSchool">
-                <Select v-model="formTop.grade">
-                    <Option v-for="(item,index) in currentPeriod.grades" :value="item.id" :key="index">{{item.name}}</Option>
-                </Select>
-            </FormItem>
-            <FormItem label="学期" v-if="isSchool">
-                <Select v-model="formTop.semester">
-                    <Option v-for="(item,index) in currentPeriod.semesters" :value="item.id"  :key="index">{{item.name}}</Option>
-                </Select>
-            </FormItem>
-            <FormItem label="名称">
-                <Input v-if="isSchool" v-model="formTop.volume" placeholder="非必填,默认由年级+科目+学期组成..."></Input>
-                <Input v-else v-model="formTop.volume" placeholder="填写册别名称"></Input>
-            </FormItem>
-            <FormItem>
-                <Button @click="handleSubmit" :loading="isLoading">确认</Button>
-            </FormItem>
-        </Form>
-    </div>
-</template>
-
-<script>
-    export default {
-        props: ['originData', 'periodIndex', 'subjectIndex', 'editVolume', 'addType'],
-        data() {
-            return {
-				isSchool:false,
-                originDatas: {},
-                currentPeriod: {},
-                editItem: null,
-                addVolumeType: 'school',
-                isLoading: false,
-                formTop: {
-                    subject: '',
-                    grade: '',
-                    semester: '',
-                    volume: ''
-                }
-            }
-        },
-        created() {
-			this.isSchool = this.$route.name === 'syllabus'
-			if(this.originData && this.originData.period){
-				this.currentPeriod = this.originData.period[this.periodIndex]
-				this.originDatas = this.originData
-			}
-        },
-        methods: {
-            // 提交添加
-            handleSubmit() {
-                this.isLoading = true
-				const isSchool = this.$route.name === 'syllabus'
-                let params = {
-                    type:  isSchool ? 0 : 1,
-                    code: isSchool ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
-					scope: isSchool ? 'school' : 'private',
-                    periodId: isSchool ? this.currentPeriod.id : null,
-                    subjectId: isSchool ? this.formTop.subject : null,
-                    gradeId: isSchool ? this.formTop.grade : null,
-                    semesterId: isSchool ? this.formTop.semester : null,
-                    volumeName: this.getNewVolumeName(),
-                    status: 1
-                }
-                if (this.editItem && this.editItem.id && this.editItem.code) {
-                    params.id = this.editItem.id
-                    params.code = this.editItem.code
-                    params.ttl = this.editItem.ttl
-                    params.pk = this.editItem.pk
-                    params.volumeCode = this.editItem.volumeCode
-                }
-                if (this.$route.name === 'personalSyllabus') {
-                    params.TEAMModelId = this.$store.state.userInfo.TEAMModelId
-                }
-                this.$api.syllabus.SaveOrUpdateVolume(params).then(res => {
-                    if (!res.error && res) {
-                        this.$emit('addFinish', res.volume.id)
-                    } else {
-                        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.v)
-                    }
-                    this.isLoading = false
-                    this.closeModal()
-                    this.editItem = null
-                }).catch(err => {
-                    console.log(err)
-                    this.$Message.warning('操作失败')
-                    this.isLoading = false
-                })
-            },
-
-            // 获取新册别名称
-            getNewVolumeName() {
-                if (this.formTop.volume) {
-                    return this.formTop.volume
-                } else {
-                    let subject = this.currentPeriod.subjects[this.subjectIndex].name
-                    let grade = this.currentPeriod.grades.filter(item => item.id === this.formTop.grade)[0].name
-                    let semester = this.currentPeriod.semesters.filter(item => item.id === this.formTop.semester)[0].name
-                    return subject + grade + semester
-                }
-            },
-
-            // 添加完成 关闭窗口
-            closeModal() {
-                this.$emit('addFinish', false)
-                this.formTop.volume = ''
-            }
-        },
-        mounted() {
-        },
-        watch: {
-            addType: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.addVolumeType = newValue
-                    }
-                }
-            },
-            originData: {
-                handler(newValue, oldValue) {
-                    this.originDatas = newValue
-            console.log(this.originData)
-
-                }
-            },
-            periodIndex: {
-                handler(newValue, oldValue) {
-                    this.currentPeriod = this.originDatas.period[newValue]
-                    this.formTop.subject = this.currentPeriod.subjects.length ? this.currentPeriod.subjects[0].id : ''
-                    this.formTop.grade = this.currentPeriod.grades.length ? this.currentPeriod.grades[0].id : ''
-                    this.formTop.semester = this.currentPeriod.semesters.length ? this.currentPeriod.semesters[0].id : ''
-                    this.formTop.volume = ''
-                    console.log(this.currentPeriod)
-                }
-            },
-            subjectIndex: {
-                handler(newValue, oldValue) {
-                    this.formTop.subject = this.currentPeriod.subjects ? this.currentPeriod.subjects[newValue].id : ''
-                }
-            },
-            editVolume: {
-                handler(newValue, oldValue) {
-                    if (newValue) { // 有编辑册别传过来则为编辑状态
-                        this.editItem = newValue
-                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
-                        this.formTop.grade = this.formTop.grade || this.currentPeriod.grades[0].id
-                        this.formTop.semester = this.formTop.semester || this.currentPeriod.semesters[0].id
-                        this.formTop.volume = newValue.volumeName
-                    } else { // 否则为新增状态
-                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
-                        this.formTop.grade = this.formTop.grade || this.currentPeriod.grades[0].id
-                        this.formTop.semester = this.formTop.semester || this.currentPeriod.semesters[0].id
-                        this.formTop.volume = ''
-                        this.editItem = newValue
-                    }
-                }
-            }
-        }
-
-    }
-</script>
-
-<style>
-    .form-container .ivu-form .ivu-form-item-label {
-        color: #fff;
-        margin:10px 0;
-        font-size:16px;
-    }
-
-    .form-container .ivu-input {
-        background: #575757;
-        border-color: transparent;
-        height: 35px;
-        color:#fff;
-    }
-    .form-container .ivu-input::-webkit-input-placeholder {
-        color:#808080;
-    }
-
-    .form-container .ivu-select-single .ivu-select-selection {
-        background: #575757;
-        color: #fbfbfb;
-        border-color: transparent;
-        height: 35px;
-    }
-
-    .form-container .ivu-select-single .ivu-select-arrow {
-        color: #fbfbfb;
-    }
-
-    .form-container .ivu-btn {
-        width: 100%;
-        height: 40px;
-        background: rgb(11, 151, 117);
-        border: none;
-        color:#fff;
-    }
-</style>

+ 0 - 151
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/BaseKnowledge.less

@@ -1,151 +0,0 @@
-.knowledge-container {
-    width: 100%;
-    height: 100%;
-    background: #464646;
-    border-radius: 4px;
-    overflow: hidden;
-
-
-    .select-wrap {
-        width: 100%;
-        height: 60%;
-
-        .ns-header-search {
-            width: 400px;
-            margin-right: 15px;
-        }
-
-        .wrap-title {
-            display: flex;
-            justify-content: space-between;
-
-            .ivu-icon {
-                margin-right: 15px;
-                font-size: 22px;
-            }
-        }
-    }
-
-    .select-content {
-        display: flex;
-        height: 320px;
-        border-top: 1px solid #565656;
-        border-bottom: 1px solid #565656;
-    }
-
-    .show-wrap {
-        width: 100%;
-        height: auto;
-
-        .checked-point-item {
-            padding: 5px 20px;
-            color: #fff;
-            background: #6d6d6d;
-            margin: 10px;
-            border-radius: 50px;
-            display: inline-block;
-            cursor: pointer;
-        }
-    }
-
-    .point-box {
-        padding: 30px 10px;
-        border-top: 1px solid #565656;
-        color: #fff;
-        display: flex;
-        flex-wrap: wrap;
-
-
-        .checked-point-item {
-            padding: 5px 20px;
-            color: #fff;
-            background: #6d6d6d;
-            margin: 10px;
-            border-radius: 50px;
-            display: inline-block;
-            cursor: pointer;
-        }
-    }
-
-
-    .wrap-title {
-        position: relative;
-        font-size: 16px;
-        font-weight: bold;
-        color: #fff;
-        width: 100%;
-        height: 50px;
-        line-height: 50px;
-        padding-left: 20px;
-        background: #525252;
-        display: flex;
-        justify-content: space-between;
-
-        .wrap-btns {
-            display: flex;
-            justify-content: center;
-            align-items: center;
-        }
-
-        .ivu-btn {
-            height: 30px;
-            margin-right: 15px;
-            background: #0f9272;
-            color: #fff;
-            border: none;
-        }
-    }
-
-
-    .knowledge-left {
-        width: 18%;
-        border-right: 1px solid #565656;
-
-        .knowledge-left-item {
-            width: 100%;
-            height: 20%;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            color: #fff;
-            font-size: 14px;
-            font-weight: bold;
-            border-bottom: 1px solid #565656;
-            cursor: pointer;
-        }
-
-        .item-active {
-            background: #0f9272;
-        }
-    }
-
-
-    .knowledge-right {
-        width: 82%;
-        height: 100%;
-        padding: 0 0 0 20px;
-        overflow: hidden;
-
-        .knowledge-box {
-            padding: 10px;
-            color: #fff;
-            display: flex;
-            flex-wrap: wrap;
-
-            .knowledge-item {
-                margin: 10px;
-                width: 190px;
-                height: 120px;
-                overflow: hidden;
-                display: flex;
-                flex-direction: column;
-                justify-content: center;
-                align-items: center;
-                background: #545454;
-                box-shadow: 11px 11px 5px #383838;
-                border-radius: 3px;
-                cursor: pointer;
-            }
-        }
-    }
-}

+ 0 - 285
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/BaseKnowledge.vue

@@ -1,285 +0,0 @@
-<style lang="less" scoped>
-    @import './BaseKnowledge.less';
-</style>
-<template>
-    <div class="knowledge-container">
-        <vuescroll>
-            <div class="select-wrap">
-                <p class="wrap-title">
-                    <span>选择知识点</span>
-                </p>
-                <div class="select-content">
-                    <div class="knowledge-left">
-                        <div :class='["knowledge-left-item",activeIndex === 0 ? "item-active" : ""]' @click="onChangeOrigin(0)">校本知识点</div>
-                        <div :class='["knowledge-left-item",activeIndex === 1 ? "item-active" : ""]' @click="onChangeOrigin(1)">个人知识点</div>
-                    </div>
-                    <div class="knowledge-right">
-                        <vuescroll>
-                            <el-tree :data="treeData"
-                                     :props="defaultProps"
-                                     node-key="id"
-                                     ref="elTree"
-                                     show-checkbox
-                                     check-on-click-node
-                                     default-expand-all
-                                     @check="handleCheckChange">
-                                <span class="custom-tree-node" slot-scope="{ node, data }">
-                                    <span>{{data.name}}</span>
-                                </span>
-                            </el-tree>
-                        </vuescroll>
-                    </div>
-                </div>
-            </div>
-            <div class="show-wrap">
-                <div class="wrap-title">
-                    <span>已选知识点<span v-if="currentNodeInfo">  ( {{ checkedPoints.length }} )</span></span>
-                    <div class="wrap-btns">
-                        <Button @click="onClearChecked" v-show="checkedPoints.length">清空</Button>
-                        <Button @click="onSaveNode" :loading="isLoading">存储变更</Button>
-                    </div>
-                </div>
-                <div v-if="checkedPoints.length === 0">
-                    <EmptyData :top="10"></EmptyData>
-                </div>
-                <div class="point-box" v-else>
-                    <span class="checked-point-item" v-for="(item,index) in checkedPoints" :key="index">
-                        <span>{{item.name}}</span>
-                        <Icon type="ios-close" size="20" style="vertical-align:bottom;margin-left:5px" @click="onSplicePoint(item)"/>
-                    </span>
-                </div>
-            </div>
-        </vuescroll>
-
-    </div>
-</template>
-
-<script>
-    export default {
-        props: ['volume', 'currentNode'],
-        data() {
-            return {
-                currentVolume: null,
-                currentNodeInfo: null,
-                currentParams: null,
-                activeIndex: 0,
-                checkedPoints: [],
-                originPoints: [],
-                treeData: [],
-                defaultProps: {
-                    children: 'points',
-                    label: 'name'
-                },
-                hasModify: false,
-                isLoading: false
-
-            }
-        },
-
-        created() {
-            // 拿到当前册别信息 作为获取知识点数据参数
-            this.currentVolume = this.volume
-            this.currentParams = {
-                subjectCode: this.currentVolume.subjectCode,
-                code: this.currentVolume.schoolCode,
-                period: this.currentVolume.periodCode,
-                type: 1
-            }
-            this.getSchoolPoints()
-        },
-        methods: {
-            // 切换知识点数据来源
-            onChangeOrigin(index) {
-                this.activeIndex = index
-                switch (index) {
-                    case 0:
-                        this.getSchoolPoints()
-                        break
-                    case 1:
-                        this.getPrivatePoints()
-                        break
-                    default:
-                        break
-                }
-
-                // 切换数据源时 检测当前已选项 是否要设置选中状态
-                this.$refs.elTree.setCheckedKeys(this.checkedPoints.map(item => item.id), true)
-            },
-
-            // 获取校本知识点仓库
-            getSchoolPoints() {
-                this.currentParams.code = this.currentVolume.schoolCode
-                this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
-                    if (!res.error && res.result.data) {
-                        let list = res.result.data
-                        this.treeData = list
-                    } else {
-                        this.$Message.warning('获取数据失败')
-                    }
-                })
-            },
-
-            // 获取个人知识点仓库
-            getPrivatePoints() {
-                this.currentParams.code = this.$store.state.userInfo.TEAMModelId
-                this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
-                    if (!res.error && res.result.data) {
-                        let list = res.result.data
-                        this.treeData = list
-                    } else {
-                        this.$Message.warning('获取数据失败')
-                    }
-                })
-            },
-
-            // 节点复选框被点击时事件
-            handleCheckChange(data, list) {
-                console.log(list)
-                const isExistIndex = this.checkedPoints.map(item => item.id).indexOf(data.id)
-                if (isExistIndex > -1) {
-                    this.checkedPoints.splice(isExistIndex, 1)
-                } else {
-                    if (this.checkedPoints.length < 5) {
-                        this.checkedPoints.push(data)
-                    } else {
-                        this.$refs.elTree.setCheckedNodes(list.checkedNodes.splice(0, 5))
-                        
-                        this.$Message.warning('最多关联5个知识点!')
-                    }
-                    
-                }
-            },
-
-            /** 保存知识点关联 */
-            onSaveNode() {
-                this.isLoading = true
-                this.currentNodeInfo.knowledges = this.checkedPoints.length ? this.checkedPoints.map(item => item.id) : []
-                this.$api.syllabus.SaveOrUpdateAsNodes([this.currentNodeInfo]).then(res => {
-                    if (!res.error && res.result.data) {
-                        this.$emit('addPointsFinish', res.result.data)
-                        this.isLoading = false
-                    } else {
-                        this.$Message.warning('获取数据失败')
-                    }
-                })
-            },
-
-            /**
-             * 删除已选项
-             * @param item 已选项数据
-             */
-            onSplicePoint(item) {
-                this.checkedPoints.splice(this.checkedPoints.indexOf(item), 1)
-                this.onChangeOrigin(this.activeIndex)
-            },
-
-            /** 清空已选项 */
-            onClearChecked() {
-                this.checkedPoints = []
-                this.onChangeOrigin(this.activeIndex)
-            },
-
-            // 判断两个数组是否相等
-            isEqual(arr1, arr2) {
-                return (JSON.stringify(arr1) === JSON.stringify(arr2))
-            },
-        },
-        mounted() {
-        },
-        watch: {
-            // 监听册别数据变化
-            volume: {
-                handler: function(n, o) {
-                    this.currentVolume = n
-                    this.currentParams = {
-                        subjectCode: n.subjectCode,
-                        partitionKey: n.schoolCode,
-                        period: n.periodCode,
-                        type: 1
-                    }
-                    this.getSchoolPoints()
-                },
-                deep: true
-            },
-            // 监听册别数据变化
-            currentNode: {
-                handler: function (n, o) {
-                    this.currentNodeInfo = n
-                    //this.checkedPoints = n.knowledges ? n.knowledges : []
-                    this.onChangeOrigin(0)
-                    if (n.knowledges && n.knowledges.length) {
-                        // this.getPointObject(n.knowledges) // 用ID换知识点对象数据
-                        // 切换数据源时 检测当前已选项 是否要设置选中状态
-                    } else {
-                        this.checkedPoints = [] 
-                    } 
-                    this.hasModify = false
-                },
-                deep: true
-            }
-
-        }
-
-    }
-</script>
-
-<style>
-    .knowledge-container .__view {
-        min-height: unset !important;
-    }
-
-    .knowledge-container .__bar-is-vertical {
-        background: transparent !important;
-    }
-
-    .knowledge-container .knowledge-right .__bar-is-vertical {
-        background: #777676 !important;
-    }
-
-    .knowledge-container .ivu-checkbox-checked .ivu-checkbox-inner,
-    .knowledge-container .ivu-checkbox-indeterminate .ivu-checkbox-inner {
-        border-color: #0f9272;
-        background: #0f9272;
-    }
-
-    .knowledge-container .ivu-tree-title-selected,
-    .knowledge-container .ivu-tree-title-selected:hover,
-    .knowledge-container .ivu-tree-title:hover {
-        background: transparent;
-    }
-
-    .knowledge-container .el-tree {
-        background: transparent;
-        color: #fff;
-        padding-top: 10px;
-        padding-bottom: 100px;
-    }
-
-    .knowledge-container .el-tree-node__content {
-        height: 40px;
-    }
-
-        .knowledge-container .el-tree-node__content:hover {
-            height: 40px;
-            background: #464646;
-        }
-
-    .knowledge-container .el-tree-node:focus > .el-tree-node__content {
-        background: #464646;
-    }
-
-    .knowledge-container .el-tree__empty-block {
-        display: none;
-    }
-
-    .knowledge-container .el-tree-node__content:hover,
-    .knowledge-container .el-tree-node:focus > .el-tree-node__content {
-        background: #565656;
-    }
-
-    .knowledge-container .el-checkbox__input.is-checked .el-checkbox__inner,
-    .knowledge-container .el-checkbox__input.is-indeterminate .el-checkbox__inner {
-        border-color: #0f9272;
-        background: #0f9272;
-    }
-</style>

+ 0 - 289
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/BaseResource.less

@@ -1,289 +0,0 @@
-.resource-container {
-    width: 100%;
-    height: 100%;
-    background: #464646;
-    border-radius: 4px;
-    overflow: hidden;
-
-
-    .select-wrap {
-        width: 100%;
-        height: 60%;
-
-        .ns-header-search {
-            width: 400px;
-            margin-right: 15px;
-        }
-
-        .wrap-title {
-            display: flex;
-            justify-content: space-between;
-
-            .ivu-icon {
-                margin-right: 15px;
-                font-size: 22px;
-            }
-        }
-    }
-
-    .select-content {
-        display: flex;
-        height: 320px;
-        border-top: 1px solid #565656;
-        border-bottom: 1px solid #565656;
-    }
-
-    .show-wrap {
-        width: 100%;
-        height: auto;
-
-        .checked-point-item {
-            padding: 5px 20px;
-            color: #fff;
-            background: #6d6d6d;
-            margin: 10px;
-            border-radius: 50px;
-            display: inline-block;
-            cursor: pointer;
-        }
-    }
-
-    .point-box {
-        padding: 30px 10px 80px 10px;
-        border-top: 1px solid #565656;
-        border-bottom: 1px solid #565656;
-        color: #fff;
-        display: flex;
-        flex-wrap: wrap;
-        min-height: 300px;
-
-        .resource-item {
-            margin: 10px;
-            width: 180px;
-            height: 120px;
-            overflow: hidden;
-            display: flex;
-            flex-direction: column;
-            justify-content: center;
-            align-items: center;
-            background: #545454;
-            box-shadow: 11px 11px 5px #383838;
-            border-radius: 3px;
-            cursor: pointer;
-
-
-
-            .resource-item-img {
-                margin: 0 30px;
-                position: relative;
-
-                .icon-close {
-                    position: absolute;
-                    right: -50px;
-                    top: -10px;
-                    font-size: 20px;
-                    color: #a7a7a7;
-                }
-            }
-
-            &-name {
-                width: 80%;
-
-                .file-name {
-                    display: inline-block;
-                    width: 150px;
-                    margin-top: 5px;
-                    text-align: center;
-                    overflow: hidden;
-                    text-overflow: ellipsis;
-                    white-space: nowrap;
-                }
-            }
-
-            .file-info {
-
-                p {
-                    white-space: normal;
-                    word-break: break-all;
-                    color: #6d6d6d;
-
-                    span {
-                    }
-                }
-            }
-        }
-    }
-
-
-    .wrap-title {
-        position: relative;
-        font-size: 16px;
-        font-weight: bold;
-        color: #fff;
-        width: 100%;
-        height: 50px;
-        line-height: 50px;
-        padding-left: 20px;
-        background: #525252;
-        display: flex;
-        justify-content: space-between;
-
-        .wrap-btns {
-            display: flex;
-            justify-content: center;
-            align-items: center;
-        }
-
-        .ivu-btn {
-            height: 30px;
-            margin-right: 15px;
-            background: #0f9272;
-            color: #fff;
-            border: none;
-        }
-    }
-
-
-    .resource-left {
-        width: 18%;
-        border-right: 1px solid #565656;
-
-        .resource-left-item {
-            width: 100%;
-            height: 20%;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            color: #fff;
-            font-size: 14px;
-            font-weight: bold;
-            border-bottom: 1px solid #565656;
-            cursor: pointer;
-        }
-
-        .item-active {
-            background: #0f9272;
-        }
-    }
-
-
-    .resource-right {
-        width: 82%;
-        height: 100%;
-        padding: 0 0 0 10px;
-        overflow: hidden;
-
-        .resource-box {
-            padding: 10px;
-            color: #fff;
-            display: flex;
-            flex-wrap: wrap;
-
-            .resource-item {
-                margin: 10px;
-                width: 190px;
-                height: 120px;
-                overflow: hidden;
-                display: flex;
-                flex-direction: column;
-                justify-content: center;
-                align-items: center;
-                background: #545454;
-                box-shadow: 11px 11px 5px #383838;
-                border-radius: 3px;
-                cursor: pointer;
-
-                &-name {
-                    width: 80%;
-
-                    .file-name {
-                        display: inline-block;
-                        width: 150px;
-                        margin-top: 5px;
-                        text-align: center;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                        white-space: nowrap;
-                    }
-                }
-
-                .file-info {
-
-                    p {
-                        white-space: normal;
-                        word-break: break-all;
-                        color: #6d6d6d;
-
-                        span {
-                        }
-                    }
-                }
-            }
-        }
-
-        .resource-box-list {
-            padding: 10px;
-            color: #fff;
-            display: flex;
-            flex-direction: column;
-            flex-wrap: wrap;
-
-            .resource-item-list {
-                margin: 5px 10px;
-                padding-left: 15px;
-                width: 95%;
-                height: 40px;
-                overflow: hidden;
-                display: flex;
-                flex-direction: row;
-                align-items: center;
-                /*background: #545454;
-                box-shadow: 11px 11px 5px #383838;*/
-                border-radius: 3px;
-                cursor: pointer;
-
-                .resource-item-img {
-                    margin: 0 30px;
-                    position: relative;
-
-                    .icon-close {
-                        position: absolute;
-                        right: 0;
-                        top: 0;
-                    }
-                }
-
-                .resource-item-name {
-                    width: 80%;
-
-                    .file-name {
-                        display: inline-block;
-                        text-align: center;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                        white-space: nowrap;
-                        vertical-align:bottom;
-                    }
-
-                    .ivu-icon{
-                        display:inline-block;
-                        margin-right:10px;
-                        font-size:20px;
-                    }
-                }
-
-                .file-info {
-
-                    p {
-                        white-space: normal;
-                        word-break: break-all;
-                        color: #6d6d6d;
-
-                        span {
-                        }
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 349
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/BaseResource.vue

@@ -1,349 +0,0 @@
-<style lang="less" scoped>
-    @import './BaseResource.less';
-</style>
-
-<template>
-    <div class="resource-container">
-        <vuescroll>
-            <div class="select-wrap">
-                <div class="wrap-title">
-                    <span>选择资源文件<span v-if="currentNodeInfo">  ( {{ resourceList.length }} )</span></span>
-                    <div>
-                        <div class="select-wrap-header" v-if="!isSearchFile">
-                            <Icon type="ios-menu" title="切换显示样式" style="cursor:pointer" v-show="isShowBlocks" @click="onChangeShowType('1')" />
-                            <Icon type="ios-keypad" title="切换显示样式" style="cursor:pointer" v-show="!isShowBlocks" @click="onChangeShowType('0')" />
-                            <Icon type="ios-search" title="搜索" style="cursor:pointer" @click="isSearchFile = true" />
-                        </div>
-                        <div class="ns-header-search" v-else>
-                            <!-- 搜索册别部分 -->
-                            <Input icon="ios-close"
-                                   v-model="searchFile"
-                                   placeholder="搜索册别..."
-                                   autofocus
-                                   style="width: 100%"
-                                   @on-click="isSearchFile = false"
-                                   @on-blur="isSearchFile = false"
-                                   @on-change="onSearchFileChange"
-                                   @on-enter="onSearchFileChange" />
-                        </div>
-                    </div>
-                </div>
-                <div class="select-content">
-                    <div class="resource-left">
-                        <div :class='["resource-left-item",activeIndex === 0 ? "item-active" : ""]' @click="onChangeOrigin(0)">全部</div>
-                        <div :class='["resource-left-item",activeIndex === 1 ? "item-active" : ""]' @click="onChangeOrigin(1)">图片</div>
-                        <div :class='["resource-left-item",activeIndex === 2 ? "item-active" : ""]' @click="onChangeOrigin(2)">视频</div>
-                        <div :class='["resource-left-item",activeIndex === 3 ? "item-active" : ""]' @click="onChangeOrigin(3)">文档</div>
-                        <div :class='["resource-left-item",activeIndex === 4 ? "item-active" : ""]' @click="onChangeOrigin(4)">其他</div>
-                    </div>
-                    <div class="resource-right">
-                        <vuescroll>
-                            <div :class="isShowBlocks ? 'resource-box':'resource-box-list'">
-                                <div :class="isShowBlocks ? 'resource-item' : 'resource-item-list'"
-                                     v-for="(item,index) in resourceList" :key="index"
-                                     @click="onFileSelect(item)"
-                                     :style="{backgroundColor:checkedList.map(i => i.id).indexOf(item.id) > -1 ? '#0f9272' : isShowBlocks ? '#545454' : 'transparent'}">
-                                    <div class="resource-item-img" v-show="isShowBlocks">
-                                        <img v-if="item.extension === 'ppt'||item.extension === 'pptx'" src="@/assets/icon/ppt50.png" width="40" />
-                                        <img v-else-if="item.extension === 'doc'||item.extension === 'docx'" src="@/assets/icon/word50.png" width="40" />
-                                        <img v-else-if="item.extension === 'xls'||item.extension === 'xlsx'" src="@/assets/icon/xls50.png" width="40" />
-                                        <img v-else-if="item.type === 'picture'" src="@/assets/icon/icon_img.png" width="40" />
-                                        <img v-else-if="item.type === 'video'" src="@/assets/icon/icon_video.png" width="40" />
-                                        <img v-else-if="item.extension === 'rar'" src="@/assets/icon/zip50.png" width="40" />
-                                        <img v-else src="@/assets/icon/prelearn50.png" width="40" />
-                                    </div>
-                                    <div class="resource-item-name">
-                                        <Tooltip>
-                                            <Icon :type="checkedList.map(i => i.id).indexOf(item.id) > -1 ? 'ios-checkbox-outline' : 'ios-square-outline'" v-show="!isShowBlocks"/>
-                                            <p class="file-name">{{ item.fileName }}</p>
-                                            <div slot="content" class="file-info">
-                                                <p><span>文件名:</span>{{item.fileName}}</p>
-                                                <p><span>大小:</span>{{item.size/1024 > 1024 ? (item.size/1024/1024).toFixed(1) + 'M': (item.size/1024).toFixed(1) + 'KB'}}</p>
-                                                <p><span>上传时间:</span>{{new Date(item.createTime/10000).toLocaleString()}}</p>
-                                            </div>
-                                        </Tooltip>
-                                    </div>
-                                </div>
-                            </div>
-                        </vuescroll>
-                    </div>
-                </div>
-            </div>
-            <div class="show-wrap">
-                <div class="wrap-title">
-                    <span>已选资源<span v-if="currentNodeInfo">  ( {{ checkedList.length }} )</span></span>
-                    <div class="wrap-btns">
-                        <Button @click="onClearChecked" v-show="checkedList.length">清空</Button>
-                        <Button @click="onSaveResources" :loading="isLoading">存储变更</Button>
-                    </div>
-                </div>
-                <div v-if="checkedList.length === 0">
-                    <EmptyData :top="10"></EmptyData>
-                </div>
-                <div class="point-box" v-else>
-                    <div class="resource-item" v-for="(item,index) in checkedList" :key="index">
-                        <div class="resource-item-img">
-                            <img v-if="item.extension === 'ppt'||item.extension === 'pptx'" src="@/assets/icon/ppt50.png" width="40" />
-                            <img v-else-if="item.extension === 'doc'||item.extension === 'docx'" src="@/assets/icon/word50.png" width="40" />
-                            <img v-else-if="item.extension === 'xls'||item.extension === 'xlsx'" src="@/assets/icon/xls50.png" width="40" />
-                            <img v-else-if="item.type === 'picture'" src="@/assets/icon/icon_img.png" width="40" />
-                            <img v-else-if="item.type === 'video'" src="@/assets/icon/icon_video.png" width="40" />
-                            <img v-else-if="item.extension === 'rar'" src="@/assets/icon/zip50.png" width="40" />
-                            <img v-else src="@/assets/icon/prelearn50.png" width="40" />
-                            <Icon type="md-close" class="icon-close" @click="onSpliceFile(file)"/>
-                        </div>
-                        <div class="resource-item-name">
-                            <Tooltip>
-                                <p class="file-name">{{ item.fileName }}</p>
-                                <div slot="content" class="file-info">
-                                    <p><span>文件名:</span>{{item.fileName}}</p>
-                                    <p><span>大小:</span>{{item.size/1024 > 1024 ? (item.size/1024/1024).toFixed(1) + 'M': (item.size/1024).toFixed(1) + 'KB'}}</p>
-                                    <p><span>上传时间:</span>{{new Date(item.createTime/10000).toLocaleString()}}</p>
-                                </div>
-                            </Tooltip>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </vuescroll>
-
-    </div>
-</template>
-
-<script>
-    export default {
-        props: ['volume', 'currentNode'],
-        data() {
-            return {
-                currentVolume: null,
-                currentNodeInfo: null,
-                currentParams: null,
-                activeIndex: 0,
-                resourceList: [],
-                searchList: [],
-                originList: [],
-                treeData: [],
-                checkedList: [],
-                originResourcesList: [],
-                defaultProps: {
-                    children: 'points',
-                    label: 'name'
-                },
-                hasModify: false,
-                isLoading: false,
-                searchFile: '',
-                isSearchFile: false,
-                isShowBlocks: false
-
-            }
-        },
-
-        created() {
-            // 拿到当前册别信息 作为获取知识点数据参数
-            this.currentVolume = this.volume
-            this.currentParams = {
-                subjectCode: this.currentVolume.subjectCode,
-                schoolCode: this.currentVolume.schoolCode,
-                period: this.currentVolume.periodCode
-            }
-
-            this.getResourceData('private')
-        },
-        methods: {
-
-            /** 切换知识点数据来源 */
-            onChangeOrigin(index) {
-                this.activeIndex = index
-                switch (index) {
-                    case 0:
-                        this.resourceList = this.originList
-                        break
-                    case 1:
-                        this.resourceList = this.originList.filter(item => item.type === 'picture')
-                        break
-                    case 2:
-                        this.resourceList = this.originList.filter(item => item.type === 'video')
-                        break
-                    case 3:
-                        this.resourceList = this.originList.filter(item => item.type === 'document')
-                        break
-                    case 4:
-                        this.resourceList = this.originList.filter(item => item.type === 'other')
-                        break
-                    default:
-                        break
-                }
-
-                this.searchList = this.resourceList
-            },
-
-            /** 根据类型获取资源数据 */
-            getResourceData(type) {
-                let params = {
-                    range: type
-                }
-                this.$api.teachContent.findResourceByDict(params).then(res => {
-                    if (!res.error && res.result.data) {
-                        this.resourceList = res.result.data
-                        this.originList = res.result.data
-                    } else {
-                        this.$Message.warning('获取数据失败')
-                    }
-                })
-            },
-
-            /** 改变显示视图 */
-            onChangeShowType(type) {
-                this.isShowBlocks = type === '0'
-            },
-
-            /**
-             * 文件点击事件
-             * @param item 文件数据
-             */
-            onFileSelect(item) {
-                const isExistIndex = this.checkedList.indexOf(item)
-                if (isExistIndex > -1) {
-                    this.checkedList.splice(isExistIndex, 1)
-                } else {
-                    this.checkedList.push(item)
-                }
-            },
-
-            /** 清空已选项 */
-            onClearChecked() {
-                this.checkedList = []
-            },
-
-            /**
-             * 移除已选项
-             * @param file
-             */
-            onSpliceFile(file) {
-                this.checkedList.splice(this.checkedList.indexOf(file), 1)
-            },
-
-            /** 搜索资源文件事件 */
-            onSearchFileChange() {
-                this.resourceList = this.searchList.filter(item => item.fileName.indexOf(this.searchFile) > -1)
-            },
-
-            /** 保存关联资源文件 */
-            onSaveResources() {
-                this.isLoading = true
-                this.currentNodeInfo.resources = this.checkedList.map(item => item.id)
-                 this.$api.syllabus.SaveOrUpdateAsNodes([this.currentNodeInfo]).then(res => {
-                    if (!res.error && res.result.data) {
-                        this.$emit("addPointsFinish", res.result.data)
-                        this.isLoading = false
-                    } else {
-                        this.$Message.warning("获取数据失败")
-                    }
-                 })
-            },
-
-            /**
-             * 判断两个数组是否相等
-             * @param arr1
-             * @param arr2
-             */
-            isEqual(arr1, arr2) {
-                return (JSON.stringify(arr1) === JSON.stringify(arr2))
-            },
-
-            /**
-             * 获取内容资源完整对象数据 ID换对象
-             * @param arr 原始ID数组
-             */
-            getResourceObject(arr) {
-                this.$api.teachContent.FindSyllabusResourceById(arr).then(res => {
-                    if (!res.error && res.result.data) {
-                        this.checkedList = res.result.data
-                        this.originPoints = res.result.data
-                    } else {
-                        this.$Message.warning('获取数据失败')
-                    }
-                })
-            }
-
-        },
-        mounted() {
-        },
-        watch: {
-            // 监听册别数据变化
-            volume: {
-                handler: function(n, o) {
-                    this.currentVolume = n
-                    this.currentParams = {
-                        subjectCode: n.subjectCode,
-                        schoolCode: n.schoolCode,
-                        period: n.periodCode
-                    }
-                },
-                deep: true
-            },
-            // 监听册别数据变化
-            currentNode: {
-                handler: function(n, o) {
-                    this.currentNodeInfo = n
-                    this.onChangeOrigin(0)
-					console.log(n)
-                    if (n.resources) {
-                        this.getResourceObject(n.resources) // 用ID换知识点对象数据
-                        // 切换数据源时 检测当前已选项 是否要设置选中状态
-                    } else {
-                        this.checkedList = [] 
-                    } 
-                    this.originResourcesList = n.resources
-                },
-                deep: true
-            }
-
-        }
-
-    }
-</script>
-
-<style>
-
-    .resource-container .__view {
-        min-height: unset !important;
-    }
-
-    .resource-container .__bar-is-vertical {
-        background: transparent !important;
-    }
-
-    .resource-container .resource-right .__bar-is-vertical {
-        background: #777676 !important;
-    }
-
-    .resource-container .ivu-tooltip-inner {
-        background: #fff;
-        padding: 15px;
-        color: #808080;
-    }
-
-    .resource-container .ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow {
-        border-bottom-color: #fff;
-    }
-
-    .resource-container .ivu-input {
-        background: #656565;
-        color: #fff;
-        border: none;
-        height: 34px;
-    }
-
-        .resource-container .ivu-input:focus {
-            border: none;
-            box-shadow: none;
-        }
-
-    .resource-container .ivu-input-icon {
-        font-size: 24px;
-        color: #cfc7c7;
-        line-height: 36px;
-        cursor: pointer;
-    }
-</style>