Browse Source

9/22

master
aBin 5 years ago
parent
commit
472e8aa037
  1. 73
      src/api/carousel.js
  2. 10
      src/api/image.js
  3. 89
      src/api/train.js
  4. 72
      src/api/typemanage.js
  5. 2
      src/components/Breadcrumb/index.vue
  6. 27
      src/router/index.js
  7. 20
      src/views/enterprise/demand.vue
  8. 20
      src/views/enterprise/enterprise.vue
  9. 6
      src/views/enterprise/index.vue
  10. 20
      src/views/firstPages/index.vue
  11. 415
      src/views/firstPages/notice.vue
  12. 9
      src/views/firstPages/policy.vue
  13. 341
      src/views/firstPages/rotation.vue
  14. 415
      src/views/firstPages/train.vue
  15. 240
      src/views/firstPages/typemanage.vue
  16. 85
      src/views/form/index.vue

73
src/api/carousel.js

@ -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
}
}
})
}

10
src/api/image.js

@ -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
})
}

89
src/api/train.js

@ -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
}
}
})
}

72
src/api/typemanage.js

@ -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
}
}
})
}

2
src/components/Breadcrumb/index.vue

@ -37,7 +37,7 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
matched = [{ path: '/dashboard', meta: { title: '云服务平台管理系统' }}].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

27
src/router/index.js

@ -60,7 +60,7 @@ export const constantRoutes = [
component: Layout,
redirect: '/example/table',
name: 'Example',
meta: { title: '首页管理', icon: 'el-icon-s-help' },
meta: { title: '首页管理', icon: 'nested' },
children: [{
path: 'policy',
name: 'Policy',
@ -79,6 +79,12 @@ export const constantRoutes = [
component: () => import('@/views/firstPages/train'),
meta: { title: '培训管理', icon: '' }
},
{
path: 'Notice',
name: 'Notice',
component: () => import('@/views/firstPages/notice'),
meta: { title: '发榜管理', icon: '' }
},
{
path: 'typemanage',
name: 'Typemanage',
@ -88,14 +94,23 @@ export const constantRoutes = [
},
{
path: '/form',
path: '/enterprise',
component: Layout,
redirect: '/example/table',
name: 'Example',
meta: { title: '企业管理', icon: 'nested' },
children: [
{
path: 'index',
name: 'Form',
component: () => import('@/views/form/index'),
meta: { title: 'Form', icon: 'form' }
path: 'enterprise',
name: 'enterprise',
component: () => import('@/views/enterprise/enterprise'),
meta: { title: '企业信息管理', icon: '' }
},
{
path: 'Rotation',
name: 'Rotation',
component: () => import('@/views/enterprise/demand'),
meta: { title: '企业需求管理', icon: '' }
}
]
},

20
src/views/enterprise/demand.vue

@ -0,0 +1,20 @@
<template>
<div class="app-container">
企业需求管理界面
</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>
<style scoped>
</style>

20
src/views/enterprise/enterprise.vue

@ -0,0 +1,20 @@
<template>
<div class="app-container">
企业信息管理界面
</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>
<style scoped>
</style>

6
src/views/enterprise/index.vue

@ -0,0 +1,6 @@
<template>
<div class="app-container">
<router-view />
</div>
</template>

20
src/views/firstPages/index.vue

@ -0,0 +1,20 @@
<template>
<div class="app-container">
首页管理界面
</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>
<style scoped>
</style>

415
src/views/firstPages/notice.vue

@ -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>

9
src/views/firstPages/policy.vue

@ -339,16 +339,15 @@ export default {
that.addPolicy.content = Content.innerHTML
var str = Time.replace(/-/g, '/')
that.addPolicy.publishTime = str
for (const key in that.addPolicy) {
if (that.addPolicy[key] === '') {
alert(key + '不能为空')
} else {
api.PolicyAdd(that.addPolicy).then((res) => {
that.dialogFormVisible1 = false
})
return
}
}
api.PolicyAdd(that.addPolicy).then((res) => {
that.dialogFormVisible1 = false
})
}
}
}

341
src/views/firstPages/rotation.vue

@ -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'
])
}
}
</script>
},
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
})
}
},
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;
}
&-text {
font-size: 30px;
line-height: 46px;
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
})
}
}
}
</style>
</script>

415
src/views/firstPages/train.vue

@ -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'
])
}
}
</script>
},
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
<style lang="scss" scoped>
.dashboard {
&-container {
margin: 30px;
}
&-text {
font-size: 30px;
line-height: 46px;
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()
})
}
}
}
</style>
</script>

240
src/views/firstPages/typemanage.vue

