forked from liweijie/education
系统风格以及部分页面样式变更
This commit is contained in:
@@ -6,13 +6,9 @@
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新添</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">编辑</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-date" size="mini" :disabled="single" @click="handleEditCalendar">编辑校历</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">
|
||||
批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -72,6 +68,27 @@
|
||||
<span>{{ scope.row.sdjldw || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="220"
|
||||
fixed="right"
|
||||
class-name="table-action-column"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="mini" icon="el-icon-date" @click="handleEditCalendar(scope.row)">
|
||||
编辑校历
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
class="text-danger"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@@ -370,11 +387,12 @@ export default {
|
||||
this.title = "学期信息 - 新增"
|
||||
},
|
||||
/** 编辑按钮 */
|
||||
handleUpdate() {
|
||||
if (this.ids.length !== 1) return
|
||||
handleUpdate(row) {
|
||||
const semesterId = row && row.nd ? row.nd : this.ids[0]
|
||||
if (!semesterId) return
|
||||
this.reset()
|
||||
this.isAdd = false
|
||||
getSemester(this.ids[0]).then(response => {
|
||||
getSemester(semesterId).then(response => {
|
||||
const data = response.data || {}
|
||||
const { xn, xq } = this.parseNd(data.nd)
|
||||
// 解析锁定时长(如 "2周" / "1月" / "1")
|
||||
@@ -406,21 +424,22 @@ export default {
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 编辑校历按钮 */
|
||||
handleEditCalendar() {
|
||||
if (this.ids.length !== 1) return
|
||||
const nd = this.ids[0]
|
||||
handleEditCalendar(row) {
|
||||
const nd = row && row.nd ? row.nd : this.ids[0]
|
||||
if (!nd) return
|
||||
this.$router.push({
|
||||
path: '/teachBusiness/semester/semesterCalendar',
|
||||
query: { nd: nd, name: this.getSemesterName(nd) }
|
||||
})
|
||||
},
|
||||
/** 删除按钮 */
|
||||
handleDelete() {
|
||||
if (!this.ids.length) return
|
||||
const names = this.ids.map(nd => this.getSemesterName(nd)).join('、')
|
||||
handleDelete(row) {
|
||||
const semesterIds = row && row.nd ? [row.nd] : this.ids
|
||||
if (!semesterIds.length) return
|
||||
const names = semesterIds.map(nd => this.getSemesterName(nd)).join('、')
|
||||
this.$modal.confirm('确认删除学期【' + names + '】吗?').then(() => {
|
||||
// 批量删除:逐个调用
|
||||
const delList = this.ids.map(nd => delSemester(nd))
|
||||
const delList = semesterIds.map(nd => delSemester(nd))
|
||||
return Promise.all(delList)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
|
||||
Reference in New Issue
Block a user