|
@@ -89,6 +89,9 @@
|
|
|
<div class="setting-content semester-content">
|
|
|
<p class="block-title bf-color1">
|
|
|
{{$t('schoolBaseInfo.semesterSetting')}}
|
|
|
+ <span class="semester-start-warning" v-show="startWarning">
|
|
|
+ <Icon type="md-warning" />请设置入学期
|
|
|
+ </span>
|
|
|
<span class="block-action-box">
|
|
|
<Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-add" @click.stop="addSemester()" class="action-btn-icon" />
|
|
|
</span>
|
|
@@ -99,18 +102,20 @@
|
|
|
</span>
|
|
|
<span class="term-item-start" @click.stop>
|
|
|
<span>{{$t('schoolBaseInfo.startDate')}}</span>
|
|
|
- <Select v-model="item.month" style="width:60px" :placeholder="$t('schoolBaseInfo.monthHolder')" :disabled="editSemIndex !== index">
|
|
|
+ <Select v-model="item.month" style="width:70px" :placeholder="$t('schoolBaseInfo.monthHolder')" :disabled="editSemIndex !== index">
|
|
|
<Option v-for="(item,index) in monthList" :value="(index + 1)" :key="index" @click.native="countSemDays">{{ item }}</Option>
|
|
|
</Select>
|
|
|
<span> / </span>
|
|
|
- <Select v-model="item.day" style="width:60px" :placeholder="$t('schoolBaseInfo.dayHolder')" :disabled="editSemIndex !== index">
|
|
|
+ <Select v-model="item.day" style="width:70px" :placeholder="$t('schoolBaseInfo.dayHolder')" :disabled="editSemIndex !== index">
|
|
|
<Option v-for="(item,index) in dayList" :value="(index + 1)" :key="index" @click.native="countSemDays">{{ item }}</Option>
|
|
|
</Select>
|
|
|
</span>
|
|
|
<span class="term-item-students-num">{{$t('schoolBaseInfo.semesterDuration')+ semDays[index] + $t('schoolBaseInfo.dayUnit') }}</span>
|
|
|
+ <span class="year-start-tag" v-show="item.start == '1'">入学期</span>
|
|
|
<div class="action-btx-box hover-show-icon">
|
|
|
<Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-trash" @click.stop="showComfirmDelSemester()" :title="$t('schoolBaseInfo.delete')" class="action-btn-icon" />
|
|
|
- <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-create" @click.stop="editSemIndex = curSemIndex" :title="$t('schoolBaseInfo.editLabel')" class="action-btn-icon" />
|
|
|
+ <!-- <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-create" @click.stop="editSemIndex = curSemIndex" :title="$t('schoolBaseInfo.editLabel')" class="action-btn-icon" /> -->
|
|
|
+ <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-create" @click.stop="setEditSem(index)" :title="$t('schoolBaseInfo.editLabel')" class="action-btn-icon" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 时间轴UI -->
|
|
@@ -337,21 +342,21 @@
|
|
|
</FormItem>
|
|
|
<!-- 开始时间 -->
|
|
|
<FormItem prop="name" label="开始于">
|
|
|
- <Select v-model="semtInfo.month" style="width:80px" :placeholder="$t('schoolBaseInfo.monthHolder')">
|
|
|
+ <Select v-model="semtInfo.month" style="width:90px" :placeholder="$t('schoolBaseInfo.monthHolder')">
|
|
|
<Option v-for="(item,index) in monthList" :value="(index + 1)" :key="index" @click.native="countSemDays">{{ item }}</Option>
|
|
|
</Select>
|
|
|
- <span> / </span>
|
|
|
- <Select v-model="semtInfo.day" style="width:80px" :placeholder="$t('schoolBaseInfo.dayHolder')">
|
|
|
+ <span style="display:inline-block;width:20px;text-align:center"> / </span>
|
|
|
+ <Select v-model="semtInfo.day" style="width:90px" :placeholder="$t('schoolBaseInfo.dayHolder')">
|
|
|
<Option v-for="(item,index) in dayList" :value="(index + 1)" :key="index" @click.native="countSemDays">{{ item }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<!-- 是否为入学期 -->
|
|
|
<FormItem prop="name" label="入学期">
|
|
|
<RadioGroup v-model="semtInfo.start">
|
|
|
- <Radio label="1">
|
|
|
+ <Radio :label="1">
|
|
|
<span>是</span>
|
|
|
</Radio>
|
|
|
- <Radio label="0" style="margin-left:30px">
|
|
|
+ <Radio :label="0" style="margin-left:30px">
|
|
|
<span>否</span>
|
|
|
</Radio>
|
|
|
</RadioGroup>
|
|
@@ -443,8 +448,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ setEditSem(index) {
|
|
|
+ this.semtInfo.name = this.schoolSetting.period[this.curPriodIndex].semesters[index].name
|
|
|
+ this.semtInfo.month = this.schoolSetting.period[this.curPriodIndex].semesters[index].month
|
|
|
+ this.semtInfo.day = this.schoolSetting.period[this.curPriodIndex].semesters[index].day
|
|
|
+ this.semtInfo.start = this.schoolSetting.period[this.curPriodIndex].semesters[index].start
|
|
|
+ this.semtInfo.id = this.schoolSetting.period[this.curPriodIndex].semesters[index].id
|
|
|
+ this.addSemStatus = true
|
|
|
+ console.log('456',this.semtInfo.name)
|
|
|
+ },
|
|
|
confirmSemester() {
|
|
|
+ console.log('123',this.semtInfo.id)
|
|
|
+ if (this.semtInfo.id) { //编辑
|
|
|
+ let s = this.schoolSetting.period[this.curPriodIndex].semesters.find(item => {
|
|
|
+ return item.id == this.semtInfo.id
|
|
|
+ })
|
|
|
+ s.name = this.semtInfo.name
|
|
|
+ s.month = this.semtInfo.month
|
|
|
+ s.day = this.semtInfo.day
|
|
|
+ s.start = this.semtInfo.start
|
|
|
+ } else { //新增
|
|
|
+ this.semtInfo.id = this.guid()
|
|
|
+ this.schoolSetting.period[this.curPriodIndex].semesters.push(this._.cloneDeep(this.semtInfo))
|
|
|
+ }
|
|
|
|
|
|
+ //根据时间进行排序
|
|
|
+ if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 1) {
|
|
|
+ this.schoolSetting.period[this.curPriodIndex].semesters.sort((a, b) => {
|
|
|
+ if (a.month == b.month) {
|
|
|
+ return a.day - b.day
|
|
|
+ } else {
|
|
|
+ return a.month - b.month
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.countSemDays()
|
|
|
},
|
|
|
cancelSemester() {
|
|
|
this.semtInfo = {
|
|
@@ -468,22 +506,6 @@ export default {
|
|
|
}
|
|
|
return true
|
|
|
// 公共容器只开放了公共读权限,没有公共写的权限,所以需要将文件通过后端上传
|
|
|
- //上传文件 头像上传到公共容器 “0-public” , 文件路径“header”
|
|
|
- // let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
|
|
|
- // let urlString = blobUrl.substring(0, blobUrl.lastIndexOf('/'))
|
|
|
- // let containerName = '0-public' //公共资源目录,暂未开放上传权限
|
|
|
- // console.log(blobUrl, urlString, containerName)
|
|
|
- // let blob = new BlobTool(urlString, containerName, '', 'school')
|
|
|
- // console.log(blob)
|
|
|
- // blob.upload(file, 'header').then(
|
|
|
- // res => {
|
|
|
- // console.log(res)
|
|
|
- // this.schoolSetting.picture = res.url
|
|
|
- // },
|
|
|
- // err => {
|
|
|
- // console.log(err)
|
|
|
- // }
|
|
|
- // )
|
|
|
},
|
|
|
success(response, file, fileList) {
|
|
|
this.schoolSetting.picture = response.url
|
|
@@ -639,7 +661,7 @@ export default {
|
|
|
//计算时间轴选中颜色
|
|
|
timeLineColor(index) {
|
|
|
let len = this.schoolSetting.period[this.curPriodIndex].semesters.length
|
|
|
- let curIndex = -1
|
|
|
+ let curIndex = -1 //当前选中学期
|
|
|
if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month <= (index + 1)) {
|
|
|
if (this.curSemIndex < len - 1) {
|
|
|
if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex + 1].month > (index + 1)) {
|
|
@@ -648,12 +670,19 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let curMonth = this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month
|
|
|
- let nextMonth = -1
|
|
|
+ let nextMonth = -1 //下个学期的月份
|
|
|
if (this.curSemIndex == len - 1) {
|
|
|
nextMonth = this.schoolSetting.period[this.curPriodIndex].semesters[0].month
|
|
|
} else {
|
|
|
nextMonth = this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex + 1].month
|
|
|
}
|
|
|
+ if (curMonth == nextMonth) {
|
|
|
+ return {
|
|
|
+ color: (index + 1) == curMonth ? this.colorList[this.curSemIndex] : '#606060',
|
|
|
+ text: this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].name,
|
|
|
+ showArrow: (index + 1) == curMonth
|
|
|
+ }
|
|
|
+ }
|
|
|
if (curIndex != -1) {
|
|
|
return {
|
|
|
color: this.colorList[curIndex],
|
|
@@ -1316,6 +1345,20 @@ export default {
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
|
+ },
|
|
|
+ // 设置入学期提示
|
|
|
+ startWarning() {
|
|
|
+ let flag = true
|
|
|
+ if (this.schoolSetting.period && this.schoolSetting.period[this.curPriodIndex].semesters) {
|
|
|
+ this.schoolSetting.period[this.curPriodIndex].semesters.forEach(item => {
|
|
|
+ if (item.start == 1) {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ return flag
|
|
|
}
|
|
|
|
|
|
}
|