@ -1,248 +1,18 @@
<template>
<div class="dashboard-container">
<!-- 类型管理页 -->
<!-- 头部搜索添加 -->
<div class="filter-container">
<el-input
v-model="searchCategory.name"
placeholder="名字"
class="filter-item"
style="width: 190px;margin-left:10px"
clearable
/>
<el-select
v-model="searchCategory.type"
placeholder="类型"
clearable
class="filter-item"
style="width: 190px;margin-left:10px"
value="1"
>
<el-option label="项目类别" value="0" />
<el-option label="产业类别 " value="1" />
</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="AddCategory"
>添加</el-button>
</div>
<!-- 类型列表 -->
<el-table
v-loading="listLoading"
:data="typemanage"
border
fit
highlight-current-row
style="width: 100%;"
>
<el-table-column label="名字" prop="id" align="center" width="500">
<template slot-scope="{row}">
<span>{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column label="产业类型" prop="title" align="center" width="500">
<template slot-scope="{row}">
<span>{{ row.type }}</span>
</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="danger" @click="handleDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 修改界面 -->
<el-dialog title="修改" :visible.sync="dialogFormVisible1">
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
<el-form-item label="名字" prop="name" style="width: 180%">
<el-input v-model="temp.name" />
</el-form-item>
<el-form-item label="类型">
<el-select
v-model="temp.type"
placeholder="请选类型"
style="width: 400px;"
>
<el-option label="项目类别" value="0" />
<el-option label="产业类别 " value="1" />
</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="Commitupdate(temp.id)">
提交
</el-button>
</div>
</el-dialog>
<!-- 添加表格 -->
<el-dialog title="添加表格" :visible.sync="dialogFormVisible">
<el-form
ref="dataForm"
:model="addCategory"
label-position="left"
label-width="70px"
style="width: 400px; margin-left:50px;"
>
<el-form-item label="名字" prop="name" style="width: 100%">
<el-input v-model="addCategory.name" clearable />
</el-form-item>
<el-form-item label="类型">
<el-select
v-model="addCategory.type"
placeholder="请选类型"
style="width: 400px;"
>
<el-option label="项目类别" value="0" />
<el-option label="产业类别 " value="1" />
</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="CommitAdd"> </el-button>
</div>
</el-dialog>
<pagination v-show="total>0" :total="total" :page.sync="data.pageNum" :limit.sync="data.pageSize" @pagination="getList" />
类型管理页
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as api from '@/api/typemanage'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
export default {
name: 'Typemanage',
components: { Pagination },
data() {
return {
dialogFormVisible: false,
dialogFormVisible1: false,
form: {
name: '',
region: ''
},
total: 0,
typemanage: [],
data: {
name: '',
pageNum: 1,
pageSize: 20,
type: ''
},
temp: {},
addCategory: {
name: '',
type: ''
},
updateCategory: {
name: '',
type: ''
},
searchCategory: {
name: '',
type: ''
},
formLabelWidth: '120px',
policyStatus: '类型',
status: { 类型一: 0, 类型二: 1 }
}
},
computed: {
...mapGetters(['name'])
},
created() {
this.getList()
},
methods: {
async getList() {
const that = this
that.listLoading = false
await api.TypeManage(that.data).then((res) => {
that.typemanage = res.list
that.total = res.total - 0
setTimeout(() => {
that.listLoading = false
}, 1000)
})
},
async Search() {
const that = this
await api.CategoryDetail(that.searchCategory).then((res) => {
that.typemanage = res.list
that.total = res.total - 0
that.listLoading = false
})
},
handleUpdate(row) {
const that = this
that.temp = Object.assign({}, row)
that.dialogFormVisible1 = true
},
async handleDelete(id) {
const that = this
await api.CategoryDelete(id).then((res) => {
that.getList()
})
},
AddCategory() {
const that = this
for (const key in that.addCategory) {
that.addCategory[key] = ''
}
that.dialogFormVisible = true
},
async CommitAdd() {
const that = this
for (const key in that.addCategory) {
if (that.addCategory[key] === '') {
alert(key + '不能为空')
return
}
}
await api.addCategory(that.addCategory).then((res) => {
that.dialogFormVisible = false
that.getList()
})
},
async Commitupdate() {
const that = this
for (const key in that.temp) {
if (that.temp[key] === '') {
alert(key + '不能为空')
return
}
}
await api.CategoryUpdate(that.temp).then((res) => {
that.dialogFormVisible1 = false
that.getList()
})
}
...mapGetters([
'name'
])
}
}
</script>

85
src/views/form/index.vue

@ -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…
Cancel
Save