Selaa lähdekoodia

处理科目切换 提示报错

zhousheng 4 vuotta sitten
vanhempi
commit
6b7ff17687

+ 11 - 9
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue

@@ -357,7 +357,7 @@ import { json } from 'd3'
 
 			// 获取当前册别数量(每次都获取最新的数据)
 			initBlockCount() {
-				this.setCount = false
+				
 				let params = {}
 					for (let data of this.subjectList) {
                         params[this.$store.state.userInfo.schoolCode + "-" + data.id] = this.periodList[this.currentPeriodIndex].id
@@ -365,7 +365,7 @@ import { json } from 'd3'
 					this.$api.syllabus.FindBlockCount(params).then(res => {
 						if (res.datas.length) {
 							this.$nextTick(() => {
-								this.setCount = true  //开始监听数据
+								
 								this.blockCounts = res.datas
                                 this.schoolBlockCount = res.datas.map(i => i.countBlock)
 								this.privateBlockCount = res.datas.map(i => i.countBlock)
@@ -375,12 +375,13 @@ import { json } from 'd3'
 			},
 
 			// 根据学科获取所有知识块信息
-			getBlocksData() {
-                let that = this
+			async getBlocksData() {
+				let that = this
+                that.setCount = false
                 that.pointDatas = []
                 let params = JSON.parse(JSON.stringify(this.currentParams))
                 params.type = 0
-				this.$api.knowledge.GetSchoolPoints(params).then(res => {
+				await this.$api.knowledge.GetSchoolPoints(params).then(res => {
                     if (res.length > 0) {
                         that.pointDatas = res
                         let list = res[0].blocks
@@ -406,11 +407,12 @@ import { json } from 'd3'
                         let list = params[0].blocks
                         this.blockList = list
                         this.originBlockList = JSON.parse(JSON.stringify(list))
-                    } 
+					}
 				}).catch(err => {
                     this.$Message.error(this.$t('knowledge.warn'))
 					this.isLoadBlocks = false
 				})
+                that.setCount = true  //开始监听数据
 			},
 
 			// 根据学科获取学科下所有知识点数据
@@ -813,21 +815,21 @@ import { json } from 'd3'
 		},
 		watch: {
             originBlockList: {
-				handler(newValue, oldValue) {
+				handler() {
 					if (this.setCount) {
 						this.updated = true
                     }
                 }
 			},
             originPointList: {
-				handler(newValue, oldValue) {
+				handler() {
 					if (this.setCount) {
 						this.updated = true
                     }
                 }
             },
 		},
-        beforeRouteLeave(to, from, next) {
+		beforeRouteLeave(to, from, next) {
             if (this.updated) {
                 let config = {
                     title: this.$t('schoolBaseInfo.saveWarning'),

+ 0 - 281
TEAMModelOS/ClientApp/src/view/knowledge-pointBankup/index/Index.less

@@ -1,281 +0,0 @@
-@main-bgColor:rgb(43,43,46); //主背景颜色
-@borderColor: #444444;
-@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;
-        // box-shadow: 0px 4px 9px 0px #010101;
-        .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% - 70px);
-        width: 100%;
-        .fl-row-center;
-		
-		.drag-active{
-			 background-color: rgba(149, 149, 149, 0.2);
-		}
-		
-		.gl-new-area{
-			text-align: center;
-			color:@primary-textColor;
-			background: #3e3e3e;
-			padding: 35px 0 !important;
-		}
-
-        .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 #353535;
-
-                &-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 25px;
-                    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 {
-                    padding: 20px 15px
-                }
-
-                .gl-item-name {
-                    width: 70%;
-                    overflow: hidden;
-                    text-overflow: ellipsis;
-                    white-space: nowrap;
-					pointer-events: none;
-                }
-
-                .gl-item-info {
-					pointer-events: none;
-                    span {
-                        margin-top: 15px
-                    }
-                }
-
-                .gl-item:hover {
-                    .btn-delete, .btn-edit {
-                        display: unset;
-                    }
-                }
-
-                .btn-delete {
-                    position: absolute;
-                    right: 30px;
-                    top: 44px;
-                    display: none;
-                }
-
-                .btn-edit {
-                    position: absolute;
-                    right: 60px;
-                    top: 44px;
-                    display: none;
-                }
-            }
-        }
-
-        .ns-col {
-            width: 15%;
-            // box-shadow: 6px 6px 9px 0px #000000;
-            z-index: 2;
-            // background: #171717;
-            user-select: none;
-        }
-
-        .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;
-                }
-            }
-        }
-
-        .ns-col3 {
-            width: 66%;
-            background: #2c2c2cd6;
-
-
-            .btn-compose-block {
-                background: #0f9272;
-                border: none;
-                color: #fff;
-                margin-left:20px;
-            }
-
-            .points-wrap {
-                display: flex;
-                flex-wrap: wrap;
-                padding-top: 20px;
-
-                .point-item {
-					position:relative;
-                    margin: 10px;
-                    padding: 5px 30px;
-                    border-radius: 50px;
-                    background: #545454;
-                    box-shadow: 1px 4px 0px 0px #000000;
-                    cursor: pointer;
-
-                    &-tools {
-                        margin-left: 10px;
-                        // display: none;
-
-                        .btn-delete {
-                            margin-left: 4px;
-                        }
-                    }
-                }
-
-                .point-item-active {
-                    background: #0f9272 !important;
-                }
-				
-				// .block-point-item:before{
-				// 	content:'';
-				// 	display:block;
-				// 	width:8px;
-				// 	height:14px;
-				// 	border-right:#fff solid 2px;
-				// 	border-bottom:#fff solid 2px;
-				// 	transform:rotate(35deg);
-				// 	position:absolute;
-				// 	bottom:12px;
-				// 	left:12px;
-				// 	z-index:2;
-				// }
-				
-				.block-point-item{
-					background-color: #006988;
-				}
-
-                .point-item:hover {
-                    .point-item-tools {
-                        display: unset;
-                    }
-                }
-            }
-        }
-    }
-}
-
-.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 - 938
TEAMModelOS/ClientApp/src/view/knowledge-pointBankup/index/Index.vue

@@ -1,938 +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">
-
-			<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">
-			<!-- 选择学科 -->
-			<div class="ns-col ns-col">
-				<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" v-show="subjectList.length" style="cursor:pointer" @click="isSearchSubject = true" />
-					</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="100"></EmptyData>
-					</div>
-					<div class="gl" v-else>
-						<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>知识块数:{{ tabIndex === 0  ? schoolBlockCount[index] : privateBlockCount[index]}}</p>
-						</div>
-					</div>
-				</vuescroll>
-			</div>
-
-			<!-- 展示知识点部分 -->
-			<div class="ns-col ns-col3" ref="colRef3">
-				<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadPoints"></Loading>
-				<div class="ns-header">
-					<!-- 切换头部以及搜索框 -->
-					<div class="ns-header-content" v-if="!isSearchPoint">
-						<span>
-							<Icon type="md-cube" color="#fff" size="20" />
-							<span style="margin-left:5px">知识点 ( {{ originPointList.length }} )</span>
-							<Input icon="ios-close" v-model="searchPoint" v-show="originPointList.length" placeholder="搜索知识点..." autofocus style="width: 300px;margin-left: 20px;"
-							 @on-click="onSearchClear" @on-blur="isSearchPoint = false" @on-change="onSearchPointChange" @on-enter="onSearchPointChange"
-							 @on-clear="onSearchClear" />
-						</span>
-						<div>
-							<Icon type="md-add" v-if="($access.can('admin.*|Point_Add')) && subjectList.length" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
-							 @click="onAddPoint" />
-							<Button class="btn-compose-block" v-if="checkedPointList.length" @click="onComposeBlock">组成知识块</Button>
-						</div>
-					</div>
-					<div class="ns-header-search" v-else>
-					</div>
-					<div>
-						<div v-if="pointList.length === 0">
-							<EmptyData :top="100"></EmptyData>
-						</div>
-						<div v-else>
-							<draggable class="points-wrap" tag="div" v-model="pointList" v-bind="dragOptions">
-								<transition-group type="transition" :name="!drag ? 'flip-list' : null" class="points-wrap">
-									<div v-for="(item,index) in pointList" :key="index" :class="['point-item', isBlockPoint(item) ? 'block-point-item' : '' , isChecked(item) ? 'point-item-active' : '']"
-									 @click="onPointCheck(item)" draggable="true" @dragstart="onDragStart(item)" @dragend="isDragging = false">
-										<span>{{item.name}}</span>
-										<span class="point-item-tools">
-											<span class="btn-edit" v-if="$access.can('admin.*|Point_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditPoint(index,item)">
-												<Icon type="md-create" size="18" color="#d2d2d2" /></span>
-											<span class="btn-delete" v-if="$access.can('admin.*|Point_Delete') || tabIndex === 1" title="删除" @click.stop="onDeletePoint(index,item)">
-												<Icon type="md-trash" size="20" color="#d2d2d2" /></span>
-											<span class="btn-delete" v-if="$access.can('admin.*|Point_Remove') && isBlockPoint(item)" title="移出知识块"
-											 @click.stop="onRemovePoint(index,item)">
-												<Icon type="md-remove-circle" size="20" color="#d2d2d2" /></span>
-										</span>
-									</div>
-								</transition-group>
-							</draggable>
-							<!-- <Page :total="originPointList.length || 0" show-sizer show-total :page-size-opts="pageSizeOpt" :current="currentPage"
-							 :page-size="pageSize" @on-page-size-change="pageSizeChange" @on-change="pageChange" /> -->
-						</div>
-					</div>
-				</div>
-			</div>
-
-			<!-- 选择知识块 -->
-			<div class="ns-col ns-col2" ref="colRef2">
-				<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-show="isLoadBlocks"></Loading>
-				<div class="ns-header">
-					<!-- 切换头部以及 搜索框 -->
-					<div class="ns-header-content" v-if="!isSearchBlock">
-						<span>
-							<Icon type="ios-photos" color="#fff" size="20" />
-							<span style="margin-left:5px">知识块</span>
-						</span>
-						<div>
-							<Icon type="md-add" v-if="($access.can('admin.*|Block_Add') || tabIndex === 1)  && subjectList.length" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
-							 @click="onAddBlock" />
-							<Icon type="ios-search" color="#fff" size="18" style="cursor:pointer" v-show="subjectList.length && blockList.length" @click="isSearchBlock = true" />
-						</div>
-					</div>
-					<div class="ns-header-search" v-else>
-						<!-- 搜索知识块部分 -->
-						<Input icon="ios-close" v-model="searchBlock" placeholder="搜索知识块..." autofocus style="width: 100%" @on-click="onSearchBlockClose"
-						 @on-change="onSearchBlockChange" @on-enter="onSearchBlockChange" />
-					</div>
-				</div>
-				<vuescroll>
-					<!-- 知识块列表 -->
-					<div class="vl gl">
-						<div v-if="blockList.length === 0">
-							<div class="gl-item gl-new-area" v-show="isDragging" @drop="onDragNewEnd" @dragover.prevent>
-								<Icon type="md-add" size="18" />
-								<span style="margin-left: 10px;">新建知识块</span>
-							</div>
-							<EmptyData :top="50"></EmptyData>
-						</div>
-						<div v-else>
-							<div class="gl-item gl-new-area" v-show="isDragging" @drop="onDragNewEnd" @dragover.prevent>
-								<Icon type="md-add" size="18" />
-								<span style="margin-left: 10px;">新建知识块</span>
-							</div>
-							<div :class='["gl-item","drag-block-item",index == activeBlockIndex ? "item-active":""]' v-for="(item,index) in blockList"
-							 :key="index" @click="handleBlockTap(index,item)" @drop="onDragEnd(item,index,$event)" @dragover.prevent
-							 @dragend="onDragEnd(item,index)" @dragenter="onDragEnter" @dragleave="onDragLeave">
-								<p class="gl-item-name" :title="item.name">{{item.name}}</p>
-								<p class="gl-item-info"><span></span>知识点数:{{item.points ? item.points.length : 0}}</p>
-								<span class="btn-edit" v-if="$access.can('admin.*|Block_Edit') || tabIndex === 1" title="编辑" @click.stop="onEditBlock(item)">
-									<Icon type="md-create" size="20" color="#d2d2d2" /></span>
-								<span class="btn-delete" v-if="$access.can('admin.*|Block_Delete') || tabIndex === 1" title="删除" @click.stop="onDeleteBlock(item)">
-									<Icon type="md-trash" size="22" color="#d2d2d2" /></span>
-							</div>
-						</div>
-					</div>
-				</vuescroll>
-			</div>
-		</div>
-
-		<!-- 新增知识块弹窗 -->
-		<Modal v-model="isAddBlock" width="560" footer-hide class="add-volume-modal">
-			<div class="modal-header" slot="header">{{ isEditBlock ? '编辑知识块' : '新增知识块'}}</div>
-			<div class="modal-content">
-				<AddBlock :originData="originSchoolData" :periodIndex="currentPeriodIndex" :subjectIndex="currentSubjectIndex"
-				 :editBlock="editBlock" :addType="pointOwn" @addFinish="onFinishAddBlock">
-				</AddBlock>
-			</div>
-		</Modal>
-
-		<!-- 新增知识点弹窗 -->
-		<Modal v-model="isAddPoint" width="560" footer-hide class="add-volume-modal">
-			<div class="modal-header" slot="header">{{ isEditPoint ? '编辑知识点' : '新增知识点'}}</div>
-			<div class="modal-content">
-				<AddPoint :hideBlock="isShowPoints" :schoolParams="schoolParams" :blockData="parentBlock" :pointData="currentPoint"
-				 :addType="pointOwn" @addFinish="onFinishAddPoint">
-				</AddPoint>
-			</div>
-		</Modal>
-
-		<!-- 组成知识块弹窗 -->
-		<Modal v-model="isComposeBlock" width="680" footer-hide class="add-volume-modal compose-modal">
-			<div class="modal-header" slot="header">组成知识块</div>
-			<ComposeBlock :list="checkedPointList" :params="currentParams" :blockList="originBlockList" @onFinish="onComposeFinish"></ComposeBlock>
-		</Modal>
-	</div>
-</template>
-
-<script>
-	import Tree from '@/components/syllabus/DragTree'
-	import AddBlock from './operation/AddBlock'
-	import AddPoint from './operation/AddPoint'
-	import ComposeBlock from './operation/ComposeBlock'
-	import draggable from "vuedraggable"
-
-	export default {
-		data() {
-			return {
-				schoolInfo: {
-					code: ''
-				},
-				currentParams: {
-					code: '',
-					subjectId: '',
-					school_code: '',
-					periodId: '',
-					type: 0
-				},
-				drag: false,
-				isDragging: false,
-				isLoadSubject: false,
-				isLoadBlocks: false,
-				isLoadPoints: false,
-				isLoading: false,
-				schoolParams: null,
-				currentPeriodIndex: null,
-				currentSubjectIndex: null,
-				currentBlock: null,
-				currentPoint: null,
-				tabIndex: 0,
-				originData: {},
-				originSchoolData: {},
-				periodList: [],
-				subjectList: [],
-				originSubjectList: [],
-				blockList: [],
-				originBlockList: [],
-				pointList: [],
-				originPointList: [],
-				activePeriodIndex: 0,
-				activeSubjectIndex: 0,
-				activeBlockIndex: null,
-				blockCounts: [],
-				schoolBlockCount: [],
-				privateBlockCount: [],
-				isSearchSubject: false,
-				isSearchBlock: false,
-				isSearchPoint: false,
-				isAddBlock: false,
-				isEditBlock: false,
-				isAddPoint: false,
-				isEditPoint: false,
-				isComposeBlock: false,
-				searchBlock: '',
-				searchPoint: '',
-				searchSubject: '',
-				editBlock: null,
-				editPointIndex: null,
-				hasModify: false,
-				preSelectVal: null,
-				pageSize: 20,
-				currentPage: 1,
-				pageSizeOpt: [5, 10, 15, 20],
-				pointOwn: 'school',
-				isShowPoints: true,
-				parentBlock: null,
-				checkedPointList: [],
-				curBlockPoints: [],
-				curDragPoint: null
-			}
-		},
-		components: {
-			Tree,
-			AddBlock,
-			AddPoint,
-			ComposeBlock,
-			draggable
-		},
-		created() {
-			this.initSchoolData()
-
-			this.initBlockCount()
-		},
-		methods: {
-
-			/* 知识点拖动开始 */
-			onDragStart(item) {
-				this.curDragPoint = item
-				this.isDragging = true
-			},
-
-			/* 知识点移入到知识块 */
-			onDragEnter(e) {
-				e.target.classList.add('drag-active')
-			},
-
-			/* 知识点拖拽离开知识块 */
-			onDragLeave(e) {
-				e.target.classList.remove('drag-active')
-			},
-
-			// 知识点拖拽到知识块后
-			onDragEnd(blockItem, blockIndex, e) {
-				e.target.classList.remove('drag-active')
-				// 判断是单个拖拽还是选择了多个进行拖拽
-				let checkPointIds = new Set(this.checkedPointList.map(i => i.id))
-				let blockPointIds = new Set(blockItem.points)
-				if (checkPointIds.has(this.curDragPoint.id) && checkPointIds.size > 1) {
-					// 如果是选中的元素 则获取选中的和知识块包含的 差集 即为需要添加的知识点ID
-					let addPointIds = new Set([...checkPointIds].filter(x => !blockPointIds.has(x)))
-					if (addPointIds.size > 0) {
-						this.$Modal.confirm({
-							title: '提示',
-							content: `确定将 ${ this.curDragPoint.name } 等 ${ addPointIds.size } 个知识点移入到知识块 ${ blockItem.name } 中 (已存在的知识点会自动忽略)?`,
-							okText: '确认',
-							cancelText: '取消',
-							onOk: () => {
-								this.isLoading = true
-								blockItem.points.push(...addPointIds)
-								this.savePointAndBlock(blockItem)
-								this.initBlockCount()
-							}
-						})
-					} else {
-						this.$Message.warning('所选知识点已存在于该知识块中!')
-					}
-
-				} else {
-					if (blockItem.points.includes(this.curDragPoint.id)) {
-						this.$Message.warning('该知识块已存在当前知识点!')
-					} else {
-						this.$Modal.confirm({
-							title: '提示',
-							content: `确定将知识点 ${ this.curDragPoint.name } 移入到知识块 ${ blockItem.name } 中?`,
-							okText: '确认',
-							cancelText: '取消',
-							onOk: () => {
-								this.isLoading = true
-								blockItem.points.push(this.curDragPoint.id)
-								this.savePointAndBlock(blockItem)
-								this.initBlockCount()
-							}
-						})
-					}
-				}
-			},
-
-			/* 拖拽知识点组成新知识块 */
-			onDragNewEnd(e) {
-				if (!this.checkedPointList.length) {
-					let list = this.checkedPointList
-					let item = this.curDragPoint
-					let isExistIndex = list.indexOf(item)
-					if (isExistIndex > -1) {
-						this.checkedPointList.splice(isExistIndex, 1)
-					} else {
-						this.checkedPointList.push(item)
-					}
-				}
-
-				this.isComposeBlock = true
-			},
-
-			/* 保存最新知识块内容 */
-			savePointAndBlock(pointItem) {
-				return new Promise((r, j) => {
-					console.log(pointItem)
-					pointItem.code =  pointItem.code.replace('Knowledge-','')
-					this.$api.knowledge.SaveOrUpdateKnowledge([pointItem]).then(res => {
-						if (!res.error && res.knowledges) {
-							this.curDragPoint = null
-							this.isLoading = false
-							this.checkedPointList = []
-							this.$Message.success('操作成功!')
-							r(200)
-						} else {
-							this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-						}
-					}).catch(err => {
-						j(err)
-						this.$Message.warning('操作失败')
-					})
-				})
-
-			},
-
-			// 获取当前学校学段学科等基本信息
-			initSchoolData() {
-				this.$store.dispatch('user/getSchoolProfile').then(res => {
-						let schoolBaseInfo = res.school_base
-						if(schoolBaseInfo){
-						this.schoolInfo = schoolBaseInfo
-						this.originSchoolData = schoolBaseInfo // 默认选择第一个
-						this.originData = schoolBaseInfo // 默认选择第一个
-						if(schoolBaseInfo.period.length){
-							this.periodList = schoolBaseInfo.period
-							this.currentParams.code = schoolBaseInfo.id
-							this.currentParams.school_code = schoolBaseInfo.id
-							this.currentParams.periodId = schoolBaseInfo.period[0].id
-							this.currentPeriodIndex = 0 // 默认选择第一个学段
-							this.onPeriodChange(0)
-						}
-					}
-				})
-			},
-
-			// 获取当前册别数量(每次都获取最新的数据)
-			initBlockCount() {
-				// if (this.blockCounts.length) {
-				// 	this.schoolBlockCount = this.blockCounts[this.currentPeriodIndex].map(i => i[0])
-				// 	this.privateBlockCount = this.blockCounts[this.currentPeriodIndex].map(i => i[1])
-				// } else {
-					this.$api.syllabus.FindBlockCount({
-						code: this.$store.state.userInfo.schoolCode
-					}).then(res => {
-						if (!res.error) {
-							this.$nextTick(() => {
-								this.blockCounts = res
-								this.schoolBlockCount = res[this.currentPeriodIndex || 0].map(i => i[0])
-								this.privateBlockCount = res[this.currentPeriodIndex || 0].map(i => i[1])
-							})
-						} else {
-							this.$Message.warning('获取数据失败')
-						}
-					})
-				// }
-			},
-
-			// 根据学科获取所有知识块信息
-			getBlocksData() {
-				let that = this
-				let params = JSON.parse(JSON.stringify(this.currentParams))
-				params.type = 0
-				this.$api.knowledge.GetSchoolPoints(params).then(res => {
-					if (!res.error && res.knowledges) {
-						let list = res.knowledges
-						this.blockList = list
-						this.originBlockList = JSON.parse(JSON.stringify(list))
-						// this.handleBlockTap(0, list.length ? list[0] : null)
-						setTimeout(function() {
-							that.isLoadBlocks = false
-						}, 400)
-					} else {
-						this.$Message.warning('获取数据失败')
-					}
-				}).catch(err => {
-					this.$Message.error('知识块数据获取失败')
-					this.isLoadBlocks = false
-				})
-			},
-
-			// 根据学科获取学科下所有知识点数据
-			getPointsData() {
-				let that = this
-				this.currentParams.type = 1
-				this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
-					if (!res.error && res.knowledges) {
-						this.pointList = res.knowledges
-						this.originPointList = JSON.parse(JSON.stringify(res.knowledges))
-						setTimeout(function() {
-							that.isLoadPoints = false
-						}, 800)
-					} else {
-						this.$Message.warning('获取数据失败')
-					}
-				})
-			},
-
-			// 校本知识块与个人切换
-			handleTabClick(index) {
-				this.checkedPointList = []
-				this.tabIndex = index
-				switch (index) {
-					case 0:
-						this.currentParams.code = this.originData.schoolCode
-						//this.isShowPoints ? this.getPointsData() : this.getBlocksData()
-						this.getPointsData()
-						this.getBlocksData()
-						this.pointOwn = 'school'
-						break
-					case 1:
-						this.currentParams.code = this.$store.state.userInfo.TEAMModelId
-						this.getPointsData()
-						this.getBlocksData()
-						//this.isShowPoints ? this.getPointsData() : this.getBlocksData()
-						this.pointOwn = 'personal'
-						break
-					default:
-						break
-				}
-
-				this.handleSubjectTap(0)
-			},
-
-			// 学段切换处理
-			onPeriodChange(index) {
-				this.$nextTick(() => {
-					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 = this.periodList[index].subjects // 切换学段后更新 学科 列表
-						this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
-						if(this.subjectList.length){
-							this.handleSubjectTap(0)
-							this.initBlockCount()
-						}else{
-							this.pointList = []
-							this.originBlockList = []
-							this.blockList = []
-							this.originPointList = []
-						}
-						setTimeout(function() {
-							that.isLoadSubject = false
-						}, 400)
-					}
-				})
-			},
-
-			// 学科点击事件
-			handleSubjectTap(index) {
-				this.checkedPointList = []
-				this.blockList = []
-				this.originBlockList = []
-				this.pointList = []
-				this.originPointList = []
-				this.schoolParams = {
-					schoolCode: this.originData.id,
-					subjectId: this.subjectList[index].id,
-					period: this.currentParams.periodId
-				}
-				this.currentSubjectIndex = index
-				this.currentParams.subjectId = this.subjectList[index].id
-				// this.currentParams.type = this.isShowPoints ? 1 : 0
-				this.activeSubjectIndex = index
-				this.isLoadBlocks = true
-				this.getBlocksData()
-				this.getPointsData()
-
-			},
-
-			// 知识块点击事件
-			handleBlockTap(index, item) {
-				if (index === this.activeBlockIndex) {
-					this.activeBlockIndex = null
-					this.curBlockPoints = []
-				} else {
-					let that = this
-					let blockPoints = []
-					this.activeBlockIndex = index
-					this.currentBlock = item
-					if (item && item.points.length) {
-						this.curBlockPoints = item.points
-						this.toStartPosition(item.points)
-					} else { // 没有则置空
-						this.curBlockPoints = []
-					}
-				}
-			},
-
-			// 把当前知识块的知识点排到最前面
-			toStartPosition(points) {
-				points.forEach(i => {
-					let pointIds = this.pointList.map(i => i.id)
-					if (pointIds.includes(i)) {
-						let index = pointIds.indexOf(i)
-						let item = this.pointList[index]
-						this.pointList.splice(index, 1)
-						this.pointList.unshift(item)
-					}
-				})
-			},
-
-			// 添加知识块完成
-			onFinishAddBlock(val) {
-				this.$Message.success('操作成功!')
-				this.handleSubjectTap(this.currentSubjectIndex) // 获取最新知识块数据
-				this.isAddBlock = false // 关闭窗口
-				this.blockCounts = []
-				this.initBlockCount()
-			},
-
-			// 添加知识点完成
-			onFinishAddPoint(val) {
-				if(!val) return
-				let that = this
-				this.isLoadPoints = true
-				if (this.isEditPoint) {
-					this.pointList[this.editPointIndex] = val
-				} else {
-					if (!this.isShowPoints) this.currentBlock.points.push(val.id)
-					this.originPointList.push(val)
-					this.pageChange(this.currentPage)
-				}
-				this.$Message.success('操作成功!')
-				this.isAddPoint = false // 关闭窗口
-				this.isEditPoint = false
-				setTimeout(function() {
-					that.isLoadPoints = false
-					that.initBlockCount()
-				}, 400)
-			},
-
-			// 删除知识块事件
-			onDeleteBlock(data) {
-				this.$Modal.confirm({
-					title: '提示',
-					content: '<p>确认删除该知识块?</p>',
-					okText: '确认',
-					cancelText: '取消',
-					onOk: () => {
-						let that = this
-						this.isLoading = true
-						this.$api.knowledge.DeleteSchoolPoint({
-							code:data.code.replace('Knowledge-',''),
-							id: data.id
-						}).then(res => {
-							if (!res.error) {
-								console.log(this.blockList)
-								console.log(this.originBlockList)
-								console.log(data)
-								this.blockList.splice(this.blockList.indexOf(data), 1)
-								this.originBlockList.splice(this.originBlockList.indexOf(data), 1)
-								console.log(this.blockList)
-								console.log(this.originBlockList)
-								this.handleBlockTap(0, this.blockList.length ? this.blockList[0] : null)
-								setTimeout(() => {
-									that.blockCounts = []
-									that.initBlockCount()
-									that.isLoading = false
-									that.$Message.success('删除成功')
-								}, 1000)
-
-
-							} else {
-								this.$Message.success('删除失败')
-							}
-						})
-					}
-				})
-			},
-
-			// 删除知识点事件
-			onDeletePoint(data) {
-				this.$Modal.confirm({
-					title: '提示',
-					content: '<p>确认删除该知识点?</p>',
-					okText: '确认',
-					cancelText: '取消',
-					onOk: () => {
-						this.isLoadPoints = true
-						this.$api.knowledge.DeleteSchoolPoint({
-							code:data.code.replace('Knowledge-',''),
-							id: data.id
-						}).then(res => {
-							if (!res.error) {
-								this.$Message.success('删除成功')
-								this.originPointList.splice(this.originPointList.indexOf(data), 1)
-								if (!this.isShowPoints) this.currentBlock.points.splice(this.currentBlock.points.indexOf(data.id), 1)
-								this.pageChange(this.currentPage)
-								this.isLoadPoints = false
-							} else {
-								this.$Message.warning('删除失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-							}
-						}).catch(err => {
-							console.log(err)
-							this.$Message.warning('删除失败')
-						})
-					}
-				})
-			},
-
-			// 移除知识点事件
-			onRemovePoint(data) {
-				this.$Modal.confirm({
-					title: '提示',
-					content: `确定将知识点 ${ data.name } 从知识块 ${ this.currentBlock.name } 中移除?`,
-					okText: '确认',
-					cancelText: '取消',
-					onOk: () => {
-						if (this.currentBlock.points.includes(data.id)) {
-							let that = this
-							this.currentBlock.points.splice(this.currentBlock.points.indexOf(data.id), 1)
-							this.savePointAndBlock(this.currentBlock).then(r => {
-								this.curBlockPoints = []
-								this.currentBlock = null
-								this.activeBlockIndex = null
-								that.handleSubjectTap(that.currentSubjectIndex)
-							})
-
-						} else {
-							this.$Message.error('移除失败')
-						}
-					}
-				})
-			},
-
-			// 编辑知识块事件
-			onEditBlock(data) {
-				this.isAddBlock = true // 打开新增窗口
-				this.isEditBlock = true // 设置成编辑状态
-				this.editBlock = data
-			},
-
-			// 新增知识块事件
-			onAddBlock() {
-				this.isAddBlock = true
-				this.isEditBlock = false
-				this.editBlock = null
-			},
-
-			// 新增知识点事件
-			onAddPoint() {
-				this.isAddPoint = true
-				this.isEditPoint = false
-				this.currentPoint = null
-				// this.parentBlock = this.isShowPoints ? null : this.currentBlock
-				this.parentBlock = null
-				this.onSearchClear()
-			},
-
-			// 编辑知识点事件
-			onEditPoint(index, data) {
-				this.isAddPoint = true // 打开新增窗口
-				this.isEditPoint = true // 设置成编辑状态
-				this.currentPoint = data
-				this.editPointIndex = index
-				console.log('87878787878787878')
-				console.log(this.parentBlock)
-				this.parentBlock = this.isShowPoints ? null : this.currentBlock
-			},
-
-			// 知识点点击事件
-			onPointCheck(item) {
-				if (this.isShowPoints) {
-					let list = this.checkedPointList
-					let isExistIndex = list.indexOf(item)
-					if (isExistIndex > -1) {
-						this.checkedPointList.splice(isExistIndex, 1)
-					} else {
-						this.checkedPointList.push(item)
-					}
-				}
-			},
-
-			// 点击组成知识块
-			onComposeBlock() {
-				this.isComposeBlock = true
-			},
-
-			// 组成知识块结束
-			onComposeFinish() {
-				this.isComposeBlock = false
-				this.checkedPointList = []
-				this.activeBlockIndex = null
-				this.curBlockPoints = []
-				this.handleSubjectTap(this.currentSubjectIndex)
-				this.$Message.success('操作成功')
-				this.initBlockCount()
-			},
-
-			// 搜索知识块输入框onchange事件
-			onSearchBlockChange() {
-				this.blockList = this.originBlockList.filter(item => item.name.indexOf(this.searchBlock) > -1)
-				if (this.blockList.length) this.handleBlockTap(0, this.blockList[0])
-			},
-
-			// 搜索知识点输入框onchange事件
-			onSearchPointChange() {
-				this.pointList = this.originPointList.filter(item => item.name.indexOf(this.searchPoint) > -1)
-			},
-
-			// 清空科目搜索框
-			onSearchSubjectClose() {
-				this.searchSubject = ''
-				this.isSearchSubject = false
-				this.subjectList = this.originSubjectList
-				this.handleSubjectTap(0)
-			},
-
-			onSearchClear() {
-				this.searchPoint = ''
-				this.isSearchPoint = false
-				this.pointList = this.originPointList
-			},
-
-			// 清空科目搜索框
-			onSearchBlockClose() {
-				this.searchBlock = ''
-				this.isSearchBlock = false
-				this.blockList = this.originBlockList
-				if (this.blockList.length) this.handleBlockTap(0, this.blockList[0])
-			},
-
-			// 搜索学科输入框onchange事件
-			onSearchSubjectChange() {
-				this.subjectList = this.originSubjectList.filter(item => item.name.indexOf(this.searchSubject) > -1)
-				this.handleSubjectTap(0)
-			},
-
-			// 切换页码返回截取数据
-			pageChange(page) {
-				this.currentPage = page
-				let start = this.pageSize * (page - 1)
-				let end = this.pageSize * page
-				this.pointList = this.originPointList ? this.originPointList.slice(start, end) : []
-				// 如果删除的是仅剩的一个元素 则往前翻页
-				if (this.pointList.length === 0 && page > 1) {
-					this.pageChange(page - 1)
-				}
-			},
-
-			// 切换每页显示页数
-			pageSizeChange(val) {
-				this.pageSize = val
-				this.currentPage = 1
-				this.pageChange(1)
-			},
-
-		},
-		mounted() {
-
-
-		},
-		computed: {
-			dragOptions() {
-				return {
-					animation: 200,
-					group: "description",
-					disabled: false,
-					ghostClass: "ghost"
-				};
-			},
-			isChecked() {
-				return item => {
-					return this.checkedPointList.map(item => item.id).indexOf(item.id) > -1
-				}
-			},
-			isBlockPoint() {
-				return item => {
-					return this.curBlockPoints.indexOf(item.id) > -1
-				}
-			}
-
-		},
-	}
-</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;
-	}
-
-	.new-syllabus-header .ivu-select-single .ivu-select-arrow,
-	.funnel-box .ivu-select-single .ivu-select-arrow {
-		color: #fbfbfb;
-	}
-
-	.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;
-	}
-
-	/* 修改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;
-	}
-
-	.ns-col .points-wrap .ivu-page {
-		position: absolute;
-		bottom: 40px;
-		left: 0;
-		width: 100%;
-		text-align: center;
-	}
-
-	.ns-col .points-wrap .ivu-page .ivu-page-item,
-	.ns-col .points-wrap .ivu-page .ivu-page-next,
-	.ns-col .points-wrap .ivu-page .ivu-page-prev {
-		background: none;
-		border: none;
-		line-height: 32px;
-	}
-
-	.ns-col .points-wrap .ivu-page .ivu-page-item a,
-	.ns-col .points-wrap .ivu-page .ivu-page-next a,
-	.ns-col .points-wrap .ivu-page .ivu-page-prev a {
-		color: #fff;
-	}
-
-	.ns-col .points-wrap .ivu-page-item-active {
-		border: none;
-		background: rgb(11, 151, 117) !important;
-	}
-
-	.ns-col .points-wrap .ivu-select-selection,
-	.ns-col .points-wrap .ivu-page-options-elevator input {
-		border: none;
-		background: #605f5f;
-	}
-
-	.ns-col .points-wrap .ivu-select,
-	.ns-col .points-wrap .ivu-page-options-elevator input {
-		color: #fff;
-	}
-</style>

+ 0 - 175
TEAMModelOS/ClientApp/src/view/knowledge-pointBankup/index/operation/AddBlock.vue

@@ -1,175 +0,0 @@
-
-<template>
-    <div class="form-container">
-        <Form :model="formTop" label-position="top">
-            <FormItem label="科目">
-                <Select v-model="formTop.subject">
-                    <Option v-for="(item,index) in currentPeriod.subjects" :value="item.id" :key="index">{{ item.name }}</Option>
-                </Select>
-            </FormItem>
-            <FormItem label="名称">
-                <Input v-model="formTop.name" placeholder="请输入知识块名称,必填项"></Input>
-            </FormItem>
-            <FormItem>
-                <Button @click="handleSubmit" :loading="isLoading">确认</Button>
-            </FormItem>
-        </Form>
-    </div>
-</template>
-
-<script>
-    import '@/utils/Math.uuid'
-    export default {
-        props: ['originData', 'periodIndex', 'subjectIndex', 'addType', 'editBlock'],
-        data() {
-            return {
-                originDatas: {},
-                currentPeriod: {},
-                editItem: null,
-                addPointType: 'school',
-                isLoading: false,
-                uuid: '',
-                formTop: {
-                    subject: '',
-                    grade: '',
-                    semester: '',
-                    name: ''
-                }
-            }
-        },
-
-        created() {
-			if(this.originData && this.originData.period){
-				this.currentPeriod = this.originData.period[this.periodIndex]
-				this.originDatas = this.originData
-			}
-        },
-        methods: {
-            // 提交添加
-            handleSubmit() {
-                let newName = this.formTop.name
-                if (!newName) {
-                    this.$Message.warning('知识块名称不能为空!')
-                } else {
-                    this.isLoading = true
-                    this.uuid = Math.uuid()
-                    let params = {
-                        type: 0,
-                        name: this.formTop.name,
-                        alias: this.formTop.name,
-                        subjectId: this.formTop.subject,
-                        code: this.addPointType === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelID,
-                        order: 706,
-                        status: 1,
-                        knowledgeId: this.uuid,
-                        periodId: this.currentPeriod.id,
-                        points: [],
-                        source: 1
-                    }
-                    if (this.editItem && this.editItem.code) {
-                        params.knowledgeId = this.editItem.knowledgeId
-                        params.points = this.editItem.points
-                        params.id = this.editItem.id
-                    }
-                    this.$api.knowledge.SaveOrUpdateKnowledge([params]).then(res => {
-                        if (!res.error && res.knowledges) {
-                            this.$emit('addFinish', false)
-                        } else {
-                            this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-                        }
-                        this.closeModal()
-                        this.editItem = null
-                        this.isLoading = false
-                    }).catch(err => {
-                        console.log(err)
-                        this.$Message.warning('操作失败')
-                        this.isLoading = false
-                    })
-                }
-            },
-
-            // 添加完成 关闭窗口
-            closeModal() {
-                this.formTop.name = ''
-            }
-        },
-        watch: {
-            addType: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.addPointType = newValue
-                    }
-                }
-            },
-            originData: {
-                handler(newValue, oldValue) {
-                    this.originDatas = newValue
-                }
-            },
-            periodIndex: {
-                handler(newValue, oldValue) {
-                    this.currentPeriod = this.originDatas.period[newValue]
-                    this.formTop.subject = this.currentPeriod.subjects.length ? this.currentPeriod.subjects[0].id : ''
-                    this.formTop.name = ''
-                }
-            },
-            subjectIndex: {
-                handler(newValue, oldValue) {
-                    this.formTop.subject = this.currentPeriod.subjects ? this.currentPeriod.subjects[newValue].id : ''
-                }
-            },
-            editBlock: {
-                handler(newValue, oldValue) {
-                    if (newValue) { // 有编辑册别传过来则为编辑状态
-                        this.editItem = newValue
-                        this.formTop.subject = this.formTop.subject || newValue.subjectId
-                        this.formTop.name = newValue.name
-                    } else { // 否则为新增状态
-                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
-                        this.formTop.name = ''
-                        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 - 187
TEAMModelOS/ClientApp/src/view/knowledge-pointBankup/index/operation/AddPoint.vue

@@ -1,187 +0,0 @@
-
-<template>
-    <div class="form-container">
-        <Form :model="formTop" label-position="top">
-            <FormItem label="知识块" v-show="!hideBlock">
-                <Input v-model="formTop.blockName" disabled></Input>
-            </FormItem>
-            <FormItem label="名称">
-                <Input v-model="formTop.name" placeholder="请输入知识点名称,必填项"></Input>
-            </FormItem>
-            <FormItem>
-                <Button @click="handleAddPointSubmit()" :loading="isLoading">确认</Button>
-            </FormItem>
-        </Form>
-    </div>
-</template>
-
-<script>
-    import '@/utils/Math.uuid'
-    export default {
-        props: ['blockData', 'pointData', 'hideBlock', 'addType', 'schoolParams'],
-        data() {
-            return {
-                blockDatas: null,
-                currentPeriod: {},
-                currentPoint: null,
-                schoolInfos: {},
-                addPointType: 'school',
-                isHideBlock: false,
-                isLoading: false,
-                uuid: '',
-                formTop: {
-                    blockName: '',
-                    name: ''
-                }
-            }
-        },
-
-        created() {
-            this.isHideBlock = this.hideBlock
-        },
-        methods: {
-            // 提交添加
-            handleAddPointSubmit() {
-                let newName = this.formTop.name
-                if (!newName) {
-                    this.$Message.warning('知识点名称不能为空!')
-                } else {
-                    let editPointItem = this.currentPoint
-                    this.isLoading = true
-                    this.uuid = Math.uuid()
-					console.log(this.schoolInfos)
-                    let params = {
-                        type: 1,
-                        name: newName,
-                        alias: newName,
-                        subjectId: editPointItem ? editPointItem.subjectId : this.schoolInfos.subjectId,
-                        code: this.addPointType === 'school' ? this.schoolInfos.schoolCode : this.$store.state.userInfo.TEAMModelID, // //判断当前添加为校本或者个人知识点
-                        order: 706,
-                        status: 1,
-                        knowledgeId: editPointItem ? editPointItem.knowledgeId : this.uuid,
-                        periodId: editPointItem ? editPointItem.periodId : this.schoolInfos.period,
-                        source: 1,
-                        points: this.blockDatas ? [this.blockDatas.id] : [],
-                        id: editPointItem ? editPointItem.id : null,
-                    }
-					console.log(params)
-                    this.savePointAndBlock(params)
-                }
-            },
-
-            /**
-             * 保存知识点
-             * @param pointItem
-             * @param BlockItem
-             */
-            savePointAndBlock(pointItem) {
-                this.$api.knowledge.SaveOrUpdateKnowledge([pointItem]).then(res => {
-                    if (!res.error && res.knowledges.length) {
-                        this.$emit('addFinish', res.knowledges[0])
-                        this.closeModal()
-                        this.currentPoint = null
-                        this.formTop.name = ''
-                        this.isLoading = false
-                    } else {
-                        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-                    }
-                }).catch(err => {
-                    console.log(err)
-                    this.$Message.warning('操作失败')
-                })
-				this.isLoading = false
-            },
-
-            // 添加完成 关闭窗口
-            closeModal() {
-                this.formTop.name = ''
-            }
-        },
-        mounted() {
-        },
-        watch: {
-            addType: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.addPointType = newValue
-                    }
-                }
-            },
-
-            hideBlock: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.isHideBlock = newValue
-                    }
-                }
-            },
-
-            blockData: {
-                handler(newValue, oldValue) {
-                    this.blockDatas = newValue
-                    console.log(newValue)
-                    if (newValue) {
-                        this.formTop.blockName = newValue.name
-                    }
-                }
-            },
-
-            pointData: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.currentPoint = newValue
-                        this.formTop.name = newValue.name
-                    }
-                }
-            },
-
-            schoolParams: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-						console.log(newValue)
-                        this.schoolInfos = 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 - 280
TEAMModelOS/ClientApp/src/view/knowledge-pointBankup/index/operation/ComposeBlock.vue

