Browse Source

上传代码

master
杨豪 3 years ago
parent
commit
b06d192670
  1. 3
      .env.development
  2. 2
      .env.production
  3. 4
      .eslintignore
  4. BIN
      dist.rar
  5. 27
      src/api/CourseLevel.js
  6. 27
      src/api/MemberFeedback.js
  7. 22
      src/api/cyCourse.js
  8. 18
      src/api/setConfig.js
  9. BIN
      src/assets/images/bg.jpg
  10. BIN
      src/assets/images/bg.png
  11. 5
      src/components/Crud/crud.js
  12. 4
      src/layout/components/AppMain.vue
  13. 16
      src/layout/components/Navbar.vue
  14. 10
      src/layout/components/Sidebar/Logo.vue
  15. 3
      src/main.js
  16. 110
      src/views/article/feedBack.vue
  17. 6
      src/views/article/index.vue
  18. 30
      src/views/course/addStudy.vue
  19. 127
      src/views/course/courseLevel.vue
  20. 305
      src/views/course/courseManage.vue
  21. 221
      src/views/course/index.vue
  22. 8
      src/views/course/studyList.vue
  23. 2
      src/views/login.vue
  24. 8
      src/views/shop/goods/form.vue
  25. 2
      src/views/shop/order/index.vue
  26. 11
      src/views/shop/user/master.vue
  27. 123
      src/views/system/configManage/index.vue
  28. 9
      src/views/wechat/article/form.vue

3
.env.development

@ -1,9 +1,8 @@
ENV = 'development' ENV = 'development'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'http://192.168.0.109:8091' VUE_APP_BASE_API = 'http://192.168.0.114:8091'
VUE_APP_WS_API = 'ws://localhost:8088' VUE_APP_WS_API = 'ws://localhost:8088'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

2
.env.production

@ -1,6 +1,6 @@
ENV = 'production' ENV = 'production'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'https://' VUE_APP_BASE_API = 'http://www.cyjyyjy.com:8091'
VUE_APP_WS_API = 'ws:///127.0.0.1:8001' VUE_APP_WS_API = 'ws:///127.0.0.1:8001'

4
.eslintignore

