16 changed files with 1410 additions and 434 deletions
@ -0,0 +1,73 @@ |
|||
import request from '@/utils/request' |
|||
const carousel = '/enterprise/carousel' |
|||
|
|||
export function queryCarousel(data) { |
|||
return request({ |
|||
url: `/gateway${carousel}/queryCarousel`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
jumpType: data.jumpType, |
|||
pageNum: data.pageNum, |
|||
pageSize: data.pageSize |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function updateCarousel(data) { |
|||
return request({ |
|||
url: `/gateway${carousel}/updateCarousel`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data.id, |
|||
jumpType: data.jumpType, |
|||
jumpUrl: data.jumpUrl, |
|||
param: data.param, |
|||
recStatus: data.recStatus, |
|||
url: data.url |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function activeAndStop(data) { |
|||
return request({ |
|||
url: `/gateway${carousel}/activeAndStop`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data.id, |
|||
recStatus: data.recStatus |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function deleteCarousel(data) { |
|||
return request({ |
|||
url: `/gateway${carousel}/deleteCarousel`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function addCarousel(data) { |
|||
return request({ |
|||
url: `/gateway${carousel}/addCarousel`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
jumpType: data.jumpType, |
|||
jumpUrl: data.jumpUrl, |
|||
param: data.param, |
|||
url: data.url |
|||
} |
|||
} |
|||
}) |
|||
} |
@ -0,0 +1,10 @@ |
|||
import request from '@/utils/request' |
|||
const image = '/enterprise/file' |
|||
|
|||
export function uploadImage(data) { |
|||
return request({ |
|||
url: `/gateway${image}/upload`, |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
@ -0,0 +1,89 @@ |
|||
import request from '@/utils/request' |
|||
const trainApply = '/enterprise/trainApply' |
|||
const trainInform = '/enterprise/trainInform' |
|||
|
|||
export function trainInformQuery(data) { |
|||
return request({ |
|||
url: `/gateway${trainInform}/trainInformQuery`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
endTime: data.endTime, |
|||
incubatorName: data.incubatorName, |
|||
pageNum: data.pageNum, |
|||
pageSize: data.pageSize, |
|||
startTime: data.startTime |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function incubatorQuery() { |
|||
return request({ |
|||
url: `/gateway${trainInform}/incubatorQuery`, |
|||
method: 'post' |
|||
}) |
|||
} |
|||
|
|||
export function trainInformUpdate(data) { |
|||
return request({ |
|||
url: `/gateway${trainInform}/trainInformUpdate`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data.id, |
|||
publishIncubatorId: data.incubator, |
|||
trainContent: data.trainContent, |
|||
trainPlace: data.trainPlace, |
|||
trainTeacher: data.trainTeacher, |
|||
trainTime: data.trainTime, |
|||
trainTitle: data.trainTitle, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function queryById(data) { |
|||
return request({ |
|||
url: `/gateway${trainApply}/queryById`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
trainInformId: data.id, |
|||
pageNum: data.pageNum, |
|||
pageSize: data.pageSize |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function trainInformDelete(data) { |
|||
return request({ |
|||
url: `/gateway${trainInform}/trainInformDelete`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function trainInformAdd(data) { |
|||
return request({ |
|||
url: `/gateway${trainInform}/trainInformAdd`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
publishIncubatorId: data.publishIncubatorId, |
|||
trainContent: data.trainContent, |
|||
trainPlace: data.trainPlace, |
|||
trainTeacher: data.trainTeacher, |
|||
trainTime: data.trainTime, |
|||
trainTitle: data.trainTitle, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
@ -1,72 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
const typemanage = '/enterprise/category' |
|||
|
|||
export function TypeManage(data) { |
|||
return request({ |
|||
url: `/gateway${typemanage}/queryCategory`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
name: data.name, |
|||
pageNum: data.pageNum, |
|||
pageSize: data.pageSize, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function addCategory(data) { |
|||
console.log(data) |
|||
return request({ |
|||
url: `/gateway${typemanage}/addCategory`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
name: data.name, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function CategoryDetail(data) { |
|||
return request({ |
|||
url: `/gateway${typemanage}/queryCategory`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
name: data.name, |
|||
pageNum: data.pageNum, |
|||
pageSize: data.pageSize, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function CategoryDelete(id) { |
|||
return request({ |
|||
url: `/gateway${typemanage}/deleteCategory`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: id |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function CategoryUpdate(data) { |
|||
return request({ |
|||
url: `/gateway${typemanage}/updateCategory`, |
|||
method: 'post', |
|||
data: { |
|||
param: { |
|||
id: data.id, |
|||
name: data.name, |
|||
type: data.type |
|||
} |
|||
} |
|||
}) |
|||
} |
@ -0,0 +1,20 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
企业需求管理界面 |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
|
@ -0,0 +1,20 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
企业信息管理界面 |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
|
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
|||
|
@ -0,0 +1,20 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
首页管理界面 |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
|
@ -0,0 +1,415 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- 头部搜索添加 --> |
|||
<div class="filter-container"> |
|||
<el-date-picker id="Time1" v-model="data.startTime" class="filter-item" type="date" placeholder="请选择开始时间" /> |
|||
~ |
|||
<el-date-picker id="Time2" v-model="data.endTime" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
|
|||
<el-select v-model="policyType1" placeholder="孵化器" clearable style="width: 190px;margin-left: 10px;" class="filter-item"> |
|||
<el-option v-for="(item,index) in incubator" :key="index" :value="item.incubator" /> |
|||
</el-select> |
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="Search"> |
|||
搜索 |
|||
</el-button> |
|||
|
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="CarouselAdd"> |
|||
添加 |
|||
</el-button> |
|||
|
|||
</div> |
|||
<!-- 培训通知列表 --> |
|||
<el-table v-loading="listLoading" :data="polictList" border fit highlight-current-row style="width: 100%;"> |
|||
<el-table-column label="ID" prop="id" align="center" width="80"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.id }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训标题" prop="trainTitle" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTitle }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="孵化器" prop="incubator" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.incubator }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训内容" prop="trainContent" align="center" width="300"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainContent }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训地点" prop="trainPlace" align="center" width="120"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainPlace }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训讲师" prop="trainTeacher" align="center" width="120"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTeacher }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训时间" prop="trainTime" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTime }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训类型" prop="type" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<el-tag v-if="row.type === 0" type="published">线上</el-tag> |
|||
<el-tag v-if="row.type === 1" style="background:#ccc;">线下</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width"> |
|||
<template slot-scope="{row}"> |
|||
<el-button type="primary" size="mini" @click="handleUpdate(row)"> |
|||
修改 |
|||
</el-button> |
|||
<el-button size="mini" type="success" @click="enroll(row.id)"> |
|||
报名列表 |
|||
</el-button> |
|||
<el-button size="mini" type="danger" @click="handleDelete(row.id)"> |
|||
删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 显示当前页数,且显示所有页数,可以跳转 --> |
|||
<pagination v-show="total>0" :total="total" :page.sync="data.pageNum" :limit.sync="data.pageSize" @pagination="getList" /> |
|||
<!-- 修改培训通知界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible"> |
|||
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="培训标题" prop="trainTitle" style="width: 180%"> |
|||
<el-input v-model="temp.trainTitle" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="孵化器" prop="incubator" style="width: 180%"> |
|||
<el-select v-model="temp.incubator" placeholder="孵化器" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in incubator" :key="index" :value="item.incubator" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训内容" prop="trainContent" style="width: 180%"> |
|||
<el-input v-model="temp.trainContent" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训地点" prop="trainPlace" style="width: 180%"> |
|||
<el-input v-model="temp.trainPlace" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训讲师" prop="trainTeacher" style="width: 180%"> |
|||
<el-input v-model="temp.trainTeacher" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训时间" prop="trainTime" style="width: 180%"> |
|||
<el-date-picker id="Time3" v-model="temp.trainTime" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训类型" prop="statusType" style="width: 180%"> |
|||
<el-select v-model="statusType" placeholder="类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="Commit"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!-- 报名列表界面 --> |
|||
<el-dialog title="报名列表" :visible.sync="dialogFormVisible2"> |
|||
<el-table v-loading="listLoading" :data="enrollList" border fit highlight-current-row style="width: 100%;"> |
|||
<el-table-column label="企业名称" prop="enterpriseName" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.enterpriseName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系人" prop="contacts" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.contacts }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系电话" prop="contactPhone" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.contactPhone }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="报名人数" prop="applyNum" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.applyNum }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="dialogFormVisible2=false"> |
|||
确定 |
|||
</el-button> |
|||
</div> |
|||
<pagination v-show="total1>0" :total="total1" :page.sync="data1.pageNum" :limit.sync="data1.pageSize" @pagination="getenroll" /> |
|||
</el-dialog> |
|||
<!-- 添加通知界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible1"> |
|||
<el-form ref="dataForm" :model="addCarousel" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="孵化器" prop="publishIncubatorName" style="width: 180%"> |
|||
<el-select v-model="addCarousel.publishIncubatorName" placeholder="培训类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="item in incubator" :key="item.id" :value="item.incubator" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训内容" prop="trainContent" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainContent" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训地点" prop="trainPlace" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainPlace" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训讲师" prop="trainTeacher" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainTeacher" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训时间" prop="trainTime" style="width: 180%"> |
|||
<el-date-picker id="Time4" v-model="addCarousel.trainTime1" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训标题" prop="trainTitle" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainTitle" /> |
|||
</el-form-item> |
|||
<el-form-item label="培训类型" prop="type" style="width: 180%"> |
|||
<el-select v-model="policyType2" placeholder="培训类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible1 = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="CommitAdd"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import * as api from '@/api/train' |
|||
import Pagination from '@/components/Pagination' |
|||
|
|||
export default { |
|||
name: 'Notice', |
|||
components: { Pagination }, |
|||
data() { |
|||
return { |
|||
list: null, |
|||
show111: false, |
|||
total: 0, |
|||
total1: 0, |
|||
listLoading: true, |
|||
data: { |
|||
endTime: '', |
|||
incubatorName: '', |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
startTime: '' |
|||
}, |
|||
polictList: [], |
|||
typeList: { '线上': 0, '线下': 1 }, |
|||
incubator: [], |
|||
policyType: undefined, |
|||
policyType1: undefined, |
|||
policyType2: undefined, |
|||
statusType: undefined, |
|||
textMap: { |
|||
update: 'Edit', |
|||
create: 'Create' |
|||
}, |
|||
dialogStatus: '', |
|||
dialogFormVisible: false, |
|||
dialogFormVisible1: false, |
|||
dialogFormVisible2: false, |
|||
temp: {}, |
|||
addCarousel: { |
|||
publishIncubatorName: '', |
|||
publishIncubatorId: '', |
|||
trainContent: '', |
|||
trainPlace: '', |
|||
trainTeacher: '', |
|||
trainTime: '', |
|||
trainTime1: '', |
|||
trainTitle: '', |
|||
type: '' |
|||
}, |
|||
enrollList: [], |
|||
data1: { |
|||
id: 0, |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
showid: 0 |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'name' |
|||
]) |
|||
}, |
|||
async created() { |
|||
const that = this |
|||
this.getList() |
|||
await api.incubatorQuery().then((res) => { |
|||
that.incubator = res |
|||
}) |
|||
}, |
|||
methods: { |
|||
async Search() { |
|||
const that = this |
|||
that.listLoading = true |
|||
var Time1 = document.getElementById('Time1').value |
|||
var Time2 = document.getElementById('Time2').value |
|||
var str = Time1.replace(/-/g, '/') |
|||
var str1 = Time2.replace(/-/g, '/') |
|||
that.data.startTime = str |
|||
that.data.endTime = str1 |
|||
|
|||
if (that.policyType1 !== undefined) { |
|||
that.data.incubatorName = that.policyType1 |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
return |
|||
} else { |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
return |
|||
} |
|||
}, |
|||
async getList() { |
|||
const that = this |
|||
that.listLoading = true |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
|
|||
setTimeout(() => { |
|||
that.listLoading = false |
|||
}, 1000) |
|||
}) |
|||
}, |
|||
handleUpdate(row) { |
|||
const that = this |
|||
that.temp = Object.assign({}, row) // copy obj |
|||
that.temp.timestamp = new Date(that.temp.timestamp) |
|||
that.dialogStatus = 'update' |
|||
if (that.temp.type === 0) { |
|||
that.statusType = '线上' |
|||
} else { |
|||
that.statusType = '线下' |
|||
} |
|||
that.dialogFormVisible = true |
|||
that.$nextTick(() => { |
|||
that.$refs['dataForm'].clearValidate() |
|||
}) |
|||
}, |
|||
async Commit() { |
|||
const that = this |
|||
var Time3 = document.getElementById('Time3').value |
|||
// var str2 = Time3.replace(/-/g, '/') |
|||
that.temp.trainTime = Time3 |
|||
for (var i = 0; i < that.incubator.length; i++) { |
|||
if (that.temp.incubator === that.incubator[i].incubator) { |
|||
that.temp.incubator = that.incubator[i].id |
|||
} |
|||
} |
|||
for (var key in that.typeList) { |
|||
if (that.statusType === key) { |
|||
that.temp.type = that.typeList[key] |
|||
} |
|||
} |
|||
await api.trainInformUpdate(that.temp).then((res) => { |
|||
this.getList() |
|||
that.dialogFormVisible = false |
|||
}) |
|||
}, |
|||
async enroll(id) { |
|||
const that = this |
|||
that.listLoading = true |
|||
that.dialogFormVisible2 = true |
|||
that.data1.id = id |
|||
that.showid = id |
|||
await api.queryById(that.data1).then((res) => { |
|||
console.log(res) |
|||
that.total1 = res.total - 0 |
|||
that.enrollList = res.list |
|||
that.listLoading = false |
|||
}) |
|||
}, |
|||
async getenroll() { |
|||
const that = this |
|||
that.listLoading = true |
|||
that.data1.id = that.showid |
|||
await api.queryById(that.data1).then((res) => { |
|||
that.total1 = res.total - 0 |
|||
that.enrollList = res.list |
|||
|
|||
setTimeout(() => { |
|||
that.listLoading = false |
|||
}, 500) |
|||
}) |
|||
}, |
|||
async handleDelete(id) { |
|||
await api.trainInformDelete(id).then((res) => { |
|||
this.getList() |
|||
}) |
|||
}, |
|||
CarouselAdd() { |
|||
const that = this |
|||
for (const key in that.addCarousel) { |
|||
that.addCarousel[key] = '' |
|||
} |
|||
that.dialogFormVisible1 = true |
|||
}, |
|||
async CommitAdd() { |
|||
const that = this |
|||
that.addCarousel.trainTime = document.getElementById('Time4').value |
|||
for (const key in that.typeList) { |
|||
if (key === that.policyType2) { |
|||
that.addCarousel.type = that.typeList[key] |
|||
} |
|||
} |
|||
for (var i = 0; i < that.incubator.length; i++) { |
|||
if (that.addCarousel.publishIncubatorName === that.incubator[i].incubator) { |
|||
that.addCarousel.publishIncubatorId = that.incubator[i].id |
|||
} |
|||
} |
|||
console.log(that.addCarousel) |
|||
for (const kkk in that.addCarousel) { |
|||
if (that.addCarousel[kkk] === '') { |
|||
alert(kkk + '不能为空') |
|||
return |
|||
} |
|||
} |
|||
await api.trainInformAdd(that.addCarousel).then((res) => { |
|||
that.dialogFormVisible1 = false |
|||
that.getList() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -1,30 +1,341 @@ |
|||
<template> |
|||
<div class="dashboard-container"> |
|||
轮播图管理页 |
|||
<div class="app-container"> |
|||
<!-- 头部搜索添加 --> |
|||
<div class="filter-container"> |
|||
<el-select v-model="policyType" placeholder="跳转类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="Search"> |
|||
搜索 |
|||
</el-button> |
|||
|
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="CarouselAdd"> |
|||
添加 |
|||
</el-button> |
|||
|
|||
</div> |
|||
<!-- 轮播图信息列表 --> |
|||
<el-table v-loading="listLoading" :data="polictList" border fit highlight-current-row style="width: 100%;"> |
|||
<el-table-column label="ID" prop="id" align="center" width="80"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.id }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="图片路径" prop="url" align="center" width="350"> |
|||
<template slot-scope="{row}"> |
|||
<!-- <span>{{ row.url }}</span> --> |
|||
<!-- <a :href="row.url" target="_blank">{{ row.url }}</a> --> |
|||
<img :src="row.url" style="height:200px;width:300px"> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="跳转路径" prop="jumpUrl" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.jumpUrl }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="图片参数" prop="param" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.param }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="跳转类型" prop="jumpType" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span v-if="row.jumpType === 0">不跳转</span> |
|||
<span v-if="row.jumpType === 1">H5</span> |
|||
<span v-if="row.jumpType === 2">发榜详情</span> |
|||
<span v-if="row.jumpType === 3">培训通知</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="创建时间" prop="createdAt" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.createdAt }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="状态" prop="recStatus" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<el-tag v-if="row.recStatus === 0" type="published">正常</el-tag> |
|||
<el-tag v-if="row.recStatus === 1" style="background:#FFBB77;">禁用</el-tag> |
|||
<el-tag v-if="row.recStatus === 2">已删除</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width"> |
|||
<template slot-scope="{row}"> |
|||
<el-button type="primary" size="mini" @click="handleUpdate(row)"> |
|||
修改 |
|||
</el-button> |
|||
<el-button v-if="row.recStatus === 0" size="mini" @click="handleModifyStatus(row,1)"> |
|||
禁用 |
|||
</el-button> |
|||
<el-button v-if="row.recStatus === 1" size="mini" type="success" @click="handleModifyStatus(row,0)"> |
|||
启用 |
|||
</el-button> |
|||
<el-button size="mini" type="danger" @click="handleDelete(row.id)"> |
|||
删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 显示当前页数,且显示所有页数,可以跳转 --> |
|||
<pagination v-show="total>0" :total="total" :page.sync="data.pageNum" :limit.sync="data.pageSize" @pagination="getList" /> |
|||
<!-- 修改轮播图界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible"> |
|||
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="图片" prop="url" style="width: 180%"> |
|||
<!-- <el-input v-model="temp.url" /> --> |
|||
<img :src="temp.url" style="height:100px;width:150px"> |
|||
<form id="uploadForm" enctype="multipart/form-data" style="float:right;"> |
|||
<div style="height:98px;width:148px;border:1px solid gray;line-height:98px;text-align:center;cursor:pointer" @click="replace"> |
|||
选择图片 |
|||
<input id="fileipt" type="file" name="files" style="display:none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" @input="change"> |
|||
</div> |
|||
</form> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="跳转路径" prop="titleUrl" style="width: 180%"> |
|||
<el-input v-model="temp.jumpType" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="图片参数" prop="param" style="width: 180%"> |
|||
<el-input v-model="temp.param" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="跳转类型" prop="jumpType" style="width: 180%"> |
|||
<el-select v-model="policyType1" placeholder="跳转类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="状态" prop="recStatus" style="width: 180%"> |
|||
<el-select v-model="statusType" placeholder="状态" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in statusList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="Commit"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!-- 添加轮播图界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible1"> |
|||
<el-form ref="dataForm" :model="addCarousel" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="图片" prop="url" style="width: 180%"> |
|||
<img :src="addCarousel.url" style="height:100px;width:150px"> |
|||
<form id="uploadForm1" enctype="multipart/form-data" style="float:right;"> |
|||
<div style="height:98px;width:148px;border:1px solid gray;line-height:98px;text-align:center;cursor:pointer" @click="replace1"> |
|||
选择图片 |
|||
<input id="fileipt1" type="file" name="files" style="display:none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" @input="change1"> |
|||
</div> |
|||
</form> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="跳转路径" prop="jumpUrl" style="width: 180%"> |
|||
<el-input v-model="addCarousel.jumpUrl" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="图片参数" prop="param" style="width: 180%"> |
|||
<el-input v-model="addCarousel.param" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="跳转类型" prop="jumpType" style="width: 180%"> |
|||
<el-select v-model="policyType2" placeholder="跳转类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible1 = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="CommitAdd"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import * as api from '@/api/carousel' |
|||
import Pagination from '@/components/Pagination' |
|||
import * as Api from '@/api/image' |
|||
|
|||
export default { |
|||
name: 'Rotation', |
|||
name: 'Policy', |
|||
components: { Pagination }, |
|||
data() { |
|||
return { |
|||
list: null, |
|||
show111: false, |
|||
total: 0, |
|||
listLoading: true, |
|||
data: { |
|||
jumpType: '', |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
polictList: [], |
|||
typeList: { '不跳转': 0, 'H5': 1, '发榜详情': 2, '培训通知': 3 }, |
|||
statusList: { '正常': 0, '禁用': 1, '已删除': 2 }, |
|||
policyType: undefined, |
|||
policyType1: undefined, |
|||
policyType2: undefined, |
|||
statusType: undefined, |
|||
textMap: { |
|||
update: 'Edit', |
|||
create: 'Create' |
|||
}, |
|||
dialogStatus: '', |
|||
dialogFormVisible: false, |
|||
dialogFormVisible1: false, |
|||
temp: {}, |
|||
addCarousel: { |
|||
jumpType: '', |
|||
jumpUrl: '', |
|||
param: '', |
|||
url: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'name' |
|||
]) |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
async Search() { |
|||
const that = this |
|||
that.listLoading = true |
|||
if (that.typeList[`${that.policyType}`] === undefined) { |
|||
that.data.jumpType = '' |
|||
await api.queryCarousel(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
} else { |
|||
that.data.jumpType = that.typeList[`${that.policyType}`] |
|||
await api.queryCarousel(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
}, |
|||
async getList() { |
|||
const that = this |
|||
that.listLoading = true |
|||
await api.queryCarousel(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
|
|||
<style lang="scss" scoped> |
|||
.dashboard { |
|||
&-container { |
|||
margin: 30px; |
|||
setTimeout(() => { |
|||
that.listLoading = false |
|||
}, 1000) |
|||
}) |
|||
}, |
|||
handleUpdate(row) { |
|||
const that = this |
|||
that.temp = Object.assign({}, row) // copy obj |
|||
that.temp.timestamp = new Date(that.temp.timestamp) |
|||
that.dialogStatus = 'update' |
|||
for (const key in that.typeList) { |
|||
if (that.typeList[key] === that.temp.jumpType) { |
|||
that.policyType1 = key |
|||
} |
|||
} |
|||
for (const key in that.statusList) { |
|||
if (that.statusList[key] === that.temp.recStatus) { |
|||
that.statusType = key |
|||
} |
|||
} |
|||
that.dialogFormVisible = true |
|||
that.$nextTick(() => { |
|||
that.$refs['dataForm'].clearValidate() |
|||
}) |
|||
}, |
|||
async Commit() { |
|||
const that = this |
|||
that.temp.jumpType = that.typeList[`${that.policyType1}`] |
|||
that.temp.recStatus = that.statusList[`${that.statusType}`] |
|||
await api.updateCarousel(that.temp).then((res) => { |
|||
this.getList() |
|||
that.dialogFormVisible = false |
|||
}) |
|||
}, |
|||
async handleModifyStatus(detail, num) { |
|||
this.listLoading = true |
|||
detail.recStatus = num |
|||
await api.activeAndStop(detail).then((res) => { |
|||
this.listLoading = false |
|||
}) |
|||
}, |
|||
async handleDelete(id) { |
|||
await api.deleteCarousel(id).then((res) => { |
|||
this.getList() |
|||
}) |
|||
}, |
|||
CarouselAdd() { |
|||
const that = this |
|||
for (const key in that.addCarousel) { |
|||
that.addCarousel[key] = '' |
|||
} |
|||
that.dialogFormVisible1 = true |
|||
}, |
|||
async CommitAdd() { |
|||
const that = this |
|||
if (that.addCarousel.url !== '') { |
|||
for (const key in that.typeList) { |
|||
if (key === that.policyType2) { |
|||
that.addCarousel.jumpType = that.typeList[key] |
|||
} |
|||
} |
|||
await api.addCarousel(that.addCarousel).then((res) => { |
|||
that.getList() |
|||
that.dialogFormVisible1 = false |
|||
}) |
|||
} else { |
|||
alert('图片路径不得为空') |
|||
} |
|||
}, |
|||
replace() { |
|||
var ipt = document.getElementById('fileipt') |
|||
ipt.click() |
|||
}, |
|||
async change() { |
|||
const that = this |
|||
var uploadForm = document.getElementById('uploadForm') |
|||
var formData = new FormData(uploadForm) |
|||
await Api.uploadImage(formData).then((res) => { |
|||
// console.log(res) |
|||
that.temp.url = res[0].visitUrl |
|||
}) |
|||
}, |
|||
replace1() { |
|||
var ipt = document.getElementById('fileipt1') |
|||
ipt.click() |
|||
}, |
|||
async change1() { |
|||
const that = this |
|||
var uploadForm = document.getElementById('uploadForm1') |
|||
var formData = new FormData(uploadForm) |
|||
await Api.uploadImage(formData).then((res) => { |
|||
// console.log(res) |
|||
that.addCarousel.url = res[0].visitUrl |
|||
}) |
|||
} |
|||
&-text { |
|||
font-size: 30px; |
|||
line-height: 46px; |
|||
} |
|||
} |
|||
</style> |
|||
</script> |
|||
|
@ -1,30 +1,415 @@ |
|||
<template> |
|||
<div class="dashboard-container"> |
|||
培训通知管理页 |
|||
<div class="app-container"> |
|||
<!-- 头部搜索添加 --> |
|||
<div class="filter-container"> |
|||
<el-date-picker id="Time1" v-model="data.startTime" class="filter-item" type="date" placeholder="请选择开始时间" /> |
|||
~ |
|||
<el-date-picker id="Time2" v-model="data.endTime" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
|
|||
<el-select v-model="policyType1" placeholder="孵化器" clearable style="width: 190px;margin-left: 10px;" class="filter-item"> |
|||
<el-option v-for="(item,index) in incubator" :key="index" :value="item.incubator" /> |
|||
</el-select> |
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="Search"> |
|||
搜索 |
|||
</el-button> |
|||
|
|||
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="CarouselAdd"> |
|||
添加 |
|||
</el-button> |
|||
|
|||
</div> |
|||
<!-- 培训通知列表 --> |
|||
<el-table v-loading="listLoading" :data="polictList" border fit highlight-current-row style="width: 100%;"> |
|||
<el-table-column label="ID" prop="id" align="center" width="80"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.id }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训标题" prop="trainTitle" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTitle }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="孵化器" prop="incubator" align="center" width="180"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.incubator }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训内容" prop="trainContent" align="center" width="300"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainContent }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训地点" prop="trainPlace" align="center" width="120"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainPlace }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训讲师" prop="trainTeacher" align="center" width="120"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTeacher }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训时间" prop="trainTime" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.trainTime }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="培训类型" prop="type" align="center" width="160"> |
|||
<template slot-scope="{row}"> |
|||
<el-tag v-if="row.type === 0" type="published">线上</el-tag> |
|||
<el-tag v-if="row.type === 1" style="background:#ccc;">线下</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width"> |
|||
<template slot-scope="{row}"> |
|||
<el-button type="primary" size="mini" @click="handleUpdate(row)"> |
|||
修改 |
|||
</el-button> |
|||
<el-button size="mini" type="success" @click="enroll(row.id)"> |
|||
报名列表 |
|||
</el-button> |
|||
<el-button size="mini" type="danger" @click="handleDelete(row.id)"> |
|||
删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 显示当前页数,且显示所有页数,可以跳转 --> |
|||
<pagination v-show="total>0" :total="total" :page.sync="data.pageNum" :limit.sync="data.pageSize" @pagination="getList" /> |
|||
<!-- 修改培训通知界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible"> |
|||
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="培训标题" prop="trainTitle" style="width: 180%"> |
|||
<el-input v-model="temp.trainTitle" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="孵化器" prop="incubator" style="width: 180%"> |
|||
<el-select v-model="temp.incubator" placeholder="孵化器" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in incubator" :key="index" :value="item.incubator" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训内容" prop="trainContent" style="width: 180%"> |
|||
<el-input v-model="temp.trainContent" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训地点" prop="trainPlace" style="width: 180%"> |
|||
<el-input v-model="temp.trainPlace" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训讲师" prop="trainTeacher" style="width: 180%"> |
|||
<el-input v-model="temp.trainTeacher" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训时间" prop="trainTime" style="width: 180%"> |
|||
<el-date-picker id="Time3" v-model="temp.trainTime" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训类型" prop="statusType" style="width: 180%"> |
|||
<el-select v-model="statusType" placeholder="类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="Commit"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!-- 报名列表界面 --> |
|||
<el-dialog title="报名列表" :visible.sync="dialogFormVisible2"> |
|||
<el-table v-loading="listLoading" :data="enrollList" border fit highlight-current-row style="width: 100%;"> |
|||
<el-table-column label="企业名称" prop="enterpriseName" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.enterpriseName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系人" prop="contacts" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.contacts }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系电话" prop="contactPhone" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.contactPhone }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="报名人数" prop="applyNum" align="center"> |
|||
<template slot-scope="{row}"> |
|||
<span>{{ row.applyNum }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="dialogFormVisible2=false"> |
|||
确定 |
|||
</el-button> |
|||
</div> |
|||
<pagination v-show="total1>0" :total="total1" :page.sync="data1.pageNum" :limit.sync="data1.pageSize" @pagination="getenroll" /> |
|||
</el-dialog> |
|||
<!-- 添加通知界面 --> |
|||
<el-dialog title="修改" :visible.sync="dialogFormVisible1"> |
|||
<el-form ref="dataForm" :model="addCarousel" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|||
|
|||
<el-form-item label="孵化器" prop="publishIncubatorName" style="width: 180%"> |
|||
<el-select v-model="addCarousel.publishIncubatorName" placeholder="培训类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="item in incubator" :key="item.id" :value="item.incubator" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训内容" prop="trainContent" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainContent" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训地点" prop="trainPlace" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainPlace" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训讲师" prop="trainTeacher" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainTeacher" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训时间" prop="trainTime" style="width: 180%"> |
|||
<el-date-picker id="Time4" v-model="addCarousel.trainTime1" class="filter-item" type="date" placeholder="请选择结束时间" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="培训标题" prop="trainTitle" style="width: 180%"> |
|||
<el-input v-model="addCarousel.trainTitle" /> |
|||
</el-form-item> |
|||
<el-form-item label="培训类型" prop="type" style="width: 180%"> |
|||
<el-select v-model="policyType2" placeholder="培训类型" clearable style="width: 190px" class="filter-item"> |
|||
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogFormVisible1 = false"> |
|||
取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="CommitAdd"> |
|||
提交 |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import * as api from '@/api/train' |
|||
import Pagination from '@/components/Pagination' |
|||
|
|||
export default { |
|||
name: 'Train', |
|||
name: 'Policy', |
|||
components: { Pagination }, |
|||
data() { |
|||
return { |
|||
list: null, |
|||
show111: false, |
|||
total: 0, |
|||
total1: 0, |
|||
listLoading: true, |
|||
data: { |
|||
endTime: '', |
|||
incubatorName: '', |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
startTime: '' |
|||
}, |
|||
polictList: [], |
|||
typeList: { '线上': 0, '线下': 1 }, |
|||
incubator: [], |
|||
policyType: undefined, |
|||
policyType1: undefined, |
|||
policyType2: undefined, |
|||
statusType: undefined, |
|||
textMap: { |
|||
update: 'Edit', |
|||
create: 'Create' |
|||
}, |
|||
dialogStatus: '', |
|||
dialogFormVisible: false, |
|||
dialogFormVisible1: false, |
|||
dialogFormVisible2: false, |
|||
temp: {}, |
|||
addCarousel: { |
|||
publishIncubatorName: '', |
|||
publishIncubatorId: '', |
|||
trainContent: '', |
|||
trainPlace: '', |
|||
trainTeacher: '', |
|||
trainTime: '', |
|||
trainTime1: '', |
|||
trainTitle: '', |
|||
type: '' |
|||
}, |
|||
enrollList: [], |
|||
data1: { |
|||
id: 0, |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
showid: 0 |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'name' |
|||
]) |
|||
}, |
|||
async created() { |
|||
const that = this |
|||
this.getList() |
|||
await api.incubatorQuery().then((res) => { |
|||
that.incubator = res |
|||
}) |
|||
}, |
|||
methods: { |
|||
async Search() { |
|||
const that = this |
|||
that.listLoading = true |
|||
var Time1 = document.getElementById('Time1').value |
|||
var Time2 = document.getElementById('Time2').value |
|||
var str = Time1.replace(/-/g, '/') |
|||
var str1 = Time2.replace(/-/g, '/') |
|||
that.data.startTime = str |
|||
that.data.endTime = str1 |
|||
|
|||
if (that.policyType1 !== undefined) { |
|||
that.data.incubatorName = that.policyType1 |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
return |
|||
} else { |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
that.listLoading = false |
|||
}) |
|||
return |
|||
} |
|||
} |
|||
</script> |
|||
}, |
|||
async getList() { |
|||
const that = this |
|||
that.listLoading = true |
|||
await api.trainInformQuery(that.data).then((res) => { |
|||
that.polictList = res.list |
|||
that.total = res.total - 0 |
|||
|
|||
setTimeout(() => { |
|||
that.listLoading = false |
|||
}, 1000) |
|||
}) |
|||
}, |
|||
handleUpdate(row) { |
|||
const that = this |
|||
that.temp = Object.assign({}, row) // copy obj |
|||
that.temp.timestamp = new Date(that.temp.timestamp) |
|||
that.dialogStatus = 'update' |
|||
if (that.temp.type === 0) { |
|||
that.statusType = '线上' |
|||
} else { |
|||
that.statusType = '线下' |
|||
} |
|||
that.dialogFormVisible = true |
|||
that.$nextTick(() => { |
|||
that.$refs['dataForm'].clearValidate() |
|||
}) |
|||
}, |
|||
async Commit() { |
|||
const that = this |
|||
var Time3 = document.getElementById('Time3').value |
|||
// var str2 = Time3.replace(/-/g, '/') |
|||
that.temp.trainTime = Time3 |
|||
for (var i = 0; i < that.incubator.length; i++) { |
|||
if (that.temp.incubator === that.incubator[i].incubator) { |
|||
that.temp.incubator = that.incubator[i].id |
|||
} |
|||
} |
|||
for (var key in that.typeList) { |
|||
if (that.statusType === key) { |
|||
that.temp.type = that.typeList[key] |
|||
} |
|||
} |
|||
await api.trainInformUpdate(that.temp).then((res) => { |
|||
this.getList() |
|||
that.dialogFormVisible = false |
|||
}) |
|||
}, |
|||
async enroll(id) { |
|||
const that = this |
|||
that.listLoading = true |
|||
that.dialogFormVisible2 = true |
|||
that.data1.id = id |
|||
that.showid = id |
|||
await api.queryById(that.data1).then((res) => { |
|||
console.log(res) |
|||
that.total1 = res.total - 0 |
|||
that.enrollList = res.list |
|||
that.listLoading = false |
|||
}) |
|||
}, |
|||
async getenroll() { |
|||
const that = this |
|||
that.listLoading = true |
|||
that.data1.id = that.showid |
|||
await api.queryById(that.data1).then((res) => { |
|||
that.total1 = res.total - 0 |
|||
that.enrollList = res.list |
|||
|
|||
<style lang="scss" scoped> |
|||
.dashboard { |
|||
&-container { |
|||
margin: 30px; |
|||
setTimeout(() => { |
|||
that.listLoading = false |
|||
}, 500) |
|||
}) |
|||
}, |
|||
async handleDelete(id) { |
|||
await api.trainInformDelete(id).then((res) => { |
|||
this.getList() |
|||
}) |
|||
}, |
|||
CarouselAdd() { |
|||
const that = this |
|||
for (const key in that.addCarousel) { |
|||
that.addCarousel[key] = '' |
|||
} |
|||
that.dialogFormVisible1 = true |
|||
}, |
|||
async CommitAdd() { |
|||
const that = this |
|||
that.addCarousel.trainTime = document.getElementById('Time4').value |
|||
for (const key in that.typeList) { |
|||
if (key === that.policyType2) { |
|||
that.addCarousel.type = that.typeList[key] |
|||
} |
|||
} |
|||
for (var i = 0; i < that.incubator.length; i++) { |
|||
if (that.addCarousel.publishIncubatorName === that.incubator[i].incubator) { |
|||
that.addCarousel.publishIncubatorId = that.incubator[i].id |
|||
} |
|||
} |
|||
console.log(that.addCarousel) |
|||
for (const kkk in that.addCarousel) { |
|||
if (that.addCarousel[kkk] === '') { |
|||
alert(kkk + '不能为空') |
|||
return |
|||
} |
|||
} |
|||
await api.trainInformAdd(that.addCarousel).then((res) => { |
|||
that.dialogFormVisible1 = false |
|||
that.getList() |
|||
}) |
|||
} |
|||
&-text { |
|||
font-size: 30px; |
|||
line-height: 46px; |
|||
} |
|||
} |
|||
</style> |
|||
</script> |
|||
|
@ -1,85 +0,0 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form ref="form" :model="form" label-width="120px"> |
|||
<el-form-item label="Activity name"> |
|||
<el-input v-model="form.name" /> |
|||
</el-form-item> |
|||
<el-form-item label="Activity zone"> |
|||
<el-select v-model="form.region" placeholder="please select your zone"> |
|||
<el-option label="Zone one" value="shanghai" /> |
|||
<el-option label="Zone two" value="beijing" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="Activity time"> |
|||
<el-col :span="11"> |
|||
<el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;" /> |
|||
</el-col> |
|||
<el-col :span="2" class="line">-</el-col> |
|||
<el-col :span="11"> |
|||
<el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;" /> |
|||
</el-col> |
|||
</el-form-item> |
|||
<el-form-item label="Instant delivery"> |
|||
<el-switch v-model="form.delivery" /> |
|||
</el-form-item> |
|||
<el-form-item label="Activity type"> |
|||
<el-checkbox-group v-model="form.type"> |
|||
<el-checkbox label="Online activities" name="type" /> |
|||
<el-checkbox label="Promotion activities" name="type" /> |
|||
<el-checkbox label="Offline activities" name="type" /> |
|||
<el-checkbox label="Simple brand exposure" name="type" /> |
|||
</el-checkbox-group> |
|||
</el-form-item> |
|||
<el-form-item label="Resources"> |
|||
<el-radio-group v-model="form.resource"> |
|||
<el-radio label="Sponsor" /> |
|||
<el-radio label="Venue" /> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="Activity form"> |
|||
<el-input v-model="form.desc" type="textarea" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="onSubmit">Create</el-button> |
|||
<el-button @click="onCancel">Cancel</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
form: { |
|||
name: '', |
|||
region: '', |
|||
date1: '', |
|||
date2: '', |
|||
delivery: false, |
|||
type: [], |
|||
resource: '', |
|||
desc: '' |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
onSubmit() { |
|||
this.$message('submit!') |
|||
}, |
|||
onCancel() { |
|||
this.$message({ |
|||
message: 'cancel!', |
|||
type: 'warning' |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.line{ |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue