Commit 47d81629 by 肖翔宇

12.24

parent fd10ede5
......@@ -4,7 +4,7 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://192.168.0.7:9001/sharePiano"',
BASE_API: '"http://192.168.10.104:9001/sharePiano"',
})
//http://gxgqs.com/sharePiano
//http://192.168.10.105:9001/sharePiano
No preview for this file type
......@@ -12,6 +12,7 @@ import * as sysDict from './sys/dict'
import * as sysBanner from './sys/banner'
import * as sysUser from './sys/user'
import * as sysPiano from './sys/piano'
import * as sysPianoSubmit from './sys/pianoSubmit'
import * as sysUserCost from './sys/userCost'
import * as sysCourse from './sys/course'
import * as sysCourseType from './sys/courseType'
......@@ -31,7 +32,8 @@ const apiObj = {
sysBargain,
sysBargainStage,
sysCodeForPaino,
sysCourseDiversity
sysCourseDiversity,
sysPianoSubmit
}
const install = function(Vue) {
......
import request from '@/utils/request'
// 分页查询
export function pageList(data) {
return request({
url: '/sys/BusinessBasicInformation/pageList',
method: 'post',
data: data
})
}
// 插入
export function insert(data) {
return request({
url: '/sys/BusinessBasicInformation/insert',
method: 'post',
data: data
})
}
// 更新数据
export function update(data) {
return request({
url: '/sys/BusinessBasicInformation/update',
method: 'post',
data: data
})
}
// 查询
export function query(data) {
return request({
url: '/sys/BusinessBasicInformation/query',
method: 'post',
data: data
})
}
// 添加用户
export function addUser(data) {
return request({
url: '/sys/BusinessBasicInformation/addUser',
method: 'post',
data: data
})
}
// 删除数据
export function deletes(id, ids) {
const data = {}
if (id) {
data['id'] = id
}
if (ids) {
data['ids'] = ids
}
return request({
url: '/sys/BusinessBasicInformation/delete',
method: 'post',
data: data
})
}
......@@ -5,7 +5,7 @@ import 'nprogress/nprogress.css'// Progress 进度条样式
import { Message } from 'element-ui'
import { getToken } from '@/utils/auth' // 验权
const whiteList = ['/login','/courseList','/courseEdit','/bargainList','/bargainEdit','/pianoList','/pianoEdit','/code'] // 不重定向白名单
const whiteList = ['/login','/pianoSubmit','/courseList','/courseEdit','/bargainList','/bargainEdit','/pianoList','/pianoEdit','/code'] // 不重定向白名单
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
......
......@@ -142,6 +142,19 @@ export const constantRouterMap = [
]
},
{
path: '',
component: Layout,
children: [
{
path: '/pianoSubmit',
component: () => import('@/views/pianoList/index'),
name: 'pianoSubmit',
meta: { title: '商家申请', noCache: false }
},
]
},
{ path: '*', redirect: '/404', hidden: true }
]
......
......@@ -222,6 +222,7 @@
bannerTypes: [],
courseTypes: [],
courseDiversityTypes: [],
diversityId:undefined
}
},
created() {
......@@ -510,10 +511,9 @@
})
},
refreshDiversity(){
this.$fetch.sysCourseDiversity.query({id:this.diversityTemp.sysonlineCourseId}).then(({ data }) => {
this.$fetch.sysCourseDiversity.findBysysOnlineCourseId({id:this.diversityTemp.sysonlineCourseId}).then(({ data }) => {
console.log(data);
this.diversityTemp = data;
const params = this.$route.params;
})
},
getShowType(row, dispaly = 1) {
......@@ -541,8 +541,6 @@
})
//this.isShowLog=false;
this.isShowDiversityEdit=false;
this.refreshDiversity();
this.back()
})
} else {
this.$fetch.sysCourseDiversity.update(tempData).then(() => {
......@@ -551,8 +549,6 @@
type: 'success'
})
this.isShowDiversityEdit=false;
this.refreshDiversity();
this.back()
})
}
} else {
......@@ -580,7 +576,6 @@
//this.isShowLog=false;
this.isShowCourse=false;
this.refreshCourse();
this.back()
})
} else {
this.$fetch.sysCourseType.update(tempData).then(() => {
......@@ -591,7 +586,6 @@
//this.isShowLog=false;
this.isShowCourse=false;
this.refreshCourse();
this.back()
})
}
} else {
......
......@@ -177,7 +177,7 @@
// 返回
saveId(e){
console.log(e);
var index=this.temp.abc.indexOf(this.painoId);
var index=this.bannerType.indexOf(this.painoId);
this.bannerType.splice(index,1);
this.temp.sysCodeForPianoId.push(this.painoId);
this.painoId=0;
......
<!-- leaf -->
<template>
<div class="app-container">
<div class="filter-container">
<router-link :to="{name:'courseEdit'}">
<el-button class="filter-item" style="margin-left: 10px;" v-waves type="primary" icon="el-icon-plus">添加
</el-button>
</router-link>
<el-tooltip class="item" effect="dark" content="刷新" placement="top-start" :hide-after="toolTipTime">
<el-button class="filter-item" style="margin-left: 10px;" v-waves @click="refresh" type="success"
icon="el-icon-refresh" size="medium" circle></el-button>
</el-tooltip>
</div>
<el-table :key='tableKey' :data="list" v-loading="listLoading" :element-loading-text="elementLoadingText" border fit
highlight-current-row style="width: 100%">
<el-table-column align="center" :label="table.contacts">
<template slot-scope="scope">
<span v-for="item in bannerTypes" :key="item.key">
{{scope.row.contacts}}
</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.name">
<template slot-scope="scope">
<span v-for="item in bannerTypes" :key="item.key">
{{scope.row.name}}
</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.phone">
<template slot-scope="scope">
<span v-for="item in bannerTypes" :key="item.key">
{{scope.row.phone}}
</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.adress">
<template slot-scope="scope">
<span>{{scope.row.adress}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.state">
<template slot-scope="scope">
<span>{{scope.row.state}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200">
<template slot-scope="scope">
<router-link :to="{name:'courseEdit',params:{id:scope.row}}">
<el-button type="primary" icon="el-icon-edit" size="mini"
round></el-button>
</router-link>
<el-button type="danger" icon="el-icon-delete"
@click.native.prevent="handleDelete(scope.row)" size="mini" round></el-button>
<el-button type="primary" icon="el-icon-plus"
@click.native.prevent="showDiversity(scope.row)" size="mini" round>选集</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="listQuery.currentPage" :page-sizes="[10, 20, 30, 40,50,100]"
:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils'
import Modal from '@/components/Modal'
import { upload_url } from '@/common/config'
export default {
name: 'banner',
components: { Modal},
data() {
return {
isShowLog: false,
isShowCourse: false,
isShowDiversity: false,
isShowDiversityEdit: false,
tableKey: 0,
// 是否加载
listLoading: true,
// 查询参数
listQuery: {
currentPage: 1,
pageSize: 10,
name: undefined,
code: undefined
},
// 表格的数据
list: null,
// 总数量
total: null,
// 表单显示的名称
table: {
contacts:'商家名',
name: '客户名',
phone: '联系电话',
adress:'商家地址',
state:'状态',
createDate: '创建时间',
},
types: {
id: undefined,
courseName: undefined,
},
diversityTemp:{
id:undefined,
videoName:undefined,
videoAddress:undefined,
sysonlineCourseId:undefined
},
// 临时的表单值
temp: {
id: undefined,
title: undefined,
curriculumType: undefined,
pictureAddress: undefined,
createDate: undefined,
cretePerson: undefined,
numberOrder: undefined
},
uploadUrl: upload_url,
videoFlag: false,
videoUploadPercent: 0,
// 表单验证的规则
rules: {
courseName: [
{ required: true, message: '课程名称不能为空', trigger: 'blur' },
{ type: 'string', max: 20, message: '课程名称不允许大于20位数', trigger: 'blur' }
]
},
bannerTypes: [],
courseTypes: [],
courseDiversityTypes: [],
diversityId:undefined
}
},
created() {
// 初始化数据
this.getList()
},
mounted() {
this.$fetch.sysDict.optionsChildren('BANNER_TYPE').then(({ data }) => {
this.bannerTypes = data
})
},
computed: {
// 提示--显示的时间
toolTipTime() {
return this.$store.getters.toolTipTime
},
// 加载显示的文字
elementLoadingText() {
return this.$store.getters.elementLoadingText
},
// 加载显示的文字
displays() {
return this.$store.getters.displays
}
},
methods: {
beforeUploadVideo(file) {
const isLt10M = file.size / 1024 / 1024 < 200
if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) === -1) {
this.$message.error('请上传正确的视频格式')
return false
}
if (!isLt10M) {
this.$message.error('上传视频大小不能超过200MB哦!')
return false
}
},
uploadVideoProcess(event, file, fileList) {
this.videoFlag = true
this.videoUploadPercent = Number(file.percentage.toFixed(0))
},
handleVideoSuccess(res, file) {
// 获取上传图片地址
this.videoFlag = false
this.videoUploadPercent = 0
if (res.code === 200) {
this.diversityTemp.videoAddress = res.data
console.log(res.data);
} else {
this.$message.error('视频上传失败,请重新上传!')
}
},
handleSuccess(response, file) {
this.diversityTemp.videoAddress = response.data;
console.log(1)
},
handleRemove(file) {
this.diversityTemp.videoAddress = undefined;
},
getList() {
// 初始化数据 开始加载数据
this.listLoading = true;
console.log(this.listQuery)
this.$fetch.sysPianoSubmit
.pageList(this.listQuery)
.then(({ data, total }) => {
// 赋值数据
this.list = data;
this.total = Number(total)
// 数据加载完成
this.listLoading = false
})
},
// 处理搜索
handleFilter() {
this.listQuery.currentPage = 1
this.getList()
},
// 处理每页条数
handleSizeChange(val) {
this.listQuery.pageSize = val
this.getList()
},
// 处理当前页面
handleCurrentChange(val) {
this.listQuery.currentPage = val
this.getList()
},
beforeUpload(file) {
const _URL = window.URL || window.webkitURL
return new Promise((resolve, reject) => {
const img = new Image()
img.src = _URL.createObjectURL(file)
img.onload = function() {
}
resolve(true)
})
},
// 初始化temp值
resetTemp() {
this.temp = {
id: undefined,
title: undefined,
curriculumType: undefined,
pictureAddress: undefined,
videoAddress: undefined,
createDate: undefined,
cretePerson: undefined,
numberOrder: undefined
}
},
// 删除
handleDelete(row) {
if (!row.id) {
this.$message('请刷新后再试')
return
}
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$fetch.sysCourse.deletes(row.id).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
const index = this.list.indexOf(row)
this.list.splice(index, 1)
}).catch(function(reason) {
console.log( reason);
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 删除
handleDeleteCourse(row) {
for(var i in this.list){
console.log()
if(this.list[i].curriculumType==row.courseName){
this.$message('当前类型还存在课程,无法删除');
return;
}
}
if (!row.id) {
this.$message('请刷新后再试')
return
}
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$fetch.sysCourseType.deletes(row.id).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
const index = this.courseTypes.indexOf(row)
this.courseTypes.splice(index, 1);
}).catch(function(reason) {
console.log( reason);
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 删除
handleDeleteDiversity(row) {
if (!row.id) {
this.$message('请刷新后再试')
return
}
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$fetch.sysCourseDiversity.deletes(row.id).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
const index = this.courseDiversityTypes.indexOf(row)
this.courseDiversityTypes.splice(index, 1);
}).catch(function(reason) {
console.log( reason);
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
refresh() {
// 初始化查询参数
this.listQuery = {
currentPage: 1,
pageSize: 10
}
this.tableKey = this.tableKey + 1
this.getList()
},
refreshCourse(){
this.$fetch.sysCourseType.findAll().then(({ data }) => {
this.courseTypes = data;
})
},
refreshDiversity(){
this.$fetch.sysCourseDiversity.findBysysOnlineCourseId({id:this.diversityTemp.sysonlineCourseId}).then(({ data }) => {
console.log(data);
this.diversityTemp = data;
})
},
getShowType(row, dispaly = 1) {
if (row.display === dispaly) {
return {
type: 'info',
label: '隐藏'
}
}
return {
type: 'success',
label: '显示'
}
},
saveDiversityData() {
this.$refs['dataForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.diversityTemp)
console.log(tempData)
if (!tempData.id) {
this.$fetch.sysCourseDiversity.insert(tempData).then(() => {
this.$message({
message: '创建成功',
type: 'success'
})
//this.isShowLog=false;
this.isShowDiversityEdit=false;
})
} else {
this.$fetch.sysCourseDiversity.update(tempData).then(() => {
this.$message({
message: '更新成功',
type: 'success'
})
this.isShowDiversityEdit=false;
})
}
} else {
console.log('valid error')
}
})
},
saveData() {
this.$refs['dataForm'].validate(valid => {
if (valid) {
for(var i in this.courseTypes){
console.log(this.courseTypes[i].courseName,this.types.courseName)
if(this.courseTypes[i].courseName==this.types.courseName){
this.$message("该课程类型已存在");
return;
}
}
const tempData = Object.assign({}, this.types)
if (!tempData.id) {
this.$fetch.sysCourseType.insert(tempData).then(() => {
this.$message({
message: '创建成功',
type: 'success'
})
//this.isShowLog=false;
this.isShowCourse=false;
this.refreshCourse();
})
} else {
this.$fetch.sysCourseType.update(tempData).then(() => {
this.$message({
message: '更新成功',
type: 'success'
})
//this.isShowLog=false;
this.isShowCourse=false;
this.refreshCourse();
})
}
} else {
console.log('valid error')
}
})
}
}
}
</script>
<style scoped>
.avatar-video {
width: 300px;
height: 250px;
display: block;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment