|
|
@ -1,6 +1,36 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<content-header :title="$route.meta.title"></content-header> |
|
|
|
<content-header :title="$route.meta.title"></content-header> |
|
|
|
|
|
|
|
<!-- 搜索板块 --> |
|
|
|
|
|
|
|
<a-row class="row-item-search"> |
|
|
|
|
|
|
|
<a-form class="search-form" :form="searchForm" layout="inline" @submit="handleSearch"> |
|
|
|
|
|
|
|
<a-form-item label="教学名称/教学副标题"> |
|
|
|
|
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model="queryParam.search" |
|
|
|
|
|
|
|
style="width: 250px" |
|
|
|
|
|
|
|
placeholder="请输入教学名称/教学副标题" |
|
|
|
|
|
|
|
allow-clear |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
<a-form-item label="教学分类"> |
|
|
|
|
|
|
|
<a-select @change="getCourseCategory" style="width: 250px" placeholder="请选择"> |
|
|
|
|
|
|
|
<a-select-option |
|
|
|
|
|
|
|
:value="item.course_category_id" |
|
|
|
|
|
|
|
v-for="item in courseTypeList" |
|
|
|
|
|
|
|
:key="item.course_category_id" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ item.name }} |
|
|
|
|
|
|
|
</a-select-option> |
|
|
|
|
|
|
|
</a-select> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
<a-form-item class="search-btn"> |
|
|
|
|
|
|
|
<a-button type="primary" icon="search" html-type="submit">搜索</a-button> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
<a-form-item class="search-btn"> |
|
|
|
|
|
|
|
<a-button @click="handleReset">重置</a-button> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</a-form> |
|
|
|
|
|
|
|
</a-row> |
|
|
|
<div class="table-operator"> |
|
|
|
<div class="table-operator"> |
|
|
|
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button> |
|
|
|
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -8,6 +38,7 @@ |
|
|
|
<span slot="status" slot-scope="text"> |
|
|
|
<span slot="status" slot-scope="text"> |
|
|
|
<a-tag :color="text ? 'green' : ''">{{ text ? '显示' : '隐藏' }}</a-tag> |
|
|
|
<a-tag :color="text ? 'green' : ''">{{ text ? '显示' : '隐藏' }}</a-tag> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
|
|
|
|
<span slot="course_category_id" slot-scope="text">{{ text == 1 ? '基础性教学' : '系统性教学' }} </span> |
|
|
|
<span slot="action" slot-scope="text, item"> |
|
|
|
<span slot="action" slot-scope="text, item"> |
|
|
|
<a style="margin-right: 8px" @click="handleEdit(item)">编辑</a> |
|
|
|
<a style="margin-right: 8px" @click="handleEdit(item)">编辑</a> |
|
|
|
<a @click="handleDelete(item)">删除</a> |
|
|
|
<a @click="handleDelete(item)">删除</a> |
|
|
@ -57,13 +88,14 @@ export default { |
|
|
|
dataIndex: 'course_subheading', |
|
|
|
dataIndex: 'course_subheading', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '教学详情', |
|
|
|
title: '教学分类', |
|
|
|
dataIndex: 'course_detail', |
|
|
|
dataIndex: 'course_category_id', |
|
|
|
|
|
|
|
scopedSlots: { customRender: 'course_category_id' }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '状态', |
|
|
|
title: '状态', |
|
|
|
dataIndex: 'status', |
|
|
|
dataIndex: 'status', |
|
|
|
scopedSlots: { customRender: 'status' } |
|
|
|
scopedSlots: { customRender: 'status' }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '排序', |
|
|
|
title: '排序', |
|
|
@ -80,9 +112,11 @@ export default { |
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
queryParam: { search: '', courseCategory: null }, |
|
|
|
|
|
|
|
searchForm: this.$form.createForm(this), |
|
|
|
// 加载数据方法 必须为 Promise 对象 |
|
|
|
// 加载数据方法 必须为 Promise 对象 |
|
|
|
loadData: (param) => { |
|
|
|
loadData: (param) => { |
|
|
|
return Api.list(param).then((response) => { |
|
|
|
return Api.list({ ...param, ...this.queryParam }).then((response) => { |
|
|
|
return response.data.list |
|
|
|
return response.data.list |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -92,6 +126,26 @@ export default { |
|
|
|
this.getCourseTypeList() |
|
|
|
this.getCourseTypeList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
getCourseCategory(val) { |
|
|
|
|
|
|
|
this.queryParam.courseCategory = val |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 确认搜索 |
|
|
|
|
|
|
|
handleSearch(e) { |
|
|
|
|
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
this.searchForm.validateFields((error, values) => { |
|
|
|
|
|
|
|
if (!error) { |
|
|
|
|
|
|
|
this.queryParam = { ...this.queryParam, ...values } |
|
|
|
|
|
|
|
this.handleRefresh(true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置搜索表单 |
|
|
|
|
|
|
|
handleReset() { |
|
|
|
|
|
|
|
this.queryParam.courseCategory = null |
|
|
|
|
|
|
|
this.queryParam.search = '' |
|
|
|
|
|
|
|
this.handleRefresh(true) |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取分类列表 |
|
|
|
// 获取分类列表 |
|
|
|
getCourseTypeList() { |
|
|
|
getCourseTypeList() { |
|
|
|
Api.getCourselist() |
|
|
|
Api.getCourselist() |
|
|
|