Browse Source

提交框架更新

master
陈志鹏 2 years ago
parent
commit
f9a7727335
  1. 28
      src/components/heat.vue
  2. 2
      src/page/Home.vue
  3. 98
      src/page/coures/add-coures.vue
  4. 683
      src/page/coures/coures-info.vue
  5. 43
      src/page/coures/coures.vue
  6. 15
      src/router/index.js

28
src/components/heat.vue

@ -9,7 +9,7 @@ export default {
data() { data() {
return { return {
xData: ['2022/10/11', '2022/10/12', '2022/10/13', '2022/10/14', '2022/10/15', '2022/10/16', '2022/10/17'], // xData: ['2022/10/11', '2022/10/12', '2022/10/13', '2022/10/14', '2022/10/15', '2022/10/16', '2022/10/17'], //
yData: [23, 24, 18, 25, 27, 28, 25], // yData: [10, 24, 18, 25, 27, 28, 25], //
myChartStyle: { float: 'left', width: '100%', height: '400px' }, // myChartStyle: { float: 'left', width: '100%', height: '400px' }, //
} }
}, },
@ -20,10 +20,6 @@ export default {
initEcharts() { initEcharts() {
// //
const option = { const option = {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#00fffb' }, //0
{ offset: 1, color: '#0061ce' }, //1
]),
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
}, },
@ -90,11 +86,25 @@ export default {
}, },
series: [ series: [
{ {
type: 'bar', //
data: this.yData, data: this.yData,
barWidth: 20, type: 'bar',
}, showBackground: true,
], barWidth: 40,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: {
normal: {
//
color: function(params) {
//
var colorList = ['#CCCCCC'];
return colorList[params.dataIndex]
}
}
}
}
]
} }
const myChart = echarts.init(document.getElementById('mychart')) const myChart = echarts.init(document.getElementById('mychart'))
myChart.setOption(option) myChart.setOption(option)

2
src/page/Home.vue

@ -24,7 +24,7 @@
<el-aside width="900px" style="background-color: dodgerblue;"> <el-aside width="900px" style="background-color: dodgerblue;">
<el-menu <el-menu
default-active="0" default-active="0"
class="el-menu-vertical-demo" style="background-color: dodgerblue;display: flex" router> class="el-menu-vertical-demo" style="background-color: dodgerblue;display: flex;width: 100%" router>
<template v-for="(item,index) in this.$router.options.routes" v-if="!item.hidden"> <template v-for="(item,index) in this.$router.options.routes" v-if="!item.hidden">
<el-submenu :index="index+''" v-if="item.children.length>1" :key="index"> <el-submenu :index="index+''" v-if="item.children.length>1" :key="index">
<template slot="title"> <template slot="title">

98
src/page/coures/add-coures.vue

