|
@@ -162,6 +162,7 @@ const _ = require('lodash');
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: journcolumn } = createNamespacedHelpers('journcolumn');
|
|
|
const { mapActions: journnews } = createNamespacedHelpers('journnews');
|
|
|
+const { mapActions: survey } = createNamespacedHelpers('survey');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -196,6 +197,7 @@ export default {
|
|
|
methods: {
|
|
|
...journcolumn({ journcolumnQuery: 'query' }),
|
|
|
...journnews(['query', 'create', 'update', 'delete']),
|
|
|
+ ...survey({ surveycreate: 'create' }),
|
|
|
// 查询栏目
|
|
|
async searchcol() {
|
|
|
let res = await this.journcolumnQuery();
|
|
@@ -238,9 +240,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 网上调查提交
|
|
|
- onSubmit() {
|
|
|
+ async onSubmit() {
|
|
|
let data = this.form;
|
|
|
- console.log(data);
|
|
|
+ data.uid = this.user.uid;
|
|
|
+ if (data.uid) {
|
|
|
+ let res = await this.surveycreate(data);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '提交成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.form = {};
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '游客不可参与网上调查!',
|
|
|
+ type: 'warning',
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
computed: {
|