@@ -1,280 +0,0 @@
-
-<template>
-    <div class="compose-container">
-        <Tabs value="0" @on-click="onTabChange">
-            <TabPane label="新增知识块" icon="md-folder" name="0">
-                <div class="tab-content">
-                    <p class="tab-title">添加知识块</p>
-                    <Input v-model="newBlockName" placeholder="输入知识块名称" style="width: 98%;margin-left:1%" />
-                </div>
-            </TabPane>
-            <TabPane label="现有知识块" icon="md-cube" name="1">
-                <div class="tab-content">
-                    <p class="tab-title">选择知识块 ( *若所选知识块内已存在添加的知识点则会覆盖 )</p>
-                    <Select v-model="selectBlock" transfer style="width: 98%;margin-left:1%">
-                        <Option v-for="item in existBlockList" :value="item.id" :key="item.id">{{ item.name }}</Option>
-                    </Select>
-                </div>
-            </TabPane>
-        </Tabs>
-
-        <div class="show-wrap">
-            <p class="tab-title">已选知识点</p>
-            <div class="show-list">
-                <span class="point-item" v-for="(item,index) in checkedList" :key="index">
-                {{ item.name }}
-                    <span class="btn-delete"><Icon type="ios-close" size="20" style="vertical-align:bottom;margin-left:5px" @click="onSplicePoint(item)" /></span>
-                </span>
-            </div>
-        </div>
-
-        <Button @click="currentTab === '0' ? handleSubmitNew() : handleSubmit()" :loading="isLoading">确认</Button>
-    </div>
-</template>
-
-<script>
-    import '@/utils/Math.uuid'
-    export default {
-        props: ['list', 'params', 'blockList'],
-        data() {
-            return {
-                existBlockList: [],
-                checkedList: [],
-                currentParams: null,
-                newBlockName: '',
-                isLoading: false,
-                selectBlock: '',
-                currentTab: '0'
-            }
-        },
-
-        created() {
-            this.currentParams = this.params
-        },
-        methods: {
-
-            // 面板切换事件
-            onTabChange(name) {
-                this.currentTab = name
-            },
-
-            // 提交新增知识块
-            handleSubmitNew() {
-                this.isLoading = true
-                if (this.newBlockName) {
-                    let list = this.existBlockList.map(item => item.name)
-                    let isExistIndex = list.indexOf(this.newBlockName)
-                    if (isExistIndex > -1) {
-                        this.$Message.warning('已存在同名知识块,请修改名称!')
-                        this.isLoading = false
-                    } else {
-                        let params = {
-                            type: 0,
-                            name: this.newBlockName,
-                            alias: this.newBlockName,
-                            subjectId: this.currentParams.subjectId,
-                            code: this.currentParams.code.replace('Knowledge-',''),
-                            order: 706,
-                            status: 1,
-                            knowledgeId: Math.uuid(),
-                            periodId: this.currentParams.periodId,
-                            points: this.checkedList.map(item => item.id),
-                            TEAMModelId: this.$store.state.userInfo.TEAMModelID,
-                            source: 1
-                        }
-
-                        this.$api.knowledge.SaveOrUpdateKnowledge([params]).then(res => {
-                            if (!res.error && res.knowledges) {
-                                this.$emit('onFinish', false)
-                            } else {
-                                this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-                            }
-                            this.isLoading = false
-                        }).catch(err => {
-                            console.log(err)
-                            this.$Message.warning('操作失败')
-                            this.isLoading = false
-                        })
-                    }
-                } else {
-                    this.$Message.warning('知识块名称不能为空')
-                    this.isLoading = false
-                }
-            },
-
-            // 提交新增知识块
-            handleSubmit() {
-				if(this.existBlockList.length){
-					this.isLoading = true
-					let selectBlockItem = this.existBlockList.filter(item => item.id === this.selectBlock)[0]
-					let pointList = selectBlockItem.points
-					pointList = Array.from(new Set(pointList.concat(this.checkedList.map(item => item.id)))) // 知识点合并去重
-					selectBlockItem.points = pointList
-					
-					this.$api.knowledge.SaveOrUpdateKnowledge([selectBlockItem]).then(res => {
-					    if (!res.error && res.knowledges) {
-					        this.$emit('onFinish', false)
-					    } else {
-					        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-					    }
-					    this.isLoading = false
-					}).catch(err => {
-					    console.log(err)
-					    this.$Message.warning('操作失败')
-					    this.isLoading = false
-					})
-				}else{
-					this.$Message.warning('无现有知识块选择!')
-				}
-                
-            },
-
-            onSplicePoint(item) {
-                this.checkedList.splice(this.checkedList.indexOf(item), 1)
-            }
-        },
-        mounted() {
-
-        },
-        watch: {
-            list: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.checkedList = []
-                        this.checkedList = newValue
-                    }
-                }
-            },
-
-            params: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.currentParams = newValue
-                    }
-                }
-            },
-
-            blockList: {
-                handler(newValue, oldValue) {
-                    if (newValue) {
-                        this.newBlockName = ''
-                        this.existBlockList = newValue
-                        this.selectBlock = newValue.length ? newValue[0].id : ''
-                    }
-                }
-            }
-        }
-
-    }
-</script>
-
-<style>
-
-    /*修改iview Tab标签页样式重写*/
-    .compose-container .ivu-tabs-nav {
-        width:100%;
-    }
-
-     .compose-container .ivu-tabs {
-        height:100%;
-    }
-
-        .compose-container .ivu-tabs-nav .ivu-icon {
-            font-size:20px;
-            margin-right:15px;
-        }
-
-    .compose-container .ivu-tabs-nav .ivu-tabs-tab {
-        width:50%;
-        text-align:center;
-        color:#fff;
-        margin:0;
-        padding-bottom:20px;
-    }
-
-    .compose-container .ivu-tabs-bar {
-        border-bottom:none;
-    }
-
-    .compose-container .ivu-tabs-nav-container:focus .ivu-tabs-tab-focused {
-        border-color:rgb(11, 151, 117) !important;
-    }
-
-    .compose-container .ivu-tabs-ink-bar {
-        background:rgb(11, 151, 117) !important;
-        height:4px;
-        bottom:0;
-    }
-
-    .compose-container .ivu-tabs-content {
-        height:100%;
-    }
-
-    .compose-container .tab-content {
-        padding:30px;
-    }
-
-    .compose-container .tab-title {
-        color:#fff;
-        margin:10px 0 20px 5px;
-    }
-
-    .compose-container .tab-title::before {
-        content:"";
-        width:4px;
-        height:14px;
-        background:rgb(11, 151, 117);
-        margin:-2px 10px -2px 0;
-        display:inline-block;
-     }
-
-    .compose-container .ivu-input {
-        background: #575757;
-        border-color: transparent;
-        height: 35px;
-        color: #fff;
-    }
-
-    .compose-container .ivu-input::-webkit-input-placeholder {
-            color: #808080;
-    }
-
-    .compose-container .show-wrap{
-        padding:30px;
-    }
-
-    .compose-container .show-list {
-       display:flex;
-       flex-wrap:wrap;
-    }
-
-        .compose-container .show-list .point-item {
-            margin: 10px;
-            padding: 5px 30px;
-            border-radius: 50px;
-            background: #828282;
-            box-shadow: 1px 4px 0px 0px #313131;
-            cursor: pointer;
-        }
-
-    .compose-container .ivu-btn {
-        width: 92%;
-        margin-left:4%;
-        margin-bottom:20px;
-        height: 40px;
-        background: rgb(11, 151, 117);
-        border: none;
-        color: #fff;
-    }
-
-    .compose-container .ivu-select-single .ivu-select-selection {
-        background: #575757;
-        color: #fbfbfb;
-        border-color: transparent;
-        height: 35px;
-    }
-
-    .compose-container .ivu-select-single .ivu-select-arrow {
-        color: #fbfbfb;
-    }
-</style>