@ -0,0 +1,98 @@
<template>
<div style="margin-top: 20px">
<el-card style="">
<div style="margin-top: 50px;width: 100%">
<div style="width: 200px;height: 400px;background-color: #8cc5ff;float: left;margin-left: 280px" @click="setCoures('视频课')">
<div style="align-content: center">
<div style="margin-top: 80px;font-size: 30px;font-weight: bolder;color: #ffffff">
<img style="width: 100px;height: 100px;border-radius: 65px" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.gpbctv.com%2Fuploads%2F20210424%2Fzip_1619246266UkP6CL.jpg&refer=http%3A%2F%2Fwww.gpbctv.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668584440&t=cbeb6a7281e4058a12dcf2f83cd25901">
</div>
<div style="padding-top: 10px;color: #ffffff">视频课</div>
</div>
</div>
<div style="width: 200px;height: 400px;background-color: #8cc5ff;float: left;margin-left: 280px" @click="setCoures('直播课')">
<div style="align-content: center">
<div style="margin-top: 80px;font-size: 30px;font-weight: bolder;color: #ffffff">
<img style="width: 100px;height: 100px;border-radius: 65px" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.gpbctv.com%2Fuploads%2F20210424%2Fzip_1619246266UkP6CL.jpg&refer=http%3A%2F%2Fwww.gpbctv.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668584440&t=cbeb6a7281e4058a12dcf2f83cd25901">
</div>
<div style="padding-top: 10px;color: #ffffff">直播课</div>
</div>
</div>
<div style="width: 200px;height: 400px;background-color: #8cc5ff;float: left;margin-left: 280px" @click="setCoures('现场课')">
<div style="align-content: center">
<div style="margin-top: 80px;font-size: 30px;font-weight: bolder;color: #ffffff">
<img style="width: 100px;height: 100px;border-radius: 65px" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.gpbctv.com%2Fuploads%2F20210424%2Fzip_1619246266UkP6CL.jpg&refer=http%3A%2F%2Fwww.gpbctv.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668584440&t=cbeb6a7281e4058a12dcf2f83cd25901">
</div>
<div style="padding-top: 10px;color: #ffffff">现场课</div>
</div>
</div>
</div>
<div style="width: 100%;float: left;margin-top: 100px;margin-bottom: 100px">
<el-button type="primary" @click="openCoures()">确认</el-button>
</div>
</el-card>
</div>
</template>
<script>
export default {
data () {
return {
activeName: 'first',
dataForm: {
name: '',
teacherName: '',
type: '',
status: '',
time: '',
subjectIdList: []
},
dataFormType: {
name: ''
},
couresName: '',
dataList: [],
subjectList: [],
teacherList: []
}
},
mounted () {
},
methods: {
setCoures(e){
this.couresName = e
},
openCoures() {
if (this.couresName !== '') {
//
this.$router.push({
path: "/coures-info",
query: {
couresName: this.couresName
}
});
} else {
this.$alert('请选择新建课程类型!', '请确认!');
}
}
}
}
</script>
<style type="text/css">
.crud__left {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
float: left;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end
}
.crud__right {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end
}
</style>

683
src/page/coures/coures-info.vue

