Commit 0b5d291a by 肖翔宇

12.27

parent 47d81629
......@@ -4,7 +4,7 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://192.168.10.104:9001/sharePiano"',
BASE_API: '"http://gxgqs.com/sharePiano"',
})
//http://gxgqs.com/sharePiano
//http://192.168.10.105:9001/sharePiano
No preview for this file type
......@@ -10,7 +10,7 @@
style='width: 650px; margin-left:50px;'>
<el-form-item label="名称" prop="title">
<el-input type="text" placeholder="请标题名称"
v-model.trim="temp.title" :maxlength="25">
v-model.trim="temp.title" :maxlength="15">
</el-input>
</el-form-item>
<el-form-item label="课程类型" prop="curriculumType">
......
......@@ -2,15 +2,21 @@
<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>
<modal @on-close="close()" :is-show='isShow'>
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="100px"
style='width: 350px; margin-left:50px;margin-top:40px;'>
<el-form-item label="拒绝理由" prop="reason">
<el-input type="text" placeholder="请输入拒绝理由"
v-model.trim="temp.reason":maxlength="25">
</el-input>
</el-form-item>
</el-form>
<el-button type="primary" @click="handleUnpass">提交</el-button>
</modal>
</div>
<el-table :key='tableKey' :data="list" v-loading="listLoading" :element-loading-text="elementLoadingText" border fit
highlight-current-row style="width: 100%">
......@@ -45,16 +51,17 @@
<span>{{scope.row.state}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.reason">
<template slot-scope="scope">
<span>{{scope.row.reason}}</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>
<el-button v-if="scope.row.state=='未审核'" type="primary" size="mini" @click.native.prevent="handlePass(scope.row)"
round>通过</el-button>
<el-button v-if="scope.row.state=='未审核'" type="danger"
@click.native.prevent="show(scope.row)" size="mini" round>不通过</el-button>
</template>
</el-table-column>
</el-table>
......@@ -78,9 +85,9 @@
components: { Modal},
data() {
return {
isShowLog: false,
isShowCourse: false,
isShowDiversity: false,
isShow: false,
index:undefined,
buttonFlag:true,
isShowDiversityEdit: false,
tableKey: 0,
// 是否加载
......@@ -104,6 +111,7 @@
adress:'商家地址',
state:'状态',
createDate: '创建时间',
reason:'拒绝理由'
},
types: {
id: undefined,
......@@ -118,7 +126,7 @@
// 临时的表单值
temp: {
id: undefined,
title: undefined,
state: undefined,
curriculumType: undefined,
pictureAddress: undefined,
createDate: undefined,
......@@ -130,9 +138,9 @@
videoUploadPercent: 0,
// 表单验证的规则
rules: {
courseName: [
{ required: true, message: '课程名称不能为空', trigger: 'blur' },
{ type: 'string', max: 20, message: '课程名称不允许大于20位数', trigger: 'blur' }
reason: [
{ required: true, message: '拒绝理由不能为空', trigger: 'blur' },
{ type: 'string', max: 30, message: '拒绝理由不允许大于30位数', trigger: 'blur' }
]
},
bannerTypes: [],
......@@ -166,6 +174,15 @@
}
},
methods: {
show(row){
const index = this.list.indexOf(row);
this.temp=this.list[index];
console.log(this.temp)
this.isShow=true;
},
close(){
this.isShow=false;
},
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) {
......@@ -228,16 +245,6 @@
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 = {
......@@ -281,73 +288,6 @@
})
})
},
// 删除
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 = {
......@@ -357,17 +297,6 @@
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 {
......@@ -380,71 +309,30 @@
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(() => {
handlePass(row){
const index = this.list.indexOf(row);
const tempData = this.list[index];
tempData.state=1;
console.log(tempData);
this.$fetch.sysPianoSubmit.update(tempData).then(() => {
this.$message({
message: '更新成功',
type: 'success'
})
this.isShowDiversityEdit=false;
this.refresh();
})
}
} 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(() => {
},
handleUnpass(row){
this.temp.state=2;
this.$fetch.sysPianoSubmit.update(this.temp).then(() => {
this.$message({
message: '更新成功',
type: 'success'
})
//this.isShowLog=false;
this.isShowCourse=false;
this.refreshCourse();
this.refresh();
this.isShow=false;
})
}
} else {
console.log('valid error')
}
})
}
},
}
}
</script>
......
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