|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="list-view">
|
|
<div class="list-view">
|
|
|
<div class="filters-container">
|
|
<div class="filters-container">
|
|
|
- <el-form :model="form" inline label-width="100px">
|
|
|
|
|
|
|
+ <el-form :model="form" inline size="mini" label-width="100px">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="活动名称">
|
|
<el-form-item label="活动名称">
|
|
@@ -14,9 +14,9 @@
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in performances"
|
|
v-for="item in performances"
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -129,7 +129,7 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button @click="getData" type="primary" icon="el-icon-search">搜索 </el-button>
|
|
<el-button @click="getData" type="primary" icon="el-icon-search">搜索 </el-button>
|
|
|
- <el-button @click="addRow" type="primary" icon="el-icon-plus">添加 </el-button>
|
|
|
|
|
|
|
+ <el-button @click="addRow" type="primary" icon="el-icon-plus" v-if="add">添加 </el-button>
|
|
|
<el-upload
|
|
<el-upload
|
|
|
:action="uploadUrl"
|
|
:action="uploadUrl"
|
|
|
:before-upload="beforeUpload"
|
|
:before-upload="beforeUpload"
|
|
@@ -140,9 +140,7 @@
|
|
|
class="uploader"
|
|
class="uploader"
|
|
|
:on-error="onfail"
|
|
:on-error="onfail"
|
|
|
>
|
|
>
|
|
|
- <el-button slot="trigger" size="small" type="primary" icon="el-icon-upload2"
|
|
|
|
|
- >批量上传</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button slot="trigger" type="primary" icon="el-icon-upload2" v-if="add">批量上传</el-button>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="download"
|
|
@click="download"
|
|
@@ -188,7 +186,9 @@
|
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="340">
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="340">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-button @click="showRow(row)" size="mini" plain>查看</el-button>
|
|
<el-button @click="showRow(row)" size="mini" plain>查看</el-button>
|
|
|
- <el-button type="success" @click="editRow(row)" size="mini" plain>编辑</el-button>
|
|
|
|
|
|
|
+ <el-button type="success" @click="editRow(row)" size="mini" plain v-if="row.status == 0"
|
|
|
|
|
+ >编辑</el-button
|
|
|
|
|
+ >
|
|
|
<el-button type="warning" @click="playVideo(row)" size="mini" plain>浏览视频</el-button>
|
|
<el-button type="warning" @click="playVideo(row)" size="mini" plain>浏览视频</el-button>
|
|
|
<el-button @click="showCode(row)" type="primary" size="mini" plain>查看二维码</el-button>
|
|
<el-button @click="showCode(row)" type="primary" size="mini" plain>查看二维码</el-button>
|
|
|
<!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
|
|
<!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
|
|
@@ -253,6 +253,7 @@ import { mapState } from 'vuex';
|
|
|
import pageableTable from '@/mixins/pageableTable';
|
|
import pageableTable from '@/mixins/pageableTable';
|
|
|
import QrcodeVue from 'qrcode.vue';
|
|
import QrcodeVue from 'qrcode.vue';
|
|
|
import resolveUrl from 'resolve-url';
|
|
import resolveUrl from 'resolve-url';
|
|
|
|
|
+import { format } from 'date-fns';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ProgrammeOrgList',
|
|
name: 'ProgrammeOrgList',
|
|
@@ -293,11 +294,14 @@ export default {
|
|
|
videoUrl: '',
|
|
videoUrl: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
instructor: '',
|
|
instructor: '',
|
|
|
- uploadUrl: ''
|
|
|
|
|
|
|
+ uploadUrl: '',
|
|
|
|
|
+ currentTime: '',
|
|
|
|
|
+ add: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.uploadUrl = resolveUrl(this.$baseUrl, 'programme/upload');
|
|
this.uploadUrl = resolveUrl(this.$baseUrl, 'programme/upload');
|
|
|
|
|
+ this.currentTime = format(new Date(), 'yyyy-MM-dd');
|
|
|
this.$http
|
|
this.$http
|
|
|
.post('/setting/byFlag', { flag: 3 })
|
|
.post('/setting/byFlag', { flag: 3 })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -365,12 +369,17 @@ export default {
|
|
|
)
|
|
)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (res.content.length > 0) {
|
|
if (res.content.length > 0) {
|
|
|
- res.content.forEach(item => {
|
|
|
|
|
- this.performances.push({
|
|
|
|
|
- label: item.name,
|
|
|
|
|
- value: item.id
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // res.content.forEach(item => {
|
|
|
|
|
+ // this.performances.push({
|
|
|
|
|
+ // label: item.name,
|
|
|
|
|
+ // value: item.id
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ this.performances = res.content;
|
|
|
|
|
+ if (!this.$route.query.pid) {
|
|
|
|
|
+ this.performanceId = res.content[0].id;
|
|
|
|
|
+ this.canAdd(this.performanceId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
@@ -603,6 +612,15 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ canAdd(id) {
|
|
|
|
|
+ let data = this.performances.find(item => {
|
|
|
|
|
+ item.id == id;
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ if (data.endDate > this.currentTime) {
|
|
|
|
|
+ this.add = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|