|
|
@ -1,180 +1,516 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div style="margin-top: 20px"> |
|
|
|
<div style="width: 50%;margin-top: 50px;float: left"> |
|
|
|
<el-card shadow="never"> |
|
|
|
<el-row type="flex" align="top" :gutter="10" class="el-row"> |
|
|
|
<div style="display: flex;float: right"> |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
<div> |
|
|
|
<span class="require-icon">*</span> |
|
|
|
<div style="width: 300px;height: 60px;margin-right: 50px"> |
|
|
|
<span class="text-title">名称:</span> |
|
|
|
<div style="align-content: center"> |
|
|
|
</el-col> |
|
|
|
<div style="display: flex;float: left;margin-top: 20px;margin-left: 10px"> |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
<span style="">习题篮</span> |
|
|
|
<el-input |
|
|
|
</div> |
|
|
|
maxlength="50" |
|
|
|
<div style="display: flex;float: left"> |
|
|
|
:rows="1" |
|
|
|
<div style="margin-top: 12px;margin-left: 10px"> |
|
|
|
placeholder="最多输入50个字" |
|
|
|
<span style="font-size: 30px;">50</span> |
|
|
|
show-word-limit |
|
|
|
</div> |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-input> |
|
|
|
<div style="display: flex;float: left"> |
|
|
|
</el-col> |
|
|
|
<div style="margin-top: 10px;margin-left: 20px"> |
|
|
|
</el-row> |
|
|
|
<img src="../../assets/sz.png" style="width: 40px;height: 40px"> |
|
|
|
<el-row type="flex" align="top" :gutter="10" class="el-row"> |
|
|
|
</div> |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
</div> |
|
|
|
<span class="require-icon">*</span> |
|
|
|
<div style="display: flex;float: left"> |
|
|
|
<span class="text-title">介绍:</span> |
|
|
|
<div style="margin-top: 10px;margin-left: 20px"> |
|
|
|
</el-col> |
|
|
|
<img src="../../assets/msg-course.png" style="width: 40px;height: 40px"> |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
</div> |
|
|
|
<el-inputq |
|
|
|
</div> |
|
|
|
type="textarea" |
|
|
|
<div style="display: flex;float: left"> |
|
|
|
maxlength="150" |
|
|
|
<div style="margin-top: 10px;margin-left: 20px"> |
|
|
|
:rows="4" |
|
|
|
<img src="../../assets/delete.png" style="width: 40px;height: 40px"> |
|
|
|
placeholder="最多输入150个字" |
|
|
|
</div> |
|
|
|
show-word-limit |
|
|
|
</div> |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-inputq> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</div> |
|
|
|
</el-row> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-row type="flex" align="middle" :gutter="10" class="el-row"> |
|
|
|
<el-form-item style="margin-top: 10px"> |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
<el-upload |
|
|
|
<span class="require-icon">*</span> |
|
|
|
class="upload" |
|
|
|
<span class="text-title">类型:</span> |
|
|
|
action="#" |
|
|
|
</el-col> |
|
|
|
:show-file-list="true" |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
:on-change="handleExcel" |
|
|
|
<el-select |
|
|
|
accept="'.xlsx','.xls'" |
|
|
|
style="width:100%" |
|
|
|
:auto-upload="false"> |
|
|
|
clearable |
|
|
|
<el-button type="primary">批量导入</el-button> |
|
|
|
multiple |
|
|
|
</el-upload> |
|
|
|
placeholder="请选择类型" |
|
|
|
</el-form-item> |
|
|
|
> |
|
|
|
</el-form> |
|
|
|
<el-option |
|
|
|
<el-form :inline="true"> |
|
|
|
v-for="item in typelist" |
|
|
|
<el-form-item style="margin-top: 10px"> |
|
|
|
:key="item.id" |
|
|
|
<el-button type="primary" |
|
|
|
:label="item.name" |
|
|
|
@click="addCourse()">创建习题 |
|
|
|
:value="item.id" |
|
|
|
</el-button> |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-option> |
|
|
|
</el-form> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<div class="crud__left"> |
|
|
|
</el-row> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-row type="flex" align="middle" :gutter="10" class="el-row"> |
|
|
|
<div style="float: right;"> |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
<el-row> |
|
|
|
<span class="require-icon">*</span> |
|
|
|
<el-form-item style="float: left" label="关键子:"> |
|
|
|
<span class="text-title">难度:</span> |
|
|
|
<el-input v-model="dataForm.name" |
|
|
|
</el-col> |
|
|
|
placeholder="关键子" clearable></el-input> |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
</el-form-item> |
|
|
|
<el-select |
|
|
|
<el-form-item style="float: left" label="类型:"> |
|
|
|
style="width:100%" |
|
|
|
<el-select |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
multiple |
|
|
|
v-model="dataForm.type" |
|
|
|
placeholder="请选择难度" |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in typelist" |
|
|
|
v-for="item in typeList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id" |
|
|
|
:value="item.id" |
|
|
|
> |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
<el-form-item style="float: left" label="难度:"> |
|
|
|
<el-row type="flex" align="middle" :gutter="10" class="el-row"> |
|
|
|
<el-select |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
clearable |
|
|
|
<span class="require-icon">*</span> |
|
|
|
v-model="dataForm.difficulty" |
|
|
|
<span class="text-title">分类:</span> |
|
|
|
placeholder="请选择" |
|
|
|
</el-col> |
|
|
|
> |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
<el-option |
|
|
|
<el-select |
|
|
|
v-for="item in difficultyList" |
|
|
|
style="width:100%" |
|
|
|
:key="item.id" |
|
|
|
clearable |
|
|
|
:label="item.name" |
|
|
|
multiple |
|
|
|
:value="item.id" |
|
|
|
placeholder="请选择分类" |
|
|
|
> |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
<el-option |
|
|
|
</el-select> |
|
|
|
v-for="item in typelist" |
|
|
|
</el-form-item> |
|
|
|
:key="item.id" |
|
|
|
<el-form-item style="float: left" label="科目:"> |
|
|
|
:label="item.name" |
|
|
|
<el-select |
|
|
|
:value="item.id" |
|
|
|
clearable |
|
|
|
> |
|
|
|
multiple |
|
|
|
</el-option> |
|
|
|
v-model="dataForm.subjectIdList" |
|
|
|
</el-select> |
|
|
|
placeholder="请选择" |
|
|
|
</el-col> |
|
|
|
> |
|
|
|
</el-row> |
|
|
|
<el-option |
|
|
|
</div> |
|
|
|
v-for="item in subjectList" |
|
|
|
<div style="width: 50%;margin-top: 50px;float: right"> |
|
|
|
:key="item.id" |
|
|
|
<el-row type="flex" align="top" :gutter="10" class="el-row"> |
|
|
|
:label="item.name" |
|
|
|
<el-col :span="4" class="text-right"> |
|
|
|
:value="item.id" |
|
|
|
<span class="text-title">添加习题:</span> |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-option> |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
</el-select> |
|
|
|
<el-button style="" @click="next" size="mini">添加</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-form-item style="float: left" label="状态:"> |
|
|
|
</el-row> |
|
|
|
<el-select |
|
|
|
<el-row type="flex" align="top" :gutter="10" class="el-row"> |
|
|
|
clearable |
|
|
|
<el-col :span="14" class="text-content"> |
|
|
|
v-model="dataForm.coursestatus" |
|
|
|
<el-button style="" @click="next">确认</el-button> |
|
|
|
placeholder="请选择" |
|
|
|
</el-col> |
|
|
|
> |
|
|
|
</el-row> |
|
|
|
<el-option |
|
|
|
</div> |
|
|
|
v-for="item in statusList" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item style="float: left" label="是否真题:"> |
|
|
|
|
|
|
|
<el-select |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
v-model="dataForm.essential" |
|
|
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in essentialList" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-form-item style="float: left" label="创建时间:"> |
|
|
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
|
|
v-model="dataForm.time" |
|
|
|
|
|
|
|
type="daterange" |
|
|
|
|
|
|
|
range-separator="至" |
|
|
|
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
|
|
|
style="width: 320px" |
|
|
|
|
|
|
|
end-placeholder="结束日期"> |
|
|
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item style="float: right;"> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="submitClick">查询 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-table :data="dataList" max-height="800"> |
|
|
|
|
|
|
|
<el-table-column label="序号" |
|
|
|
|
|
|
|
header-align="center" align="center" width="50"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<span> |
|
|
|
|
|
|
|
{{ scope.$index + 1 }} |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="content" label="习题题干" |
|
|
|
|
|
|
|
header-align="center" align="left" width="300"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="type" label="类型" |
|
|
|
|
|
|
|
header-align="center" align="center" width="150"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<b v-if="scope.row.type === 'SINGLE'">单选题</b> |
|
|
|
|
|
|
|
<b v-if="scope.row.type === 'MULTI'">多选题</b> |
|
|
|
|
|
|
|
<b v-if="scope.row.type === 'YESNO'">判断题</b> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="subjectId" label="科目" |
|
|
|
|
|
|
|
header-align="center" align="center" width="120"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<b>{{scope.row.subjectName}}</b> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="creationTime" label="创建时间" |
|
|
|
|
|
|
|
header-align="center" align="center" width="200"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<b>{{scope.row.creationTime.toString().substr(0,10)}}</b> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="original" label="是否真题" |
|
|
|
|
|
|
|
header-align="center" align="center" width="120"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<b v-if="scope.row.original">是</b> |
|
|
|
|
|
|
|
<b v-else>否</b> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="difficulty" label="难度" |
|
|
|
|
|
|
|
header-align="center" align="center" width="150"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="collectionNum" label="引用数" |
|
|
|
|
|
|
|
header-align="center" align="center" width="200"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<b v-if="scope.row.collectionNum !== null">{{scope.row.collectionNum}}</b> |
|
|
|
|
|
|
|
<b v-else>0</b> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" fixed="right" header-align="center" align="center" |
|
|
|
|
|
|
|
width="150"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button type="text" size="mini" |
|
|
|
|
|
|
|
@click="updateCourse(scope.row)">查看 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="text" size="mini" |
|
|
|
|
|
|
|
@click="updateRow(scope.row,'DOWN')">隐藏 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="text" size="mini" |
|
|
|
|
|
|
|
@click="updateRow(scope.row,'UP')">加篮 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-pagination |
|
|
|
|
|
|
|
:current-page="page" |
|
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
|
|
|
:page-size="limit" |
|
|
|
|
|
|
|
:page-sizes="pageSizes" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="pageCurrentChangeHandle" |
|
|
|
|
|
|
|
@size-change="pageSizeChangeHandle"/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import { postRequest, getRequest, deleteRequest, putRequest, uploadFileRequest } from '../../utils/api' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
active: 1, |
|
|
|
page: 1, // 当前页码 |
|
|
|
typelist: [], |
|
|
|
limit: 10, // 每页数 |
|
|
|
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}], |
|
|
|
total: 0, // 总条数 |
|
|
|
data: [{ |
|
|
|
pageSizes: [10, 50, 100, 500, 1000], // 分页条数设置 |
|
|
|
label: '一级 1', |
|
|
|
activeName: 'first', |
|
|
|
children: [{ |
|
|
|
dataForm: { |
|
|
|
label: '二级 1-1', |
|
|
|
essential: '', |
|
|
|
children: [{ |
|
|
|
difficulty: '', |
|
|
|
label: '三级 1-1-1' |
|
|
|
name: '', |
|
|
|
}] |
|
|
|
teacherName: '', |
|
|
|
}] |
|
|
|
type: '', |
|
|
|
}, { |
|
|
|
coursestatus: '', |
|
|
|
label: '一级 2', |
|
|
|
time: [], |
|
|
|
children: [{ |
|
|
|
subjectIdList: [] |
|
|
|
label: '二级 2-1', |
|
|
|
}, |
|
|
|
children: [{ |
|
|
|
typeList: [ |
|
|
|
label: '三级 2-1-1' |
|
|
|
{ |
|
|
|
}] |
|
|
|
id: '', |
|
|
|
}, { |
|
|
|
name: '全部' |
|
|
|
label: '二级 2-2', |
|
|
|
}, |
|
|
|
children: [{ |
|
|
|
{ |
|
|
|
label: '三级 2-2-1' |
|
|
|
id: 'SINGLE', |
|
|
|
}] |
|
|
|
name: '单选题' |
|
|
|
}] |
|
|
|
}, |
|
|
|
}, { |
|
|
|
{ |
|
|
|
label: '一级 3', |
|
|
|
id: 'MULTI', |
|
|
|
children: [{ |
|
|
|
name: '多选题' |
|
|
|
label: '二级 3-1', |
|
|
|
}, |
|
|
|
children: [{ |
|
|
|
{ |
|
|
|
label: '三级 3-1-1' |
|
|
|
id: 'YESNO', |
|
|
|
}] |
|
|
|
name: '对错题' |
|
|
|
}, { |
|
|
|
}, |
|
|
|
label: '二级 3-2', |
|
|
|
], |
|
|
|
children: [{ |
|
|
|
essentialList: [ |
|
|
|
label: '三级 3-2-1' |
|
|
|
{ |
|
|
|
}] |
|
|
|
id: '', |
|
|
|
}] |
|
|
|
name: '全部', |
|
|
|
}], |
|
|
|
}, |
|
|
|
}; |
|
|
|
{ |
|
|
|
|
|
|
|
id: '1', |
|
|
|
|
|
|
|
name: '是', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '2', |
|
|
|
|
|
|
|
name: '否', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
difficultyList: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '', |
|
|
|
|
|
|
|
name: '全部' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '1' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '2' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 3, |
|
|
|
|
|
|
|
name: '3' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 4, |
|
|
|
|
|
|
|
name: '4' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 5, |
|
|
|
|
|
|
|
name: '5' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
statusList: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '', |
|
|
|
|
|
|
|
name: '全部' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '1', |
|
|
|
|
|
|
|
name: '未被引用' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '2', |
|
|
|
|
|
|
|
name: '被引用' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '3', |
|
|
|
|
|
|
|
name: '已隐藏' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
dataFormType: { |
|
|
|
|
|
|
|
name: '' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
dataList: [], |
|
|
|
|
|
|
|
subjectList: [], |
|
|
|
|
|
|
|
teacherList: [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
activated () { |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
this.getTypeList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
created () { |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
this.getTypeList() |
|
|
|
|
|
|
|
this.getTeacherList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mounted () { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
next() { |
|
|
|
//导入表格 |
|
|
|
if (this.active++ > 1) this.active = 1; |
|
|
|
handleExcel(file) { |
|
|
|
|
|
|
|
let formData = new FormData(); //声明一个FormDate对象 |
|
|
|
|
|
|
|
formData.append("file", file.raw); //把文件信息放入对象中 |
|
|
|
|
|
|
|
//调用后台导入的接口 |
|
|
|
|
|
|
|
uploadFileRequest('/edu/v1/pc/question/upload',formData).then(res => { |
|
|
|
|
|
|
|
// console.log(res) |
|
|
|
|
|
|
|
if (res.Status && res.Data) { |
|
|
|
|
|
|
|
this.$message.success("导入成功"); |
|
|
|
|
|
|
|
this.getList(); // 导入表格之后可以获取导入的数据渲染到页面,此处的方法是获取导入的数据 |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.error(res.Message) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
that.$message({ |
|
|
|
|
|
|
|
type: 'error', |
|
|
|
|
|
|
|
message: '导入失败' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//分页-页数 |
|
|
|
|
|
|
|
pageCurrentChangeHandle (val) { |
|
|
|
|
|
|
|
this.page = val |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//分页-条数 |
|
|
|
|
|
|
|
pageSizeChangeHandle (val) { |
|
|
|
|
|
|
|
this.page = 1 |
|
|
|
|
|
|
|
this.limit = val |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//查询初始化 |
|
|
|
|
|
|
|
submitClickType: function (item) { |
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getRequest('/edu/v1/pc/course3', { |
|
|
|
|
|
|
|
filer: {name: this.dataForm.name}, |
|
|
|
|
|
|
|
pagination: {pageNo: 1,pageSize: 10} |
|
|
|
|
|
|
|
}).then(resp=> { |
|
|
|
|
|
|
|
_this.loading = false; |
|
|
|
|
|
|
|
if (resp.status === 200) { |
|
|
|
|
|
|
|
this.dataList = resp.data.data.list |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//失败 |
|
|
|
|
|
|
|
_this.$alert(''); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, resp=> { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//状态修改 |
|
|
|
|
|
|
|
updateRow(row,status){ |
|
|
|
|
|
|
|
putRequest('/edu/v1/pc/updateCourse/'+row.id+'/'+status).then(res=> { |
|
|
|
|
|
|
|
console.log('111----', res) |
|
|
|
|
|
|
|
this.$alert('修改成功','修改'); |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//删除 |
|
|
|
|
|
|
|
deleteRow(row){ |
|
|
|
|
|
|
|
deleteRequest('/edu/v1/pc/course/'+row.id).then(res=> { |
|
|
|
|
|
|
|
console.log('111----', res) |
|
|
|
|
|
|
|
this.$alert('删除成功','删除'); |
|
|
|
|
|
|
|
this.submitClick() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//查询列表 |
|
|
|
|
|
|
|
submitClick: function () { |
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
var startTime = '' |
|
|
|
|
|
|
|
var endTime = '' |
|
|
|
|
|
|
|
if(this.dataForm.time !==null && this.dataForm.time.length>0){ |
|
|
|
|
|
|
|
startTime = this.dataForm.time[0] |
|
|
|
|
|
|
|
endTime = this.dataForm.time[1] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var filter = { |
|
|
|
|
|
|
|
filer: { |
|
|
|
|
|
|
|
name: this.dataForm.name, |
|
|
|
|
|
|
|
type: this.dataForm.type, |
|
|
|
|
|
|
|
coursestatus: this.dataForm.coursestatus, |
|
|
|
|
|
|
|
subjectIdList: this.dataForm.subjectIdList, |
|
|
|
|
|
|
|
teacherName: this.dataForm.teacherName, |
|
|
|
|
|
|
|
startTime: startTime, |
|
|
|
|
|
|
|
endTime: endTime, |
|
|
|
|
|
|
|
difficulty: this.dataForm.difficulty, |
|
|
|
|
|
|
|
essential: this.dataForm.essential |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
pagination: { |
|
|
|
|
|
|
|
pageNo: this.page, |
|
|
|
|
|
|
|
pageSize: this.limit |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
postRequest('/edu/v1/mp/questionList', JSON.stringify(filter)).then(resp=> { |
|
|
|
|
|
|
|
_this.loading = false; |
|
|
|
|
|
|
|
if (resp.status === 200) { |
|
|
|
|
|
|
|
this.dataList = resp.data.data.list |
|
|
|
|
|
|
|
this.total = resp.data.data.size |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//失败 |
|
|
|
|
|
|
|
_this.$alert(''); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, resp=> { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getTypeList: function () { |
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getRequest('/edu/v1/pc/subject/by/name', JSON.stringify({ |
|
|
|
|
|
|
|
mode: 'all', |
|
|
|
|
|
|
|
})).then(resp=> { |
|
|
|
|
|
|
|
_this.loading = false; |
|
|
|
|
|
|
|
if (resp.status === 200) { |
|
|
|
|
|
|
|
this.subjectList = resp.data.data |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//失败 |
|
|
|
|
|
|
|
this.$alert(''); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, resp=> { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getTeacherList: function () { |
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getRequest('/edu/v1/pc/school/schoolTeacher', JSON.stringify({ |
|
|
|
|
|
|
|
scope: '10010', |
|
|
|
|
|
|
|
})).then(resp=> { |
|
|
|
|
|
|
|
_this.loading = false; |
|
|
|
|
|
|
|
if (resp.status === 200) { |
|
|
|
|
|
|
|
this.teacherList = resp.data.data |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//失败 |
|
|
|
|
|
|
|
_this.$alert(''); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, resp=> { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleClick(tab, event) { |
|
|
|
|
|
|
|
console.log(tab, event); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove(file, fileList) { |
|
|
|
addCourse(){ |
|
|
|
console.log(file, fileList); |
|
|
|
// 打开路由 |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: "/add-coures", |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePreview(file) { |
|
|
|
updateCourse(row){ |
|
|
|
console.log(file); |
|
|
|
// 打开路由 |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: "/coures-info", |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
couresName: row.type, |
|
|
|
|
|
|
|
id: row.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
finde(){ |
|
|
|
dyOpenTab(){ |
|
|
|
// 打开路由 |
|
|
|
// 打开路由 |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
|
path: "/coures", |
|
|
|
path: "/subscribe", |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -182,52 +518,22 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
<style type="text/css"> |
|
|
|
.apply-step-box { |
|
|
|
.crud__left { |
|
|
|
padding: 24px 104px; |
|
|
|
display: -webkit-box; |
|
|
|
} |
|
|
|
display: -ms-flexbox; |
|
|
|
.el-row { |
|
|
|
display: flex; |
|
|
|
margin-bottom: 15px; |
|
|
|
float: left; |
|
|
|
.text-right { |
|
|
|
-webkit-box-pack: end; |
|
|
|
text-align: right; |
|
|
|
-ms-flex-pack: end; |
|
|
|
.text-title { |
|
|
|
justify-content: flex-end |
|
|
|
color: #606266; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.text-content { |
|
|
|
|
|
|
|
.content-span { |
|
|
|
|
|
|
|
color: #909399; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.prompt { |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
color: #909399; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.icon-tip { |
|
|
|
|
|
|
|
width: 14px; |
|
|
|
|
|
|
|
height: 14px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.button-check { |
|
|
|
|
|
|
|
width: 88px; |
|
|
|
|
|
|
|
background: #ffffff; |
|
|
|
|
|
|
|
color: #409eff; |
|
|
|
|
|
|
|
border: 1px solid #409eff; |
|
|
|
|
|
|
|
border-radius: 0px 4px 4px 0px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.color-red { |
|
|
|
|
|
|
|
color: #f56c6c; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.font-12 { |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.word-break { |
|
|
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.require-icon { |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
color: #ff0000; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.crud__right { |
|
|
|
|
|
|
|
display: -webkit-box; |
|
|
|
|
|
|
|
display: -ms-flexbox; |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
-webkit-box-pack: end; |
|
|
|
|
|
|
|
-ms-flex-pack: end; |
|
|
|
|
|
|
|
justify-content: flex-end |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|