杨豪
3 years ago
28 changed files with 994 additions and 109 deletions
@ -1,9 +1,8 @@
|
||||
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' |
||||
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插件 |
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true |
||||
|
@ -1,6 +1,6 @@
|
||||
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' |
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
build/*.js |
||||
src/assets |
||||
src |
||||
public |
||||
dist |
||||
src/views |
||||
src/components |
||||
|
||||
|
||||
|
Binary file not shown.
@ -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 } |
@ -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 } |
@ -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' |
||||
}) |
||||
} |
Before Width: | Height: | Size: 531 KiB |
After Width: | Height: | Size: 1.2 MiB |
@ -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"; |
||||
|
||||
// crud交由presenter持有 |
||||
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> |
@ -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"; |
||||
|
||||
// crud交由presenter持有 |
||||
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> |
@ -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' |
||||
|
||||
// crud交由presenter持有 |
||||
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> |
@ -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> |
Loading…
Reference in new issue