@ -1,20 +1,24 @@
<template> <template>
<div> <div>
<div class="apply-step-box"> <div class="apply-step-box">
<el-steps :active="active" simple> <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-step title="课程信息"></el-step> <el-tab-pane label="基本信息" name="first">基本信息</el-tab-pane>
<el-step title="章节信息"></el-step> <el-tab-pane label="章节信息" name="second" v-if="dataForm.type === '视频课'">章节信息</el-tab-pane>
</el-steps> <el-tab-pane label="直播信息" name="third" v-if="dataForm.type === '直播课'">直播信息</el-tab-pane>
<el-tab-pane label="现场信息" name="fourth" v-if="dataForm.type === '现场课'">现场信息</el-tab-pane>
<el-tab-pane label="学员信息" name="fiveth">学员信息</el-tab-pane>
</el-tabs>
</div> </div>
<div v-if="active === 1"> <div v-if="activeName === 'first'">
<div style="width: 100%;display: flex"> <div style="width: 100%;">
<div style="width: 60%;float: left"> <div style="width: 60%;margin-left: 22%">
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right"> <el-col :span="4" class="text-right">
<span class="text-title">课程标题</span> <span class="text-title">课程名称</span>
</el-col> </el-col>
<el-col :span="14" class="text-content"> <el-col :span="14" class="text-content">
<el-input <el-input
v-model="dataForm.name"
maxlength="25" maxlength="25"
:rows="1" :rows="1"
placeholder="最多输入25个字" placeholder="最多输入25个字"
@ -25,32 +29,40 @@
</el-row> </el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right"> <el-col :span="4" class="text-right">
<span class="text-title">主讲老师</span> <span class="text-title">课程类型</span>
</el-col> </el-col>
<el-col :span="14" class="text-content"> <el-col :span="14" class="text-content">
<el-input <el-select
maxlength="25" disabled
:rows="1" style="width:100%"
placeholder="最多输入25个字" clearable
show-word-limit v-model="dataForm.type"
placeholder="请选择"
> >
</el-input> <el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" align="middle" :gutter="10" class="el-row"> <el-row type="flex" align="middle" :gutter="10" class="el-row">
<el-col :span="4" class="text-right"> <el-col :span="4" class="text-right">
<span class="require-icon">*</span> <span class="require-icon">*</span>
<span class="text-title">课程分类</span> <span class="text-title">课程科目</span>
</el-col> </el-col>
<el-col :span="14" class="text-content"> <el-col :span="14" class="text-content">
<el-select <el-select
style="width:100%" style="width:100%"
clearable clearable
multiple v-model="dataForm.subject"
placeholder="请选择分类" placeholder="请选择"
> >
<el-option <el-option
v-for="item in typelist" v-for="item in subjectList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
@ -59,6 +71,27 @@
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="text-title">主讲老师</span>
</el-col>
<el-col :span="14" class="text-content">
<el-select
style="width:100%"
clearable
v-model="dataForm.teacherName"
placeholder="请选择"
>
<el-option
v-for="item in teacherList"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right"> <el-col :span="4" class="text-right">
<span class="require-icon">*</span> <span class="require-icon">*</span>
@ -80,7 +113,7 @@
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right"> <el-col :span="4" class="text-right">
<span class="require-icon">*</span> <span class="require-icon">*</span>
<span class="text-title">简介</span> <span class="text-title">课程说明</span>
</el-col> </el-col>
<el-col :span="14" class="text-content"> <el-col :span="14" class="text-content">
<el-input <el-input
@ -94,172 +127,488 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div style="float: right;width: 40%"> </div>
<el-row type="flex" align="top" :gutter="10" class="el-row"> </div>
<el-col :span="4" class="text-right"> <div v-else-if="activeName === 'second' ">
<span class="require-icon">*</span> <div style="width: 60%;margin-left: 20%">
<span class="text-title">课程难度</span> <div style="display: flex;float: left">
</el-col> <el-form :inline="true">
<el-col :span="14" class="text-content"> <el-form-item>
<el-radio v-model="radio" label="1">简单</el-radio> <el-button type="primary"
<el-radio v-model="radio" label="2">一般</el-radio> @click="handleAdd()">新增章节
<el-radio v-model="radio" label="2"></el-radio> </el-button>
</el-col> </el-form-item>
</el-row> <el-form-item>
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-button type="primary"
<el-col :span="4" class="text-right"> @click="addCourse()">结课
<span class="require-icon">*</span> </el-button>
<span class="text-title">课程价格</span> </el-form-item>
</el-col> </el-form>
<el-col :span="14" class="text-content"> </div>
<el-radio v-model="radio" label="1">免费</el-radio> <div>
<el-radio v-model="radio" label="2">收费</el-radio> <el-table
</el-col> border
</el-row> :data="tableData"
<el-row type="flex" align="top" :gutter="10" class="el-row"> >
<el-col :span="4" class="text-right"> <el-table-column prop="name" label="序号" align="center">
<span class="require-icon">*</span> <template slot-scope="scope">
<span class="text-title">课程标签</span> <span>
</el-col> {{ scope.$index + 1 }}
<el-col :span="14" class="text-content"> </span>
</template>
</el-table-column>
<el-table-column prop="inIp" label="章节名称" align="center">
<template slot-scope="scope">
<el-input <el-input
type="textarea" v-if="scope.row.isEdit"
maxlength="150" v-model="scope.row.inPort"
:rows="4" maxlength="20"
placeholder="最多输入150个字" placeholder="Required"
show-word-limit />
> <span v-else v-text="scope.row.inIp"></span>
</el-input> </template>
</el-col> </el-table-column>
</el-row> <el-table-column prop="inPort" label="状态" align="center">
</div> <template slot-scope="scope">
<el-input
v-if="scope.row.isEdit"
v-model="scope.row.inPort"
maxlength="20"
placeholder="Required"
/>
<span v-else v-text="scope.row.inPort"></span>
</template>
</el-table-column>
<el-table-column prop="outPort" label="视频" align="center">
<template slot-scope="scope">
<el-input
v-if="scope.row.isEdit"
v-model="scope.row.outPort"
maxlength="20"
placeholder="Required"
/>
<span v-else v-text="scope.row.outPort"></span>
</template>
</el-table-column>
<el-table-column prop="enabled" label="课件" align="center">
<template slot-scope="scope">
<el-input
v-if="scope.row.isEdit"
v-model="scope.row.inPort"
maxlength="20"
placeholder="Required"
/>
<span v-else v-text="scope.row.inPort"></span>
</template>
</el-table-column>
<el-table-column prop="enabled" label="随堂练习" align="center">
<template slot-scope="scope">
<el-input
v-if="scope.row.isEdit"
v-model="scope.row.inPort"
maxlength="20"
placeholder="Required"
/>
<span v-else v-text="scope.row.inPort"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
style="color: #2090c1"
@click="handleUpdate(scope.row)"
>查看
</el-button>
<el-button
size="mini"
type="text"
style="color: #2090c1"
@click="handleAdd(scope.row)"
>发布
</el-button>
<el-button
size="mini"
type="text"
style="color: #F56C6C"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
<div style="width: 100%">
<el-button style="margin-top: 12px;" @click="next">下一步</el-button>
</div> </div>
</div> </div>
<div v-else-if="active !== 1 "> <div v-if="activeName === 'third'">
<div style="width: 100%;display: flex"> <div style="width: 100%;">
<div style="float: right;width: 30%"> <div style="width: 60%;margin-left: 22%">
<el-row type="flex" align="top" :gutter="10" class="el-row"> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="10" class="text-right"> <el-col :span="4" class="text-right">
<span class="require-icon">*</span> <span class="text-title">直播时间</span>
<span class="text-title">新建章节</span> </el-col>
</el-col> <el-col :span="14" class="text-content">
</el-row> <el-input
<el-row type="flex" align="top" :gutter="10" class="el-row"> v-model="dataForm.name"
<el-col :span="4" class="text-right"> maxlength="25"
</el-col> :rows="1"
<el-col :span="14" class="text-content"> placeholder="最多输入25个字"
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree> show-word-limit
</el-col> >
</el-row> </el-input>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="text-title">直播服务商</span>
</el-col>
<el-col :span="14" class="text-content">
<el-select
style="width:100%"
clearable
v-model="dataForm.couresName"
placeholder="请选择"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
</el-row>
<el-row type="flex" align="middle" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="require-icon">*</span>
<span class="text-title">直播间号码</span>
</el-col>
<el-col :span="14" class="text-content">
<el-input
v-model="dataForm.name"
maxlength="25"
:rows="1"
placeholder="最多输入25个字"
show-word-limit
>
</el-input>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="text-title">直播间密码</span>
</el-col>
<el-col :span="14" class="text-content">
<el-input
v-model="dataForm.name"
maxlength="25"
:rows="1"
placeholder="最多输入25个字"
show-word-limit
>
</el-input>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="require-icon">*</span>
<span class="text-title">上传录播</span>
</el-col>
<el-col :span="14" class="text-content">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-col>
</el-row>
</div>
</div> </div>
<div style="width: 40%;float: left"> </div>
<el-row type="flex" align="top" :gutter="10" class="el-row"> <div v-if="activeName === 'fourth'">
<el-col :span="4" class="text-right"> <div style="width: 100%;">
<span class="text-title">标题</span> <div style="width: 60%;margin-left: 22%">
</el-col> <el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="14" class="text-content"> <el-col :span="4" class="text-right">
<el-input <span class="text-title">开课地点</span>
maxlength="25" </el-col>
:rows="1" <el-col :span="14" class="text-content">
placeholder="最多输入25个字" <el-input
show-word-limit v-model="dataForm.name"
> maxlength="25"
</el-input> :rows="1"
</el-col> placeholder="最多输入25个字"
</el-row> show-word-limit
<el-row type="flex" align="top" :gutter="10" class="el-row"> >
<el-col :span="4" class="text-right"> </el-input>
<span class="require-icon">*</span> </el-col>
<span class="text-title">简介</span> </el-row>
</el-col> <el-row type="flex" align="middle" :gutter="10" class="el-row">
<el-col :span="14" class="text-content"> <el-col :span="4" class="text-right">
<el-input <span class="require-icon">*</span>
type="textarea" <span class="text-title">开课时间</span>
maxlength="1000" </el-col>
:rows="10" <el-col :span="14" class="text-content">
placeholder="最多输入1000个字" <el-input
show-word-limit v-model="dataForm.name"
> maxlength="25"
</el-input> :rows="1"
</el-col> placeholder="最多输入25个字"
</el-row> show-word-limit
>
</el-input>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="text-title">直播间密码</span>
</el-col>
<el-col :span="14" class="text-content">
<el-input
v-model="dataForm.name"
maxlength="25"
:rows="1"
placeholder="最多输入25个字"
show-word-limit
>
</el-input>
</el-col>
</el-row>
<el-row type="flex" align="top" :gutter="10" class="el-row">
<el-col :span="4" class="text-right">
<span class="require-icon">*</span>
<span class="text-title">上传录播</span>
</el-col>
<el-col :span="14" class="text-content">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-col>
</el-row>
</div>
</div> </div>
<div style="float: right;width: 30%"> </div>
<el-row type="flex" align="top" :gutter="10" class="el-row"> <div v-if="activeName === 'fiveth'">
<el-col :span="4" class="text-right"> <div style="width: 40%;margin-left: 30%">
<span class="require-icon">*</span> <div style="display: flex;float: left;">
<span class="text-title">上传封面</span> <el-form :inline="true">
</el-col> <el-form-item>
<el-col :span="14" class="text-content"> <el-button type="primary"
<el-upload @click="addCourse()">导出
class="upload-demo" </el-button>
action="https://jsonplaceholder.typicode.com/posts/" </el-form-item>
:on-preview="handlePreview" </el-form>
:on-remove="handleRemove" </div>
:file-list="fileList" <div>
list-type="picture"> <el-table :data="dataList" border>
<el-button size="small" type="primary">点击上传</el-button> <el-table-column label="序号" fixed
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div> header-align="center" align="center" width="50">
</el-upload> <template slot-scope="scope">
</el-col> <span>
</el-row> {{ scope.$index + 1 }}
</span>
</template>
</el-table-column>
<el-table-column prop="name" label="学员姓名" fixed
header-align="center" align="center" width="160">
</el-table-column>
<el-table-column prop="type" label="学员手机号" fixed
header-align="center" align="center" width="150">
</el-table-column>
<el-table-column prop="intro" label="完成率" fixed
header-align="center" align="center" width="120">
</el-table-column>
<el-table-column prop="updateTime" label="最近一次学习时间" fixed
header-align="center" align="center" width="220">
</el-table-column>
</el-table>
</div> </div>
</div> </div>
<div style="width: 100%">
<el-button style="margin-top: 12px;" @click="finde">完成</el-button>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { getRequest } from '../../utils/api'
export default { export default {
data() { data() {
return { return {
activeName: 'first',
active: 1, active: 1,
typelist: [], subjectList: [],
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'}], typeList: [
data: [{ {
label: '一级 1', id: '1',
children: [{ name: '钉钉'
label: '二级 1-1', },
children: [{ {
label: '三级 1-1-1' id: '2',
}] name: '腾讯'
}] }
}, { ],
label: '一级 2', tableData: [
children: [{ {
label: '二级 2-1', name: '123',
children: [{ inIp: '2222',
label: '三级 2-1-1' inPort: '21',
}] outPort: '333',
}, { enabled: '555'
label: '二级 2-2', }
children: [{ ],
label: '三级 2-2-1' internalIpList: [],
}] fileList:[],
}] dataForm: {
}, { name: '',
label: '一级 3', teacherName: '',
children: [{ type: this.$route.query.couresName,
label: '二级 3-1', couresName: '',
children: [{ status: '',
label: '三级 3-1-1' time: '',
}] subjectIdList: [],
}, { teacherList: []
label: '二级 3-2', }
children: [{
label: '三级 3-2-1'
}]
}]
}],
}; };
}, },
created () {
this.getTypeList()
this.getTeacherList()
},
methods: { methods: {
//
getReverseShellList() {
getShellList().then(res => {
if (res.code === 200) {
if (res.data && res.data.length > 0) {
// isEditfalse
res.data.forEach(item => {
item['isEdit'] = false
})
}
this.tableData = res.data
//
this.tableData.unshift({
name: '',
inIp: '',
inPort: null,
outPort: null,
enabled: null,
isEdit: true
})
}
})
},
//
handleAdd(row) {
for (let key in row) {
//
if (row[key] === '' || row[key] === null || typeof row[key] === 'undefined') {
this.msgError('Please complete the information')
return
}
}
const params = {
name: row.name,
inIp: row.inIp,
inPort: parseInt(row.inPort),
outPort: parseInt(row.outPort),
enabled: row.enabled
}
},
// Apply
handleUpdate(row) {
// Apply
if (row.isEdit) {
for (let key in row) {
if (row[key] === '' || row[key] === null || typeof row[key] === 'undefined') {
this.msgError('Please complete the information')
return
}
}
const params = {
name: row.name,
inIp: row.inIp,
inPort: parseInt(row.inPort),
outPort: parseInt(row.outPort),
enabled: row.enabled
}
} else {
//
row.isEdit = true
}
},
//
handleDelete(row) {
//
if (row.isEdit) {
this.getReverseShellList()
} else {
//
this.$confirm('Are you sure to delete reverse shell?', 'warning', {
confirmButtonText: 'Sure',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
deleteShell(row.name).then(res => {
if (res.code === 200) {
this.msgSuccess('Delete reverse shell successfully')
this.getReverseShellList()
}
})
}).catch(() => {
})
}
},
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=> {
});
},
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=> {
});
},
handleClick(tab, event) {
console.log(tab, event);
},
next() { next() {
if (this.active++ > 1) this.active = 1; if (this.active++ > 1) this.active = 1;
}, },

