添加一个选项
@@ -442,20 +338,22 @@ import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
import {CloudDownloadIcon} from "tdesign-icons-vue";
import VueQr from 'vue-qr'
import axios from "axios";
+import {toInteger} from "lodash";
+
export default {
- components: {Editor, Toolbar,CloudDownloadIcon,VueQr},
+ components: {Editor, Toolbar, CloudDownloadIcon, VueQr},
data() {
return {
questionnaireData: [{
- type: 1, title: '', wight:0,option: [{name: 'A', val: ""}, {name: 'B', val: ""}]
+ type: 1, title: '', wight: 0, option: [{name: 'A', val: ""}, {name: 'B', val: ""}]
}],
- InfotabIndex:'2',
+ InfotabIndex: '2',
tabIndex: '1',
visible: false,
infoMode: false,
addForm: {
// weigh:0,
- money:'0',
+ money: '0',
activity_name: '',
activity_desc: '',
activity_image_show: [],
@@ -465,17 +363,17 @@ export default {
activity_content: '',
activity_location: '',
activity_type: null,
- if_display_registrants:null,
- signup_start_time:'',
- signup_end_time:'',
- if_auditing:'1',
- range:'3',
- number:'',
- if_sign:'1',
- custom_points:''
+ if_display_registrants: null,
+ signup_start_time: '',
+ signup_end_time: '',
+ if_auditing: '1',
+ range: '3',
+ number: '',
+ if_sign: '1',
+ custom_points: ''
},
- activity_video:'',
- activity_video_show:[],
+ activity_video: '',
+ activity_video_show: [],
addMode: false,
isEdit: false,
editID: 0,
@@ -496,17 +394,7 @@ export default {
total: 0,
},
list: [],
- columns: [
- {colKey: 'activity_name', title: '活动标题', align: 'center',width: 150,},
- {colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
- {colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
- {colKey: 'start', title: '活动时间', align: 'center'},
- {colKey: 'sign', title: '报名时间', align: 'center'},
- {colKey: 'money', title: '付费金额', align: 'center'},
- {colKey: 'activity_location', title: '活动地点', align: 'center'},
- {colKey: 'top', title: '置顶', align: 'center'},
- {colKey: 'select', title: '操作', width: 200, align: 'center'},
- ],
+ columns: [],
pagination: {
page: 1,
size: 10,
@@ -536,7 +424,7 @@ export default {
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
metaWithUrl: false,
- meta:{
+ meta: {
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS 语法
@@ -546,9 +434,9 @@ export default {
// 从 res 中找到 url alt href ,然后插入图片
insertFn(res.data.fullurl, '', '')
},
- onError:(file, err, res)=>{
- if(err.message.indexOf('exceeds maximum allowed size') !== -1){
- this.$message.error('限制为50M,请调整好再上传!',2000);
+ onError: (file, err, res) => {
+ if (err.message.indexOf('exceeds maximum allowed size') !== -1) {
+ this.$message.error('限制为50M,请调整好再上传!', 2000);
}
},
}
@@ -556,19 +444,19 @@ export default {
},
questionnaireAddMode: false,//问题模态框
questionnaire: [],//问题列表
- questionnaireId:0,
- questionnaireUpdateMode:false,
- QuestionnaireMode:false,
- QuestionnaireModeId:0,
- questionnaireDaAnList:[],
- JuanModeList:[],
- JuanMode:false,
- JuanPage:1,
- JuanTotal:0,
- JuanId:0,
- getType:3,
- infoIfAuditing:1,//否
- association:{},
+ questionnaireId: 0,
+ questionnaireUpdateMode: false,
+ QuestionnaireMode: false,
+ QuestionnaireModeId: 0,
+ questionnaireDaAnList: [],
+ JuanModeList: [],
+ JuanMode: false,
+ JuanPage: 1,
+ JuanTotal: 0,
+ JuanId: 0,
+ getType: 3,
+ infoIfAuditing: 1,//否
+ association: {},
}
},
beforeDestroy() {
@@ -577,18 +465,65 @@ export default {
editor.destroy() // 组件销毁时,及时销毁编辑器
},
mounted() {
- if(typeof (store.state.user.association)=='object'){
- this.association=store.state.user.association;
- }else{
- this.association=JSON.parse(store.state.user.association);
+ if (typeof (store.state.user.association) == 'object') {
+ this.association = store.state.user.association;
+ } else {
+ this.association = JSON.parse(store.state.user.association);
+ }
+ this.editorConfig.MENU_CONF.uploadImage.meta.association_id = this.association.association_id;
+ var tab=this.$route.name.slice(-1);
+ this.tabIndex = toInteger(tab);
+ if(tab==1){
+ this.columns=[
+ {colKey: 'activity_name', title: '活动标题', align: 'center', width: 150,},
+ {colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
+ {colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
+ {colKey: 'start', title: '活动时间', align: 'center'},
+ {colKey: 'sign', title: '报名时间', align: 'center'},
+ // {colKey: 'money', title: '付费金额', align: 'center'},
+ {colKey: 'activity_location', title: '活动地点', align: 'center'},
+ {colKey: 'top', title: '置顶', align: 'center'},
+ {colKey: 'select', title: '操作', width: 200, align: 'center'},
+ ];
+ }else if(tab==2){
+ this.columns=[
+ {colKey: 'activity_name', title: '活动标题', align: 'center', width: 150,},
+ {colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
+ {colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
+ {colKey: 'start', title: '活动时间', align: 'center'},
+ {colKey: 'activity_location', title: '活动地点', align: 'center'},
+ {colKey: 'top', title: '置顶', align: 'center'},
+ {colKey: 'select', title: '操作', width: 200, align: 'center'},
+ ];
+ }else if(tab==3){
+ this.columns=[
+ {colKey: 'activity_name', title: '活动标题', align: 'center', width: 150,},
+ {colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
+ {colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
+ {colKey: 'start', title: '活动时间', align: 'center'},
+ {colKey: 'activity_location', title: '活动地点', align: 'center'},
+ {colKey: 'top', title: '置顶', align: 'center'},
+ {colKey: 'select', title: '操作', width: 200, align: 'center'},
+ ];
+ }else{
+ this.columns=[
+ {colKey: 'activity_name', title: '活动标题', align: 'center', width: 150,},
+ {colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
+ {colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
+ {colKey: 'start', title: '活动时间', align: 'center'},
+ {colKey: 'sign', title: '报名时间', align: 'center'},
+ {colKey: 'money', title: '付费金额', align: 'center'},
+ {colKey: 'activity_location', title: '活动地点', align: 'center'},
+ {colKey: 'top', title: '置顶', align: 'center'},
+ {colKey: 'select', title: '操作', width: 200, align: 'center'},
+ ];
}
- this.editorConfig.MENU_CONF.uploadImage.meta.association_id=this.association.association_id;
this.getList();
},
methods: {
- updateType(d,type){
+ updateType(d, type) {
this.$request
- .post('/application/updateType', {id: d.id,type:type})
+ .post('/application/updateType', {id: d.id, type: type})
.then((res) => {
if (res.code == 1) {
this.$message.success('审核成功');
@@ -603,19 +538,19 @@ export default {
console.log(e);
});
},
- openJuanMode(d){
- this.JuanModeList=[];
- this.JuanMode=true;
- this.JuanTotal=0;
- this.JuanPage=1;
- this.JuanId=d.id;
- this.getType=d.activity_type;
+ openJuanMode(d) {
+ this.JuanModeList = [];
+ this.JuanMode = true;
+ this.JuanTotal = 0;
+ this.JuanPage = 1;
+ this.JuanId = d.id;
+ this.getType = d.activity_type;
this.openJuanModeList();
},
- topNewsDel(row){
+ topNewsDel(row) {
console.log(row);
this.$request
- .post('/common/listcancel', {id: row.id,type:'activity'})
+ .post('/common/listcancel', {id: row.id, type: 'activity'})
.then((res) => {
if (res.code == 1) {
this.$message.success('取消置顶成功');
@@ -629,10 +564,10 @@ export default {
console.log(e);
});
},
- topNews(row){
+ topNews(row) {
console.log(row);
this.$request
- .post('/common/listtopping', {id: row.id,type:'activity'})
+ .post('/common/listtopping', {id: row.id, type: 'activity'})
.then((res) => {
if (res.code == 1) {
this.$message.success('置顶成功');
@@ -646,42 +581,42 @@ export default {
console.log(e);
});
},
- openJuanModeList(){
+ openJuanModeList() {
this.$request
.post("/money_log/find", {
- activity_id: this.JuanId,
- page:this.JuanPage,
- size:15
+ activity_id: this.JuanId,
+ page: this.JuanPage,
+ size: 15
})
.then((res) => {
console.log(res);
- if(res.code==1){
- this.JuanModeList=res.data.ret;
- this.JuanTotal=res.data.count;
+ if (res.code == 1) {
+ this.JuanModeList = res.data.ret;
+ this.JuanTotal = res.data.count;
}
})
.catch((e) => {
console.log(e);
});
},
- onJuanChange(d){
- this.JuanPage=d;
+ onJuanChange(d) {
+ this.JuanPage = d;
this.openJuanModeList();
},
- openQuestionnaireMode(d){
- this.QuestionnaireMode=true;
- this.QuestionnaireModeId=d.id;
+ openQuestionnaireMode(d) {
+ this.QuestionnaireMode = true;
+ this.QuestionnaireModeId = d.id;
this.openQuestionnaireModeDo();
},
- openQuestionnaireModeDo(d){
+ openQuestionnaireModeDo(d) {
this.$request
.post("/questionnaire/questionnaireStatistics", {
- activity_id: this.QuestionnaireModeId
+ activity_id: this.QuestionnaireModeId
})
.then((res) => {
console.log(res);
- if(res.code==1){
- this.questionnaireDaAnList=res.data;
+ if (res.code == 1) {
+ this.questionnaireDaAnList = res.data;
}
})
.catch((e) => {
@@ -689,9 +624,9 @@ export default {
});
},
//删除编辑题目里的单条选项
- delUpdateOptionTop(index,item){
+ delUpdateOptionTop(index, item) {
console.log(item);
- if(this.questionnaire.length<=1){
+ if (this.questionnaire.length <= 1) {
this.$message.error('至少保留一个题目');
return;
}
@@ -702,27 +637,27 @@ export default {
})
.then((res) => {
console.log(res);
- if(res.code==1){
+ if (res.code == 1) {
//删除成功
this.$message.success('删除成功');
- }else{
+ } else {
this.$message.error(res.msg);
}
- this.openQuestionnaireUpdate({id:item.activity_id});
+ this.openQuestionnaireUpdate({id: item.activity_id});
})
.catch((e) => {
console.log(e);
});
},
- delOptionTop(index){
- if(this.questionnaireData.length<=1){
+ delOptionTop(index) {
+ if (this.questionnaireData.length <= 1) {
this.$message.error('至少保留一个题目');
return;
}
this.questionnaireData.splice(index, 1);
},
- delUpdateOptionItem(index,opIndex){
- if( this.questionnaire[index].option.length<=2){
+ delUpdateOptionItem(index, opIndex) {
+ if (this.questionnaire[index].option.length <= 2) {
this.$message.error('至少保留两个选项');
return;
}
@@ -731,8 +666,8 @@ export default {
item.name = String.fromCharCode(65 + index);
});
},
- delOptionItem(index,opIndex){
- if( this.questionnaireData[index].option.length<=2){
+ delOptionItem(index, opIndex) {
+ if (this.questionnaireData[index].option.length <= 2) {
this.$message.error('至少保留两个选项');
return;
}
@@ -741,7 +676,7 @@ export default {
item.name = String.fromCharCode(65 + index);
});
},
- updateOption(d){
+ updateOption(d) {
var option = d.option;
console.log(option);
const transformedArray = [];
@@ -755,16 +690,16 @@ export default {
this.$request
.post("/questionnaire/topicEdit", {
topic: JSON.stringify(jsonString),
- id:d.id,
+ id: d.id,
})
.then((res) => {
console.log(res);
- if(res.code==1){
+ if (res.code == 1) {
this.$message.success('保存成功');
- }else{
+ } else {
this.$message.error(res.msg);
}
- this.openQuestionnaireUpdate({id:d.activity_id});
+ this.openQuestionnaireUpdate({id: d.activity_id});
})
.catch((e) => {
console.log(e);
@@ -772,7 +707,7 @@ export default {
},
addQuestionnaire() {
var newItem = {
- type: 1, title: '',wight:0, option: [{name: 'A', val: ""}, {name: 'B', val: ""}]
+ type: 1, title: '', wight: 0, option: [{name: 'A', val: ""}, {name: 'B', val: ""}]
};
this.questionnaireData.push(newItem);
},
@@ -783,19 +718,19 @@ export default {
};
this.questionnaireData[index].option.push(newItem);
},
- onSubmitQuestionnaire(){
+ onSubmitQuestionnaire() {
let jsonString = JSON.stringify(this.questionnaireData);
console.log(jsonString);
this.$request
.post("/questionnaire/topicAdd", {
activity_id: this.questionnaireId,
- topic:jsonString
+ topic: jsonString
})
.then((res) => {
console.log(res);
- if(res.code==1){
+ if (res.code == 1) {
this.$message.success('添加成功');
- }else{
+ } else {
this.$message.error(res.msg);
}
this.onCloseMy();
@@ -804,7 +739,7 @@ export default {
console.log(e);
});
},
- openQuestionnaireUpdate(d){
+ openQuestionnaireUpdate(d) {
this.$request
.post("/questionnaire/questionnairefind", {
activity_id: d.id,
@@ -819,7 +754,7 @@ export default {
});
},
openQuestionnairefind(d) {
- this.questionnaireId=d.id;
+ this.questionnaireId = d.id;
this.questionnaireAddMode = true;
},
onCurrentChangeInfo(d) {
@@ -830,13 +765,13 @@ export default {
this.pagination.page = d;
this.getList();
},
- openInfoDo(){
+ openInfoDo() {
this.$request
.post("/application/getList", {
activity_id: this.infoId,
page: this.info_pagination.page,
size: this.info_pagination.size,
- type:this.InfotabIndex
+ type: this.InfotabIndex
})
.then((res) => {
console.log(res);
@@ -852,21 +787,21 @@ export default {
},
openInfo(d) {
console.log(d);
- this.info_list=[];
- this.info_pagination.page=1;
- this.info_pagination.total=0;
+ this.info_list = [];
+ this.info_pagination.page = 1;
+ this.info_pagination.total = 0;
this.infoMode = true;
this.infoId = d.id;
- this.infoIfAuditing=d.if_auditing;
+ this.infoIfAuditing = d.if_auditing;
// if(d.if_auditing==1){
// this.InfotabIndex='2';
// }else{
// this.InfotabIndex='1';
// }
- if(d.if_auditing!=2){
+ if (d.if_auditing != 2) {
this.info_columns = this.info_columns.filter(column => column.colKey !== 'sign');
- }else{
- this.info_columns= [
+ } else {
+ this.info_columns = [
{colKey: 'photo_image', title: '形象照', align: 'center'},
{colKey: 'nikename', title: '姓名', align: 'center'},
{colKey: 'phone', title: '手机号', align: 'center'},
@@ -878,7 +813,7 @@ export default {
}
this.openInfoDo();
},
- formatResponseVideo(res){
+ formatResponseVideo(res) {
console.log(res);
this.activity_video = res.data.url;
return {url: res.data.fullurl};
@@ -913,7 +848,7 @@ export default {
this.isEdit = false;
this.addForm = {
// weigh:0,
- money:0,
+ money: 0,
activity_name: '',
activity_desc: '',
activity_image_show: [],
@@ -923,51 +858,25 @@ export default {
activity_content: '',
activity_location: '',
activity_type: null,
- if_display_registrants:null,
- signup_start_time:'',
- signup_end_time:'',
- if_auditing:'1',
- range:'3',
- number:'',
- if_sign:'1',
- custom_points:''
+ if_display_registrants: null,
+ signup_start_time: '',
+ signup_end_time: '',
+ if_auditing: '1',
+ range: '3',
+ number: '',
+ if_sign: '1',
+ custom_points: ''
};
},
edit(d) {
- this.addForm.id = d.id;
- this.activity_video = d.video;
- if(d.video==''){
- this.activity_video_show = [];
- }else{
- this.activity_video_show = [{url: store.state.user.apiUrl + d.video,name:d.video}];
- }
- // this.addForm.weigh = d.weigh;
- this.addForm.activity_name = d.activity_name;
- this.addForm.activity_desc = d.activity_desc;
- this.addForm.activity_image_show = [{url: store.state.user.apiUrl + d.activity_image}];
- this.addForm.activity_image = d.activity_image;
- this.addForm.activity_start_time = d.activity_start_time;
- this.addForm.activity_end_time = d.activity_end_time;
- this.addForm.activity_location = d.activity_location;
- this.addForm.activity_content = d.activity_content;
- this.addForm.activity_type = d.activity_type;
- this.addForm.if_display_registrants = d.if_display_registrants;
- this.addForm.money = d.money;
- this.addForm.signup_start_time= d.signup_start_time;
- this.addForm.signup_end_time=d.signup_end_time;
-
- this.addForm.if_auditing=String(d.if_auditing);
- this.addForm.range=String(d.range);
- this.addForm.number=String(d.number);
- this.addForm.if_sign=String(d.if_sign);
- this.addForm.custom_points=String(d.custom_points);
- this.addMode = true;
- this.isEdit = true;
+ this.$router.push({
+ path: '/activity/activity_edit?id=' + d.id + "&edit=1",
+ });
},
- InfotabIndexChange(d){
- this.info_list=[];
- this.info_pagination.page=1;
- this.info_pagination.total=0;
+ InfotabIndexChange(d) {
+ this.info_list = [];
+ this.info_pagination.page = 1;
+ this.info_pagination.total = 0;
this.openInfoDo();
},
tabIndexChange(d) {
@@ -983,9 +892,9 @@ export default {
if (res.code == 1) {
this.list = res.data.ret;
this.pagination.total = res.data.count;
- }else{
+ } else {
this.list = [];
- this.pagination.total =0;
+ this.pagination.total = 0;
}
})
@@ -1023,7 +932,7 @@ export default {
this.$message.error('活动结束时间不能为空');
return;
}
- if(this.addForm.activity_type==1||this.addForm.activity_type==4){
+ if (this.addForm.activity_type == 1 || this.addForm.activity_type == 4) {
if (this.addForm.signup_start_time == '') {
this.$message.error('报名开始时间不能为空');
return;
@@ -1037,16 +946,16 @@ export default {
this.$message.error('活动地址不能为空');
return;
}
- if(this.addForm.activity_type==2||this.addForm.activity_type==3){
- this.addForm.signup_start_time=this.addForm.activity_start_time;
- this.addForm.signup_end_time=this.addForm.activity_end_time;
+ if (this.addForm.activity_type == 2 || this.addForm.activity_type == 3) {
+ this.addForm.signup_start_time = this.addForm.activity_start_time;
+ this.addForm.signup_end_time = this.addForm.activity_end_time;
}
console.log(this.addForm);
var url = '/activity/add';
if (this.isEdit) {
url = '/activity/update';
}
- this.addForm.video=this.activity_video;
+ this.addForm.video = this.activity_video;
this.$request
.post(url, this.addForm)
.then((res) => {
@@ -1068,17 +977,17 @@ export default {
this.addMode = false;
this.infoMode = false;
this.questionnaireAddMode = false;
- this.questionnaireUpdateMode=false;
- this.QuestionnaireMode=false;
- this.JuanMode=false;
+ this.questionnaireUpdateMode = false;
+ this.QuestionnaireMode = false;
+ this.JuanMode = false;
},
- exportList(d){
+ exportList(d) {
const token = store.state.user.token;
- if(d==0){
- window.open(store.state.user.apiUrl + '/api/excel_controller/applicationexport?id='+this.infoId+"&token="+token);
+ if (d == 0) {
+ window.open(store.state.user.apiUrl + '/api/excel_controller/applicationexport?id=' + this.infoId + "&token=" + token);
}
- if(d==1){
- window.open(store.state.user.apiUrl + '/api/excel_controller/activityexport?id='+this.QuestionnaireModeId+"&token="+token);
+ if (d == 1) {
+ window.open(store.state.user.apiUrl + '/api/excel_controller/activityexport?id=' + this.QuestionnaireModeId + "&token=" + token);
}
},
@@ -1089,7 +998,11 @@ export default {
::-webkit-scrollbar {
display: none;
}
-.layui-table-mend, .layui-table-tool, .layui-table-patch, .layui-table-click, .layui-table-hover, .layui-table-header, .table-total-wrapper, .layui-table-total td, .layui-table thead tr, .layui-table tbody tr:hover td, .layui-table.layui-table-even tr:nth-child(2n) td{background-color: #fafafa!important;}
+
+.layui-table-mend, .layui-table-tool, .layui-table-patch, .layui-table-click, .layui-table-hover, .layui-table-header, .table-total-wrapper, .layui-table-total td, .layui-table thead tr, .layui-table tbody tr:hover td, .layui-table.layui-table-even tr:nth-child(2n) td {
+ background-color: #fafafa !important;
+}
+
.layui-table td, .layui-table th {
position: relative;
padding: 10px;
@@ -1100,6 +1013,7 @@ export default {
border-style: solid;
border-color: #eee;
}
+
.layui-table {
width: 100%;
background-color: #fff;
@@ -1107,7 +1021,8 @@ export default {
table-layout: fixed;
border-collapse: collapse;
}
-.w-e-full-screen-container{
+
+.w-e-full-screen-container {
z-index: 1024;
}
diff --git a/src/pages/dashboard/base/index.vue b/src/pages/dashboard/base/index.vue
index 6c20ef4..725b2ee 100644
--- a/src/pages/dashboard/base/index.vue
+++ b/src/pages/dashboard/base/index.vue
@@ -1,36 +1,82 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ item.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ item.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/news/news_index.vue b/src/pages/news/news_index.vue
index cc755e8..a0aa949 100644
--- a/src/pages/news/news_index.vue
+++ b/src/pages/news/news_index.vue
@@ -1,7 +1,36 @@
- 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
-