|
@@ -6,14 +6,14 @@
|
|
|
<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 common-save-btn">
|
|
|
+ <div class="new-syllabus-header">
|
|
|
<div class="new-syllabus-select">
|
|
|
- <span>{{$t("knowledge.period")}}:</span>
|
|
|
- <Select ref="periodSelect" v-model="currentPeriodIndex" style="width:100px;" @on-change="onPeriodChange">
|
|
|
+ <!-- <span>{{$t("knowledge.period")}}:</span> -->
|
|
|
+ <Select ref="periodSelect" v-model="currentPeriodIndex" style="width:200px;" @on-change="onPeriodChange" @on-select="onPeriodSelect">
|
|
|
<Option v-for="(item,index) in periodList" :value="index" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
</div>
|
|
|
- <Button v-if="$access.ability('admin','schoolSetting-upd').validateAll" :disabled="!updated" class="school-tools ivu-btn ivu-btn-default" icon="ios-albums-outline" @click="saveData()">{{$t('schoolBaseInfo.saveInfo')}}</Button>
|
|
|
+ <Button type="success" v-if="$access.ability('admin','schoolSetting-upd').validateAll && updated" class="school-tools ivu-btn ivu-btn-default" icon="ios-albums-outline" @click="saveData()">{{$t('schoolBaseInfo.saveInfo')}}</Button>
|
|
|
</div>
|
|
|
<!-- 主体内容 -->
|
|
|
<div class="new-syllabus-content">
|
|
@@ -74,6 +74,7 @@
|
|
|
<EmptyData :top="100"></EmptyData>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
+ <p style="font-size: 12px;font-weight: 400;margin-left: 10px;margin-top: 10px;color: #888686;">{{$t("knowledge.colorTip")}}</p>
|
|
|
<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' : '']"
|
|
@@ -251,7 +252,8 @@ import { json } from 'd3'
|
|
|
pointIndex: null,
|
|
|
pointDatas: {},
|
|
|
updated: false,
|
|
|
- setCount: false
|
|
|
+ setCount: false,
|
|
|
+ prePeriodIndex:0
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -450,56 +452,130 @@ import { json } from 'd3'
|
|
|
}
|
|
|
this.handleSubjectTap(0)
|
|
|
},
|
|
|
+
|
|
|
+ onPeriodSelect(){
|
|
|
+ this.prePeriodIndex = this.currentPeriodIndex
|
|
|
+ },
|
|
|
|
|
|
// 学段切换处理
|
|
|
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()
|
|
|
+ if(this.updated){
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t('schoolBaseInfo.saveWarning'),
|
|
|
+ content: this.$t('schoolBaseInfo.ssTips8'),
|
|
|
+ okText: this.$t('schoolBaseInfo.leaveText'),
|
|
|
+ onOk: () => {
|
|
|
+ this.updated = false
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ this.currentPeriodIndex = this.prePeriodIndex
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.preSelectVal = this.$refs.periodSelect.value
|
|
|
+ if (this.hasModify) {
|
|
|
+ this.handleConfirmSave({}, '3')
|
|
|
} else {
|
|
|
- this.pointList = []
|
|
|
- this.originBlockList = []
|
|
|
- this.blockList = []
|
|
|
- this.originPointList = []
|
|
|
+ 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)
|
|
|
}
|
|
|
- setTimeout(function () {
|
|
|
- that.isLoadSubject = false
|
|
|
- }, 400)
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 学科点击事件
|
|
|
handleSubjectTap(index) {
|
|
|
- this.checkedPointList = []
|
|
|
- this.blockList = []
|
|
|
- this.originBlockList = []
|
|
|
- this.pointList = []
|
|
|
- this.curBlockPoints = []
|
|
|
- this.originPointList = []
|
|
|
- this.activeBlockIndex = 0
|
|
|
- this.schoolParams = {
|
|
|
- schoolCode: this.originData.id,
|
|
|
- subjectId: this.subjectList[index].id,
|
|
|
- period: this.currentParams.periodId
|
|
|
+ if(this.updated){
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t('schoolBaseInfo.saveWarning'),
|
|
|
+ content: this.$t('schoolBaseInfo.ssTips8'),
|
|
|
+ okText: this.$t('schoolBaseInfo.leaveText'),
|
|
|
+ onOk: () => {
|
|
|
+ this.checkedPointList = []
|
|
|
+ this.blockList = []
|
|
|
+ this.originBlockList = []
|
|
|
+ this.pointList = []
|
|
|
+ this.curBlockPoints = []
|
|
|
+ this.originPointList = []
|
|
|
+ this.activeBlockIndex = 0
|
|
|
+ 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.activeSubjectIndex = index
|
|
|
+ this.isLoadBlocks = true
|
|
|
+ this.getPointsData()
|
|
|
+ this.getBlocksData()
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.checkedPointList = []
|
|
|
+ this.blockList = []
|
|
|
+ this.originBlockList = []
|
|
|
+ this.pointList = []
|
|
|
+ this.curBlockPoints = []
|
|
|
+ this.originPointList = []
|
|
|
+ this.activeBlockIndex = 0
|
|
|
+ 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.activeSubjectIndex = index
|
|
|
+ this.isLoadBlocks = true
|
|
|
+ this.getPointsData()
|
|
|
+ this.getBlocksData()
|
|
|
}
|
|
|
- this.currentSubjectIndex = index
|
|
|
- this.currentParams.subjectId = this.subjectList[index].id
|
|
|
- this.activeSubjectIndex = index
|
|
|
- this.isLoadBlocks = true
|
|
|
- this.getPointsData()
|
|
|
- this.getBlocksData()
|
|
|
+
|
|
|
},
|
|
|
|
|
|
// 知识块点击事件
|
|
@@ -879,9 +955,11 @@ import { json } from 'd3'
|
|
|
<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;
|
|
|
+ width: 140px;
|
|
|
+ background-color: #252525e3 !important;
|
|
|
+ border-radius: 0;
|
|
|
+ border-color: #96969640 !important;
|
|
|
+ color: #D0D0D0;
|
|
|
}
|
|
|
|
|
|
.new-syllabus-header .ivu-select-single .ivu-select-arrow,
|