@ -1,8 +1,6 @@
build/*.js build/*.js
src/assets src
public public
dist dist
src/views
src/components

BIN
dist.rar

Binary file not shown.

27
src/api/CourseLevel.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/CourseLevel',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/CourseLevel/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/CourseLevel',
method: 'put',
data
})
}
export default { add, edit, del }

27
src/api/MemberFeedback.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/MemberFeedback',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/MemberFeedback/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/MemberFeedback',
method: 'put',
data
})
}
export default { add, edit, del }

22
src/api/cyCourse.js

@ -24,4 +24,24 @@ export function edit(data) {
}) })
} }
export default { add, edit, del } export function courseSeat(data) {
return request({
url: 'api/CourseSeat/addCourseSeats',
method: 'post',
data
})
}
export function getCourseManage(data) {
return request({
url: 'api/cyCourse?isModel=' + data,
method: 'GET'
})
}
export function getCourseLevel(data) {
return request({
url: 'api/CourseLevel',
method: 'GET'
})
}
export default { add, edit, del, courseSeat, getCourseManage, getCourseLevel }

18
src/api/setConfig.js

@ -0,0 +1,18 @@
import request from '@/utils/request'
// 配置管理
export function setConfig(data) {
return request({
url: '/api/config/editConfigs',
data,
method: 'post'
})
}
export function getConfigs(data) {
return request({
url: '/api/config/getConfigs',
data,
method: 'post'
})
}

BIN
src/assets/images/bg.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 KiB

BIN
src/assets/images/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

5
src/components/Crud/crud.js

@ -29,6 +29,8 @@ function CRUD(options) {
defaultForm: () => {}, defaultForm: () => {},
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc'] // 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
sort: ['id,desc'], sort: ['id,desc'],
//是否为模板
isModel:null,
// 等待时间 // 等待时间
time: 50, time: 50,
// CRUD Method // CRUD Method
@ -159,6 +161,7 @@ function CRUD(options) {
*/ */
toEdit(data) { toEdit(data) {
crud.resetForm(JSON.parse(JSON.stringify(data))) crud.resetForm(JSON.parse(JSON.stringify(data)))
console.log()
if (!(callVmHook(crud, CRUD.HOOK.beforeToEdit, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) { if (!(callVmHook(crud, CRUD.HOOK.beforeToEdit, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) {
return return
} }
@ -329,6 +332,7 @@ function CRUD(options) {
page: crud.page.page - 1, page: crud.page.page - 1,
size: crud.page.size, size: crud.page.size,
sort: crud.sort, sort: crud.sort,
isModel:crud.isModel,
...crud.query, ...crud.query,
...crud.params ...crud.params
} }
@ -388,6 +392,7 @@ function CRUD(options) {
Vue.set(crudFrom, key, form[key]) Vue.set(crudFrom, key, form[key])
} }
} }
console.log(crudFrom)
}, },
/** /**
* 重置数据状态 * 重置数据状态

4
src/layout/components/AppMain.vue

@ -5,11 +5,11 @@
<router-view :key="key" /> <router-view :key="key" />
</keep-alive> </keep-alive>
</transition> </transition>
<div v-if="$store.state.settings.showFooter" id="el-main-footer"> <!-- <div v-if="$store.state.settings.showFooter" id="el-main-footer">
<span v-html="$store.state.settings.footerTxt" /> <span v-html="$store.state.settings.footerTxt" />
<span> </span> <span> </span>
<a href="http://www.beian.miit.gov.cn" target="_blank">{{ $store.state.settings.caseNumber }}</a> <a href="http://www.beian.miit.gov.cn" target="_blank">{{ $store.state.settings.caseNumber }}</a>
</div> </div> -->
</section> </section>
</template> </template>

16
src/layout/components/Navbar.vue

@ -6,25 +6,26 @@
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" /> <!-- <search id="header-search" class="right-menu-item" /> -->
<el-tooltip content="源码地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
<Github class="right-menu-item hover-effect" /> <Github class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip> -->
<el-tooltip content="全屏缩放" effect="dark" placement="bottom"> <el-tooltip content="全屏缩放" effect="dark" placement="bottom">
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
<el-tooltip content="布局设置" effect="dark" placement="bottom"> <!-- <el-tooltip content="布局设置" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip> -->
</template> </template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="user.avatar ? baseApi + '/avatar/' + user.avatar : Avatar" class="user-avatar"> <!-- <img :src="user.avatar ? baseApi + '/avatar/' + user.avatar : Avatar" class="user-avatar"> -->
<span>{{ user.username }}</span>
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -93,6 +94,9 @@ export default {
} }
} }
}, },
mounted() {
console.log(this.user)
},
methods: { methods: {
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')

10
src/layout/components/Sidebar/Logo.vue

@ -2,11 +2,11 @@
<div class="sidebar-logo-container" :class="{'collapse':collapse}"> <div class="sidebar-logo-container" :class="{'collapse':collapse}">
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo"> <!-- <img v-if="logo" :src="logo" class="sidebar-logo"> -->
<h1 v-else class="sidebar-title">{{ title }} </h1> <h1 class="sidebar-title">{{ title }} </h1>
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo"> <!-- <img v-if="logo" :src="logo" class="sidebar-logo"> -->
<h1 class="sidebar-title">{{ title }} </h1> <h1 class="sidebar-title">{{ title }} </h1>
</router-link> </router-link>
</transition> </transition>
@ -25,7 +25,7 @@ export default {
}, },
data() { data() {
return { return {
title: '后台管理', title: '禅易精舍后台管理系统',
logo: Logo logo: Logo
} }
} }

3
src/main.js

@ -26,6 +26,9 @@ import App from './App'
import store from './store' import store from './store'
import router from './router/routers' import router from './router/routers'
import request from '@/utils/request'
Vue.prototype.$http = request
import './assets/icons' // icon import './assets/icons' // icon
import './router/index' // permission control import './router/index' // permission control

110
src/views/article/feedBack.vue

@ -0,0 +1,110 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<!-- <crudOperation :permission="permission" /> -->
<!--表单组件-->
<!-- <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="id">
<el-input v-model="form.id" style="width: 370px;" />
</el-form-item>
<el-form-item label="意见内容">
<el-input v-model="form.content" style="width: 370px;" />
</el-form-item>
<el-form-item label="建议人">
<el-input v-model="form.createUser" style="width: 370px;" />
</el-form-item>
<el-form-item label="创建时间">
<el-input v-model="form.createTime" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog> -->
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="index" width="55" />
<el-table-column prop="createUserName" label="建议人" />
<el-table-column prop="content" label="意见内容" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column v-permission="['admin','MemberFeedback:edit','MemberFeedback:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column> -->
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudMemberFeedback from '@/api/MemberFeedback'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import MaterialList from "@/components/material";
// crudpresenter
const defaultCrud = CRUD({ title: '意见反馈', url: 'api/MemberFeedback', sort: 'id,desc', crudMethod: { ...crudMemberFeedback }})
const defaultForm = { id: null, content: null, createUser: null, createTime: null, updateTime: null, isDel: null }
export default {
name: 'MemberFeedback',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'MemberFeedback:add'],
edit: ['admin', 'MemberFeedback:edit'],
del: ['admin', 'MemberFeedback:del']
},
rules: {
} }
},
watch: {
},
methods: {
//
[CRUD.HOOK.beforeRefresh]() {
return true
}, //
[CRUD.HOOK.afterToCU](crud, form) {
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
</style>

6
src/views/article/index.vue

@ -21,14 +21,14 @@
<!--<eForm ref="form" :is-add="isAdd" />--> <!--<eForm ref="form" :is-add="isAdd" />-->
<!--表格渲染--> <!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;"> <el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" /> <el-table-column prop="id" label="ID" width="120"/>
<el-table-column prop="title" label="标题" /> <el-table-column prop="title" label="标题" />
<el-table-column prop="author" label="作者" /> <el-table-column ref="table" prop="imageInput" label="封面" width="150">
<el-table-column ref="table" prop="imageInput" label="封面">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a> <a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="author" label="作者" />
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期"> <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime }}</span> <span>{{ scope.row.createTime }}</span>

30
src/views/course/addStudy.vue

@ -10,11 +10,17 @@
@change="handleChange"> @change="handleChange">
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="榜单名称">
<el-input v-model="form.listName" style="width: 370px;" />
</el-form-item>
<el-form-item label="榜单图片">
<picUpload v-model="form.imageInput"></picUpload>
</el-form-item>
<el-form-item label="打榜时间"> <el-form-item label="打榜时间">
<el-date-picker <el-date-picker
v-model="form.listStartTime" v-model="form.listStartTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择打榜开始时间" placeholder="请选择打榜开始时间"
:picker-options="listStart"> :picker-options="listStart">
</el-date-picker> </el-date-picker>
@ -22,7 +28,7 @@
<el-date-picker <el-date-picker
v-model="form.listEndTime" v-model="form.listEndTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择打榜结束时间" placeholder="请选择打榜结束时间"
:picker-options="listEnd"> :picker-options="listEnd">
</el-date-picker> </el-date-picker>
@ -52,24 +58,24 @@
<el-date-picker <el-date-picker
v-model="form.enterEndTime" v-model="form.enterEndTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择报名结束时间"> placeholder="请选择报名结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="要求打卡次数"> <!-- <el-form-item label="要求打卡次数">
<el-input-number v-model="form.clockTimes" :min="1" label="请输入要求打卡次数"></el-input-number> <el-input-number v-model="form.clockTimes" :min="1" label="请输入要求打卡次数"></el-input-number>
</el-form-item> </el-form-item> -->
<el-form-item label="允许缺卡次数"> <el-form-item label="允许缺卡次数">
<el-input-number v-model="form.missedClockTimes" :min="1" label="请输入允许缺卡次数"></el-input-number> <el-input-number v-model="form.missedClockTimes" :min="1" label="请输入允许缺卡次数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="榜单状态"> <!-- <el-form-item label="榜单状态">
<el-radio-group v-model="form.listState"> <el-radio-group v-model="form.listState">
<el-radio :label="0">未开始</el-radio> <el-radio :label="0">未开始</el-radio>
<el-radio :label="1">打榜中</el-radio> <el-radio :label="1">打榜中</el-radio>
<el-radio :label="2">已完成</el-radio> <el-radio :label="2">已完成</el-radio>
<el-radio :label="3">已取消</el-radio> <el-radio :label="3">已取消</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
<el-form-item label="榜单介绍"> <el-form-item label="榜单介绍">
<!--<editor v-model="form.content" />--> <!--<editor v-model="form.content" />-->
<ueditor-wrap v-model="form.content" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap> <ueditor-wrap v-model="form.content" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
@ -90,8 +96,9 @@ import yamedit from '@/components/YamlEdit'
import MaterialList from '@/components/material' import MaterialList from '@/components/material'
import UeditorWrap from 'vue-ueditor-wrap'; import UeditorWrap from 'vue-ueditor-wrap';
import { initData } from '@/api/data' import { initData } from '@/api/data'
import picUpload from '@/components/pic-upload'
export default { export default {
components: { yamedit, MaterialList, UeditorWrap }, components: {picUpload, yamedit, MaterialList, UeditorWrap },
data() { data() {
return { return {
loading: false, dialog: false, loading: false, dialog: false,
@ -175,8 +182,8 @@ export default {
}, },
getQueryParams: function() { getQueryParams: function() {
return { return {
page: 1, page: 0,
size: 10, size: 200,
sort: ['id,desc'], sort: ['id,desc'],
} }
}, },
@ -219,6 +226,7 @@ export default {
} }
}, },
doAdd() { doAdd() {
this.form.imgPath = this.form.imageInput;
add(this.form).then(res => { add(this.form).then(res => {
this.resetForm() this.resetForm()
this.$notify({ this.$notify({
@ -260,6 +268,7 @@ export default {
this.form = { this.form = {
id: '', id: '',
categoryId: '', categoryId: '',
listName: '',
imgPath: '', imgPath: '',
content: '', content: '',
listStartTime: '', listStartTime: '',
@ -270,7 +279,6 @@ export default {
enterEndTime: '', enterEndTime: '',
clockTimes: '', clockTimes: '',
missedClockTimes: '', missedClockTimes: '',
listState: '',
createTime: '', createTime: '',
updateTime: '', updateTime: '',
integral: '' integral: ''

127
src/views/course/courseLevel.vue

@ -0,0 +1,127 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="id">
<el-input v-model="form.id" style="width: 370px;" />
</el-form-item>
<el-form-item label="课程价格">
<el-input v-model="form.price" style="width: 370px;" />
</el-form-item>
<el-form-item label="等级">
<el-input v-model="form.level" style="width: 370px;" />
</el-form-item>
<el-form-item label="等级名称">
<el-input v-model="form.name" style="width: 370px;" />
</el-form-item>
<el-form-item label="createTime">
<el-input v-model="form.createTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="updateTime">
<el-input v-model="form.updateTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="isDel">
<el-input v-model="form.isDel" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" />
<el-table-column v-if="columns.visible('price')" prop="price" label="课程价格" />
<el-table-column v-if="columns.visible('level')" prop="level" label="等级" />
<el-table-column v-if="columns.visible('name')" prop="name" label="等级名称" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('updateTime')" prop="updateTime" label="updateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('isDel')" prop="isDel" label="isDel" />
<el-table-column v-permission="['admin','CourseLevel:edit','CourseLevel:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudCourseLevel from '@/api/CourseLevel'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import MaterialList from "@/components/material";
// crudpresenter
const defaultCrud = CRUD({ title: '课程等级表', url: 'api/CourseLevel', sort: 'id,desc', crudMethod: { ...crudCourseLevel }})
const defaultForm = { id: null, price: null, level: null, name: null, createTime: null, updateTime: null, isDel: null }
export default {
name: 'CourseLevel',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'CourseLevel:add'],
edit: ['admin', 'CourseLevel:edit'],
del: ['admin', 'CourseLevel:del']
},
rules: {
} }
},
watch: {
},
methods: {
//
[CRUD.HOOK.beforeRefresh]() {
return true
}, //
[CRUD.HOOK.afterToCU](crud, form) {
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
</style>

305
src/views/course/courseManage.vue

@ -0,0 +1,305 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<el-input
v-model="query.courseName"
clearable placeholder="输入搜索内容"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="课程等级" prop="level">
<el-select v-model="form.level">
<el-option v-for="item in levelList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="课程分类" prop="categoryIds">
<el-cascader
v-model="form.categoryIds"
:options="categoryList"
:show-all-levels="false"
:props="{ checkStrictly: true }"
@change="handleChange">
</el-cascader>
</el-form-item>
<el-form-item label="课程图片" prop="imageInput">
<picUpload v-model="form.imageInput"></picUpload>
</el-form-item>
<el-form-item label="课程名称" prop="courseName">
<el-input v-model="form.courseName" />
</el-form-item>
<el-form-item label="课程简介" prop="courseIntroduce">
<el-input type="textarea" v-model="form.courseIntroduce" />
</el-form-item>
<el-form-item label="课程天数" prop="dayCount">
<el-input v-model="form.dayCount" placeholder="请填写课程天数" @input="countChange"></el-input>
</el-form-item>
<el-form-item label="课程表" v-if="form.courseScheduleList.length>0" prop="courseContent">
<el-input
type="textarea"
style="margin-bottom:10px;"
v-for="(item,index) in form.courseScheduleList"
:key="index"
:placeholder="'请输入第'+ item.day + '天的课程内容'"
v-model="item.courseContent"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="submit">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" width="75"/>
<el-table-column v-if="columns.visible('courseName')" prop="courseName" label="课程名称"/>
<el-table-column prop="imageArr" label="课程封面">
<template slot-scope="scope">
<a :href="scope.row.imageArr[0]" style="color: #42b983" target="_blank">
<img :src="scope.row.imageArr[0]" alt="点击打开" style="width:38px;height:38px;border-radius:4px;">
</a>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('categoryName')" prop="categoryName" label="分类名称" />
<el-table-column v-if="columns.visible('courseIntroduce')" prop="courseIntroduce" label="课程简介" :show-overflow-tooltip="true"/>
<el-table-column ref="table" prop="dayCount" label="课程天数"></el-table-column>
<el-table-column v-permission="['admin','cyCourse:del']" label="操作" width="260px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudCyCourse from '@/api/cyCourse'
import crudCourseMaster from "@/api/CourseMaster";
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import picUpload from '@/components/pic-upload'
import MaterialList from "@/components/material"
import { initData } from '@/api/data'
import { parseTime } from '@/utils/index'
// crudpresenter
const defaultCrud = CRUD({
title: '课程模块',
url: 'api/cyCourse',
sort: 'id,desc',
isModel:1,
crudMethod: { ...crudCyCourse }
})
const defaultForm = {
id: null,
masters:[],
categoryIds: null,
level:null,
courseName: '',
categoryName: null,
courseIntroduce: null,
seatArrange: 1,
chargeType: 0,
courseCharge: null,
createTime: null,
updateTime: null,
deleted: null,
createUser: null,
updateUser: null,
imageInput: '',
imageArr: [],
courseScheduleList:[],
}
export default {
name: 'courseManage',
components: {picUpload, pagination, crudOperation, rrOperation, udOperation ,MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
courseTime:null,
signTime:null,
permission: {
add: ['admin', 'cyCourse:add'],
edit: ['admin', 'cyCourse:edit'],
view: ['admin', 'cyCourse:view'],
del: ['admin', 'cyCourse:del']
},
categoryList: [],
rules: {
courseName:[
{ required: true, message: '请填写课程名称', trigger: 'blur' }
],
level: [
{ required: true, message: '请选择课程等级', trigger: 'blur' }
],
categoryIds: [
{ required: true, message: '请选择课程分类', trigger: 'blur' }
],
courseIntroduce: [
{ required: true, message: '请填写课程简介', trigger: 'blur' }
],
dayCount: [
{ required: true, message: '请填写课程天数', trigger: 'blur' }
],
},
detailDialog:false,
detail:{},
signUpData:[],
masterList:[],
showCreateSeat:false,
seatForm:{
rowNum:'',
colNum:'',
courseId:''
},
levelList:[]
}
},
watch: {
},
created(){
this.getCategory()
this.getCourseLevel()
},
mounted(){
console.log(crudCourseMaster)
this.$http('api/CourseMaster','get').then((res)=>{
this.masterList = res.content
})
},
methods: {
getCourseLevel(){
crudCyCourse.getCourseLevel().then((res)=>{
this.levelList = res.content
})
},
createSeat(id){
this.seatForm.courseId = id;
this.showCreateSeat = true;
},
submitSetSeat(){
console.log(this.seatForm)
let data = {
colNum: this.seatForm.colNum,
rowNum: this.seatForm.rowNum,
courseId: this.seatForm.courseId,
}
crudCyCourse.courseSeat(this.seatForm).then((res)=>{
this.$message({
type:'success',
message:'操作成功!'
}).catch((res)=>{
console.log(res)
})
})
},
cancelSubmit(){
this.showCreateSeat = false;
this.seatForm = {
rowNum:'',
colNum:'',
courseId:'',
}
},
handleChange(value){
console.log(value)
// this.form.categoryId = value;
},
//
[CRUD.HOOK.beforeRefresh]() {
return true
}, //
[CRUD.HOOK.afterToCU](crud, form) {
},
getCategory(){
initData('/api/CourseCategory',this.getQueryParams()).then((res)=>{
// console.log(res)
res.content.forEach((item)=>{
item.label = item.categoryName
item.value = item.id
item.children = item.categoryList
item.categoryList.forEach((child)=>{
child.label = child.categoryName
child.value = child.id
child.children = child.categoryList
})
})
this.categoryList = res.content
})
},
getQueryParams: function() {
return {
page: 0,
size: 200,
sort: ['id,desc'],
}
},
countChange(){
let num = this.form.dayCount;
for(let i = 0; i < num; i++){
this.form.courseScheduleList.push({day:i+1, courseContent:''})
}
},
submit(){
this.form.imageArr = [this.form.imageInput]
this.form.isModel = 1
this.crud.submitCU()
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
.detail-box{
width: 100%;
font-size: 16px;
padding: 24px;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.18);
border-radius: 12px;
}
.el-row{
margin: 24px 0;
}
.title-w{
font-size:19px;
font-weight: bold;
margin: 32px 0;
color: #000;
}
</style>

221
src/views/course/index.vue

@ -13,32 +13,29 @@
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="课程等级"> <el-form-item label="课程模本" prop="modelId">
<el-input-number v-model="form.level" :min="1" label="文章等级"></el-input-number> <el-select v-model="form.modelId">
</el-form-item> <el-option v-for="item in modelList"
<el-form-item label="课程分类">
<el-select v-model="form.categoryId" filterable allow-create default-first-option>
<el-option v-for="item in categoryList"
:key="item.id" :key="item.id"
:label="item.categoryName" :label="item.courseName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="课程图片"> <el-form-item label="主讲老师" prop="masters">
<picUpload v-model="form.imageInput"></picUpload> <el-select v-model="form.masters" multiple>
</el-form-item> <el-option v-for="item in masterList"
<el-form-item label="课程名称"> :key="item.id"
<el-input v-model="form.courseName" /> :label="item.name"
</el-form-item> :value="item.id">
<el-form-item label="课程简介"> </el-option>
<el-input v-model="form.courseIntroduce" /> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="课程时间" prop="courseEndTime"> <el-form-item label="课程时间" prop="courseEndTime">
<el-date-picker <el-date-picker
v-model="form.courseStartTime" v-model="form.courseStartTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择课程开始时间" placeholder="请选择课程开始时间"
:picker-options="courseStart" :picker-options="courseStart"
@change="courseTimeChange"> @change="courseTimeChange">
@ -47,26 +44,17 @@
<el-date-picker <el-date-picker
v-model="form.courseEndTime" v-model="form.courseEndTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择课程结束时间" placeholder="请选择课程结束时间"
:picker-options="courseEnd" :picker-options="courseEnd"
@change="courseTimeChange"> @change="courseTimeChange">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="课程表" v-if="form.courseScheduleList.length>0">
<el-input
type="textarea"
style="margin-bottom:10px;"
v-for="(item,index) in form.courseScheduleList"
:key="index"
:placeholder="'请输入第'+ item.day + '天的课程内容'"
v-model="item.courseContent"></el-input>
</el-form-item>
<el-form-item label="签到时间" prop="signEndTime"> <el-form-item label="签到时间" prop="signEndTime">
<el-date-picker <el-date-picker
v-model="form.signStartTime" v-model="form.signStartTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择报名开始时间" placeholder="请选择报名开始时间"
:picker-options="signStart"> :picker-options="signStart">
</el-date-picker> </el-date-picker>
@ -74,7 +62,7 @@
<el-date-picker <el-date-picker
v-model="form.signEndTime" v-model="form.signEndTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择报名结束时间" placeholder="请选择报名结束时间"
:picker-options="signEnd"> :picker-options="signEnd">
</el-date-picker> </el-date-picker>
@ -83,7 +71,7 @@
<el-date-picker <el-date-picker
v-model="form.enterStartTime" v-model="form.enterStartTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择报名开始时间" placeholder="请选择报名开始时间"
:picker-options="enterStart"> :picker-options="enterStart">
</el-date-picker> </el-date-picker>
@ -91,19 +79,28 @@
<el-date-picker <el-date-picker
v-model="form.enterEndTime" v-model="form.enterEndTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm"
placeholder="请选择报名结束时间" placeholder="请选择报名结束时间"
:picker-options="enterEnd"> :picker-options="enterEnd">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="开课地点"> <el-form-item label="座位安排">
<el-radio-group v-model="form.seatArrange">
<el-radio :label="1">线上安排</el-radio>
<el-radio :label="2">签到安排</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开课地点" prop="coursePlace">
<el-input v-model="form.coursePlace" /> <el-input v-model="form.coursePlace" />
</el-form-item> </el-form-item>
<el-form-item label="开始详细地点" prop="detailedAddress" >
<el-input v-model="form.detailedAddress" />
</el-form-item>
<el-form-item label="报名人数" prop="courseEnterPerson"> <el-form-item label="报名人数" prop="courseEnterPerson">
<el-input v-model="form.courseEnterPerson" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')" <el-input v-model="form.courseEnterPerson" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"
maxlength="6"/> maxlength="6"/>
</el-form-item> </el-form-item>
<el-form-item label="收费类型" prop="chargeType"> <!-- <el-form-item label="收费类型" prop="chargeType">
<el-radio-group v-model="form.chargeType"> <el-radio-group v-model="form.chargeType">
<el-radio :label="0">免费</el-radio> <el-radio :label="0">免费</el-radio>
<el-radio :label="1">收费</el-radio> <el-radio :label="1">收费</el-radio>
@ -112,11 +109,12 @@
<el-form-item label="课程费用" prop="courseCharge" v-if="form.chargeType == 1"> <el-form-item label="课程费用" prop="courseCharge" v-if="form.chargeType == 1">
<el-input v-model="form.courseCharge" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')" <el-input v-model="form.courseCharge" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"
maxlength="6" /> maxlength="6" />
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="error" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="submit">确认</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="submit">确认</el-button>
<!-- <el-button type="warning" @click="againSubmit">重新发布</el-button> -->
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
@ -128,7 +126,7 @@
<el-table-column v-if="columns.visible('courseIntroduce')" prop="courseIntroduce" label="课程简介" :show-overflow-tooltip="true"/> <el-table-column v-if="columns.visible('courseIntroduce')" prop="courseIntroduce" label="课程简介" :show-overflow-tooltip="true"/>
<el-table-column prop="courseState" label="课程状态"> <el-table-column prop="courseState" label="课程状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.courseState == 1 ? '进行中' : scope.row.courseState == 2 ? '已结束' : '已取消' }}</span> <span>{{scope.row.courseState == 1 ? '进行中' : scope.row.courseState == 2 ? '已结束' : '未开始' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('courseStartTime')" prop="courseStartTime" label="课程时间" :show-overflow-tooltip="true"> <el-table-column v-if="columns.visible('courseStartTime')" prop="courseStartTime" label="课程时间" :show-overflow-tooltip="true">
@ -146,11 +144,19 @@
<span>{{ parseTime(scope.row.enterStartTime) }} ~ {{ parseTime(scope.row.enterEndTime) }}</span> <span>{{ parseTime(scope.row.enterStartTime) }} ~ {{ parseTime(scope.row.enterEndTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column ref="table" prop="qrcodePath" label="课程二维码">
<template slot-scope="scope">
<a :href="scope.row.qrcodePath" style="color: #42b983" target="_blank">
<img :src="scope.row.qrcodePath" alt="点击打开" style="width:38px;height:38px;border-radius:4px;">
</a>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('coursePlace')" prop="coursePlace" label="开课地点"/> <el-table-column v-if="columns.visible('coursePlace')" prop="coursePlace" label="开课地点"/>
<el-table-column v-if="columns.visible('courseEnterPerson')" prop="courseEnterPerson" label="报名人数" /> <el-table-column v-if="columns.visible('courseEnterPerson')" prop="courseEnterPerson" label="报名人数" />
<el-table-column v-if="columns.visible('courseCharge')" prop="courseCharge" label="费用" /> <el-table-column v-if="columns.visible('courseCharge')" prop="courseCharge" label="费用" />
<el-table-column v-permission="['admin','cyCourse:del']" label="操作" width="260px" align="center"> <el-table-column v-permission="['admin','cyCourse:del']" label="操作" width="260px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="warning" size="mini" @click="createSeat(scope.row)" v-if="scope.row.seatArrange == 2">生成座位</el-button>
<udOperation <udOperation
:data="scope.row" :data="scope.row"
:permission="permission" :permission="permission"
@ -184,16 +190,35 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="title-w">报名信息 签到数/报名数</div> <div class="title-w">报名信息 已签到{{detail.signedNum}}/ 报名数{{detail.realEnterPerson}}</div>
<div class="sign-up-table"> <div class="sign-up-table">
<el-table :data="signUpData" size="small" style="width: 100%;"> <el-table :data="detail.cyCourseMemberVos" size="small" style="width: 100%;">
<el-table-column label="会员姓名"></el-table-column> <el-table-column label="会员姓名" prop="memberName"></el-table-column>
<el-table-column label="手机号"></el-table-column> <el-table-column label="手机号" prop="phone"></el-table-column>
<el-table-column label="是否签到"></el-table-column> <el-table-column label="是否签到" prop="memberName">
<el-table-column label="服务老师"></el-table-column> <template slot-scope="scope"></template></template>
<span style="" v-if="scope.row.signState == 0">未签到</span>
<span style="color:green" v-else>已签到</span>
</template>
</el-table-column>
<el-table-column label="服务老师" prop="sellerName"></el-table-column>
</el-table> </el-table>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="生成座位" :close-on-click-modal="false" :visible.sync="showCreateSeat" width="500px">
<el-form v-model="seatForm">
<el-form-item label="总桌数" prop="rowNum">
<el-input v-model="seatForm.rowNum" type="number" placeholder="请输入会场总桌数" />
</el-form-item>
<el-form-item label="每桌人数" prop="colNum">
<el-input v-model="seatForm.colNum" type="number" placeholder="请输入每桌人数" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancelSubmit">取消</el-button>
<el-button type="primary" @click="submitSetSeat">确认</el-button>
</div>
</el-dialog>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
</div> </div>
@ -202,6 +227,7 @@
<script> <script>
import crudCyCourse from '@/api/cyCourse' import crudCyCourse from '@/api/cyCourse'
import crudCourseMaster from "@/api/CourseMaster";
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
@ -217,11 +243,14 @@ const defaultCrud = CRUD({
title: '课程模块', title: '课程模块',
url: 'api/cyCourse', url: 'api/cyCourse',
sort: 'id,desc', sort: 'id,desc',
isModel:0,
crudMethod: { ...crudCyCourse } crudMethod: { ...crudCyCourse }
}) })
const defaultForm = { const defaultForm = {
id: null, id: null,
categoryId: null, modelId:'',
masters:[],
categoryIds: null,
level:null, level:null,
courseName: null, courseName: null,
categoryName: null, categoryName: null,
@ -234,6 +263,7 @@ const defaultForm = {
enterEndTime: null, enterEndTime: null,
coursePlace: null, coursePlace: null,
courseEnterPerson: null, courseEnterPerson: null,
seatArrange: 1,
chargeType: 0, chargeType: 0,
courseCharge: null, courseCharge: null,
createTime: null, createTime: null,
@ -261,11 +291,11 @@ export default {
}, },
categoryList: [], categoryList: [],
rules: { rules: {
id: [ modelId: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '请选择课程模板', trigger: 'blur' }
], ],
categoryId: [ masters: [
{ required: true, message: '分类id不能为空', trigger: 'blur' } { required: true, message: '请选择授课老师', trigger: 'blur' }
], ],
courseEndTime: [ courseEndTime: [
{ required: true, message: '课程时间不能为空', trigger: 'blur' } { required: true, message: '课程时间不能为空', trigger: 'blur' }
@ -282,8 +312,11 @@ export default {
courseEnterPerson: [ courseEnterPerson: [
{ required: true, message: '课程报名人数不能为空', trigger: 'blur' } { required: true, message: '课程报名人数不能为空', trigger: 'blur' }
], ],
chargeType: [ coursePlace: [
{ required: true, message: '收费类型(0:免费;1:收费)不能为空', trigger: 'blur' } { required: true, message: '请填写开课地点', trigger: 'blur' }
],
detailedAddress: [
{ required: true, message: '请填写开课详细地点', trigger: 'blur' }
], ],
courseCharge: [ courseCharge: [
// { required: true, message: '', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
@ -317,7 +350,7 @@ export default {
disabledDate: time => { disabledDate: time => {
const beginDateVal = new Date(this.form.signStartTime).getTime() const beginDateVal = new Date(this.form.signStartTime).getTime()
if (beginDateVal) { if (beginDateVal) {
return time.getTime() < beginDateVal - 0 return time.getTime() < beginDateVal - 86400000
} }
} }
}, },
@ -337,9 +370,17 @@ export default {
} }
} }
}, },
detailDialog:false, detailDialog: false,
detail:{}, detail: {},
signUpData:[], signUpData: [],
masterList: [],
showCreateSeat: false,
seatForm: {
rowNum: '',
colNum: '',
courseId: ''
},
modelList: []
} }
}, },
@ -347,8 +388,53 @@ export default {
}, },
created(){ created(){
this.getCategory() this.getCategory()
this.getCourseManage()
},
mounted(){
console.log(crudCourseMaster)
this.$http('api/CourseMaster','get').then((res) => {
this.masterList = res.content
})
}, },
methods: { methods: {
getCourseManage(){
crudCyCourse.getCourseManage(1).then((res) => {
this.modelList = res.content
})
},
createSeat(item){
this.seatForm.courseId = item.id;
this.seatForm.rowNum = item.tables;
this.seatForm.colNum = item.numOfTables;
this.showCreateSeat = true;
},
submitSetSeat(){
let data = {
colNum: this.seatForm.colNum,
rowNum: this.seatForm.rowNum,
courseId: this.seatForm.courseId,
}
crudCyCourse.courseSeat(this.seatForm).then((res)=>{
this.$message({
type:'success',
message:'操作成功!'
}).catch((res)=>{
console.log(res)
})
})
},
cancelSubmit(){
this.showCreateSeat = false;
this.seatForm = {
rowNum:'',
colNum:'',
courseId:'',
}
},
handleChange(value){
console.log(value)
// this.form.categoryId = value;
},
// //
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
return true return true
@ -361,19 +447,27 @@ export default {
getCategory(){ getCategory(){
initData('/api/CourseCategory',this.getQueryParams()).then((res)=>{ initData('/api/CourseCategory',this.getQueryParams()).then((res)=>{
// console.log(res) // console.log(res)
res.content.forEach((item)=>{
item.label = item.categoryName
item.value = item.id
item.children = item.categoryList
item.categoryList.forEach((child)=>{
child.label = child.categoryName
child.value = child.id
child.children = child.categoryList
})
})
this.categoryList = res.content this.categoryList = res.content
}) })
}, },
getQueryParams: function() { getQueryParams: function() {
return { return {
page: 1, page: 0,
size: 10, size: 200,
sort: ['id,desc'], sort: ['id,desc'],
} }
}, },
courseTimeChange(){ courseTimeChange(){
// console.log(this.form.courseStartTime)
// console.log(this.form.courseEndTime)
this.form.courseScheduleList = []; this.form.courseScheduleList = [];
if(this.form.courseStartTime && this.form.courseEndTime){ if(this.form.courseStartTime && this.form.courseEndTime){
var day1 = new Date(this.form.courseStartTime) var day1 = new Date(this.form.courseStartTime)
@ -388,8 +482,23 @@ export default {
}, },
submit(){ submit(){
this.form.imageArr = [this.form.imageInput] this.form.imageArr = [this.form.imageInput]
this.form.isModel = 0
this.crud.submitCU() this.crud.submitCU()
}, },
againSubmit(){
this.form.imageArr = [this.form.imageInput];
this.form.id = null;
this.form.courseState = null;
crudCyCourse.add(this.form).then((res)=>{
this.$message({
type:'success',
message:'操作成功!'
})
this.crud.status.cu = 0;
}).catch((res)=>{
console.log(res)
})
},
showDetail(row){ showDetail(row){
this.detail = row; this.detail = row;
console.log(this.detail) console.log(this.detail)

8
src/views/course/studyList.vue

@ -38,16 +38,16 @@
<span>{{ parseTime(scope.row.enterEndTime) }}</span> <span>{{ parseTime(scope.row.enterEndTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('clockTimes')" prop="clockTimes" label="要求打卡次数" /> <el-table-column v-if="columns.visible('listName')" prop="listName" label="榜单名称" />
<el-table-column v-if="columns.visible('missedClockTimes')" prop="missedClockTimes" label="允许缺卡次数" /> <el-table-column v-if="columns.visible('missedClockTimes')" prop="missedClockTimes" label="允许缺卡次数" />
<el-table-column v-if="columns.visible('listState')" prop="listState" label="榜单状态"> <!-- <el-table-column v-if="columns.visible('listState')" prop="listState" label="榜单状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.listState == 0">未开始</span> <span v-if="scope.row.listState == 0">未开始</span>
<span v-if="scope.row.listState == 1">打榜中</span> <span v-if="scope.row.listState == 1">打榜中</span>
<span v-if="scope.row.listState == 2">已完成</span> <span v-if="scope.row.listState == 2">已完成</span>
<span v-if="scope.row.listState == 3">已取消</span> <span v-if="scope.row.listState == 3">已取消</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column v-if="columns.visible('integral')" prop="integral" label="奖惩积分" /> <el-table-column v-if="columns.visible('integral')" prop="integral" label="奖惩积分" />
<el-table-column label="操作" width="170px" align="center"> <el-table-column label="操作" width="170px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -89,6 +89,7 @@ import initData from '@/mixins/crud'
const defaultCrud = CRUD({ title: '学习榜', url: 'api/StudyList', sort: 'id,desc', crudMethod: { ...crudStudyList }}) const defaultCrud = CRUD({ title: '学习榜', url: 'api/StudyList', sort: 'id,desc', crudMethod: { ...crudStudyList }})
const defaultForm = { const defaultForm = {
id: null, id: null,
listName: null,
categoryId: null, categoryId: null,
imgPath: null, imgPath: null,
content: null, content: null,
@ -100,7 +101,6 @@ const defaultForm = {
enterEndTime: null, enterEndTime: null,
clockTimes: null, clockTimes: null,
missedClockTimes: null, missedClockTimes: null,
listState: null,
createTime: null, createTime: null,
updateTime: null, updateTime: null,
integral: null } integral: null }

2
src/views/login.vue

@ -165,7 +165,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image:url("../assets/images/bg.jpg"); background-image:url("../assets/images/bg.png");
background-size: cover; background-size: cover;
} }
.title { .title {

8
src/views/shop/goods/form.vue

@ -211,14 +211,14 @@
<el-input-number :min="0" v-model="formValidate.sort" placeholder="请输入排序" /> <el-input-number :min="0" v-model="formValidate.sort" placeholder="请输入排序" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <!-- <el-col :span="24">
<el-form-item label="佣金设置:"> <el-form-item label="佣金设置:">
<el-radio-group v-model="formValidate.is_sub"> <el-radio-group v-model="formValidate.is_sub">
<el-radio :label="1" class="radio">单独设置</el-radio> <el-radio :label="1" class="radio">单独设置</el-radio>
<el-radio :label="0">默认设置</el-radio> <el-radio :label="0">默认设置</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="24" v-if="formValidate.is_sub === 1"> <el-col :span="24" v-if="formValidate.is_sub === 1">
<!--单规格返佣--> <!--单规格返佣-->
<el-form-item label="商品属性:" v-if="formValidate.spec_type === 0"> <el-form-item label="商品属性:" v-if="formValidate.spec_type === 0">
@ -290,7 +290,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <!-- <el-col v-bind="grid">
<el-form-item label="热卖单品:"> <el-form-item label="热卖单品:">
<el-radio-group v-model="formValidate.is_hot" > <el-radio-group v-model="formValidate.is_hot" >
<el-radio :label="1" class="radio">开启</el-radio> <el-radio :label="1" class="radio">开启</el-radio>
@ -321,7 +321,7 @@
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</el-row> </el-row>
<el-form-item> <el-form-item>
<el-button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</el-button> <el-button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</el-button>

2
src/views/shop/order/index.vue

@ -84,7 +84,7 @@
<!--表格渲染--> <!--表格渲染-->
<el-table ref="multipleTable" v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange"> <el-table ref="multipleTable" v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column :selectable="checkboxT" type="selection" width="50" /> <el-table-column :selectable="checkboxT" type="selection" width="50" />
<el-table-column prop="orderId" width="140" label="订单号"> <el-table-column prop="orderId" width="160" label="订单号">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.orderId }}</span> <span>{{ scope.row.orderId }}</span>
<p>{{ scope.row.pinkName }}</p> <p>{{ scope.row.pinkName }}</p>

11
src/views/shop/user/master.vue

@ -54,11 +54,12 @@
prop="name" prop="name"
label="姓名" label="姓名"
/> />
<el-table-column <el-table-column v-if="columns.visible('photoPath')" prop="photoPath" label="照片路径">
v-if="columns.visible('photoPath')" <template slot-scope="scope">
prop="photoPath" <!-- <img :src="scope.row.photoPath" alt="" width="35px" height="35rpx"> -->
label="照片路径" <a :href="scope.row.photoPath" style="color: #42b983" target="_blank"><img :src="scope.row.photoPath" alt="点击打开" class="el-avatar"></a>
/> </template>
</el-table-column>
<el-table-column <el-table-column
v-if="columns.visible('introduction')" v-if="columns.visible('introduction')"
prop="introduction" prop="introduction"

123
src/views/system/configManage/index.vue

@ -0,0 +1,123 @@
<template>
<div>
<div class="title-box">小程序基础设置</div>
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="190px">
<el-form-item label="服务老师注册口令" prop="sellerActivityCode">
<el-input v-model="form.sellerActivityCode" style="width: 35%" />
</el-form-item>
<el-form-item label="文章全部解锁金额" prop="articlePrice">
<el-input v-model="form.articlePrice" style="width: 35%" />
</el-form-item>
<el-form-item label="服务人员电话" prop="serviceStaffPhone">
<el-input v-model="form.serviceStaffPhone" style="width: 35%" />
</el-form-item>
<!-- <el-form-item label="能量大师的会员等级" prop="userHighestLevel">
<el-input v-model="form.userHighestLevel" style="width: 35%" />
</el-form-item> -->
<div class="title-box">积分规则设置</div>
<el-form-item :label="'积分签到'+item.day+'所得积分'" prop="userHighestLevel" v-for="(item,index) in form.signInfos" :key="index">
<el-input v-model="item.signNum" style="width: 35%" />
</el-form-item>
<el-form-item label="完善个人信息所得积分" prop="completedNum">
<el-input v-model="form.completedNum" style="width: 35%" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { setConfig, getConfigs } from '@/api/setConfig'
export default {
data() {
return {
loading:false,
form:{
"signInfos": [
{
"day": "第一天",
"signNum": "10"
},
{
"day": "第二天",
"signNum": "20"
},
{
"day": "第三天",
"signNum": "30"
},
{
"day": "第四天",
"signNum": "40"
},
{
"day": "第五天",
"signNum": "50"
},
{
"day": "第六天",
"signNum": "60"
},
{
"day": "第七天",
"signNum": "100"
}
]
},
rules: {
sellerActivityCode: [
{ required: true, message: '服务老师注册口令不能为空', trigger: 'blur' }
],
articlePrice: [
{ required: true, message: '文章全部解锁金额不能为空', trigger: 'blur' }
],
serviceStaffPhone: [
{ required: true, message: '服务人员电话不能为空', trigger: 'blur' }
],
// completedNum: [
// { required: true, message: '', trigger: 'blur' }
// ]
}
}
},
mounted(){
this.getConfigs()
},
methods: {
getConfigs(){
getConfigs(["seller_activity_code","unlock_all_article_price","service_staff_phone","completed_num"]).then((res)=>{
this.form = res
})
},
doSubmit() {
this.loading = true;
this.$refs['form'].validate((valid) => {
if (valid) {
setConfig(this.form).then(res => {
console.log(res)
this.$message({
type:'success',
message:'操作成功!'
})
this.getConfigs()
this.loading = false;
}).catch(err => {
console.log(err.response.data.message)
})
} else {
return false
}
})
}
}
}
</script>
<style scoped>
.title-box{
font-size: 24px;
padding: 20px;
}
</style>

9
src/views/wechat/article/form.vue

@ -9,7 +9,7 @@
<el-input v-model="form.author" style="width: 370px;" /> <el-input v-model="form.author" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="封面"> <el-form-item label="封面">
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" /> <MaterialList v-model="form.imageArr" type="image" :num="1" :width="350" :height="115" />
</el-form-item> </el-form-item>
<el-form-item label="文章分类"> <el-form-item label="文章分类">
<el-cascader <el-cascader
@ -24,9 +24,10 @@
<el-radio-group v-model="form.chargeType"> <el-radio-group v-model="form.chargeType">
<el-radio :label="0">免费</el-radio> <el-radio :label="0">免费</el-radio>
<el-radio :label="1">收费</el-radio> <el-radio :label="1">收费</el-radio>
<el-radio :label="2">积分兑换</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="文章费用" prop="courseCharge" v-if="form.chargeType == 1"> <el-form-item :label="form.chargeType == 1 ? '文章费用' : '所需积分'" prop="courseCharge" v-if="form.chargeType == 1 || form.chargeType == 2">
<el-input v-model="form.articleCharge" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')" <el-input v-model="form.articleCharge" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"
maxlength="6" style="width: 370px;" /> maxlength="6" style="width: 370px;" />
</el-form-item> </el-form-item>
@ -167,8 +168,8 @@ export default {
}, },
getQueryParams: function() { getQueryParams: function() {
return { return {
page: 1, page: 0,
size: 10, size: 200,
sort: ['id,desc'], sort: ['id,desc'],
} }
}, },

Loading…
Cancel
Save