43
src/page/coures/coures.vue

@ -106,7 +106,41 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="课程名称" fixed <el-table-column prop="name" label="课程名称" fixed
header-align="center" align="center" width="200"> header-align="center" align="left" width="200">
<template slot-scope="scope">
<div>
<span>
{{ scope.row.name}}
</span>
</div>
<div v-if="scope.row.type === '视频课'">
<span style="font-size: 8px;color: #909399">
10章节
</span>
</div>
<div v-if="scope.row.type === '直播课'">
<span style="font-size: 8px;color: #909399">
2022-10-16 20:20
</span>
</div>
<div v-if="scope.row.type === '现场课'">
<el-popover
placement="right"
width="400"
trigger="click">
<el-table :data="gridData">
<el-table-column width="150" property="date" label="日期"></el-table-column>
<el-table-column width="100" property="address" label="地址"></el-table-column>
<el-table-column width="100" property="name" label="备注"></el-table-column>
</el-table>
<el-button slot="reference" size="mini">
<span style="font-size: 8px;color: dodgerblue">
上课信息
</span>
</el-button>
</el-popover>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="类型" fixed <el-table-column prop="type" label="类型" fixed
header-align="center" align="center" width="150"> header-align="center" align="center" width="150">
@ -140,7 +174,7 @@
width="150"> width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="mini" <el-button type="text" size="mini"
@click="">查看 @click="updateCourse(scope.row)">查看
</el-button> </el-button>
<el-button type="text" size="mini" v-if="scope.row.status!=='DRAFT'" <el-button type="text" size="mini" v-if="scope.row.status!=='DRAFT'"
@click="">下架 @click="">下架
@ -303,16 +337,17 @@ export default {
addCourse(){ addCourse(){
// //
this.$router.push({ this.$router.push({
path: "/coures-info", path: "/add-coures",
query: { query: {
} }
}); });
}, },
updateCourse(id){ updateCourse(row){
// //
this.$router.push({ this.$router.push({
path: "/coures-info", path: "/coures-info",
query: { query: {
couresName: row.type
} }
}); });
}, },

15
src/router/index.js

@ -13,6 +13,7 @@ import subscribe from '@/page/coures/subscribe' //课程管理
import examination from '@/page/examination/examination' //新建习题 import examination from '@/page/examination/examination' //新建习题
import examinationInfo from '@/page/examination/examination-info' //新建考试 import examinationInfo from '@/page/examination/examination-info' //新建考试
import exercisesInfo from '@/page/exercises/exercises-info' //新建习题 import exercisesInfo from '@/page/exercises/exercises-info' //新建习题
import addCoures from '@/page/coures/add-coures' //新建习题
Vue.use(Router) Vue.use(Router)
@ -122,6 +123,20 @@ export default new Router({
} }
] ]
}, },
{
path: '/home',
component: Home,
name: '新增习题',
hidden: true,
children: [
{
path: '/add-coures',
iconCls: 'fa fa-user-o',
name: '新增习题',
component: addCoures
}
]
},
{ {
path: '/home', path: '/home',
component: Home, component: Home,

Loading…
Cancel
Save