|
|
@@ -75,7 +75,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right">
|
|
|
<el-button
|
|
|
- @click="form1={},(dialogVisible = true), (dialogTitle = '新增Banner图')"
|
|
|
+ @click="add"
|
|
|
type="primary"
|
|
|
>新增Banner图</el-button
|
|
|
>
|
|
|
@@ -162,8 +162,15 @@
|
|
|
<el-radio v-model="form1.is_jump" :label="1">是</el-radio>
|
|
|
<el-radio v-model="form1.is_jump" :label="0">否</el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="跳转地址">
|
|
|
- <el-input v-model="form1.url" placeholder="请输入跳转地址"></el-input>
|
|
|
+ <el-form-item label="跳转地址" v-if="form1.is_jump">
|
|
|
+ <el-select v-model="form1.seltype" placeholder="请选择" @change="getSelData" style="display:inline-block;width:100px;">
|
|
|
+ <el-option label="会议" value="conference"></el-option>
|
|
|
+ <el-option label="活动" value="activity"></el-option>
|
|
|
+ <el-option label="文章" value="article"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select filterable v-model="form1.selval" placeholder="请选择" style="display:inline-block;width:85%;">
|
|
|
+ <el-option v-for="(item,index) in selData" :label="item.name" :value="item.id" :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
@@ -180,8 +187,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- form: { name: "", page: 1, page_size: 20 },
|
|
|
- form1: {is_active:1,is_jump:0,img:""},
|
|
|
+ form: { name: "", page: 1, page_size: 20,},
|
|
|
+ form1: {is_active:1,is_jump:1,img:"",seltype:"conference"},
|
|
|
total: 1,
|
|
|
list: [{ name: "2333" }],
|
|
|
loading: false,
|
|
|
@@ -191,17 +198,48 @@ export default {
|
|
|
defaultProps: {},
|
|
|
data: [],
|
|
|
selected: [],
|
|
|
+ selData:[]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
handleAvatarSuccess(res, file) {
|
|
|
- // this.form1.img = file.response.data;
|
|
|
this.$set(this.form1,"img",file.response.data)
|
|
|
},
|
|
|
search() {
|
|
|
let parm = this.form;
|
|
|
this.getData();
|
|
|
},
|
|
|
+ getSelData(){
|
|
|
+ this.selData = []
|
|
|
+ if(this.form1.seltype=="conference"){
|
|
|
+ this.$api.getConferenceSearch().then((res)=>{
|
|
|
+ this.selData = res.data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.form1.seltype=="activity"){
|
|
|
+ this.$api.getActivitySearch().then((res)=>{
|
|
|
+ this.selData = res.data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.form1.seltype=="article"){
|
|
|
+ this.$api.getArticleSearch().then((res)=>{
|
|
|
+ this.selData = res.data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getUrl(){
|
|
|
+ let url = ""
|
|
|
+ if(this.form1.seltype=="conference"){
|
|
|
+ url = "../eventDetail/eventDetail?id="+this.form1.selval
|
|
|
+ }
|
|
|
+ if(this.form1.seltype=="activity"){
|
|
|
+ url = "../conference/conference?id="+this.form1.selval
|
|
|
+ }
|
|
|
+ if(this.form1.seltype=="article"){
|
|
|
+ url = "../actDetail/actDetail?id="+this.form1.selval
|
|
|
+ }
|
|
|
+ return url
|
|
|
+ },
|
|
|
getData() {
|
|
|
var parm = this.form;
|
|
|
this.loading = true;
|
|
|
@@ -219,6 +257,11 @@ export default {
|
|
|
this.form.page = this.$refs.pageButton.page;
|
|
|
this.getData();
|
|
|
},
|
|
|
+ add(){
|
|
|
+ this.form1={is_active:1,is_jump:1,img:"",seltype:"conference"},
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.dialogTitle = '新增Banner图'
|
|
|
+ },
|
|
|
edit(id){
|
|
|
this.$api.getBanners({id:id}).then((res)=>{
|
|
|
this.form1 = res.data.data
|
|
|
@@ -240,6 +283,8 @@ export default {
|
|
|
},
|
|
|
save() {
|
|
|
let parm = this.form1;
|
|
|
+ let url = this.getUrl()
|
|
|
+ parm.url = url
|
|
|
if (parm.id) {
|
|
|
this.$api.updateBanners(parm).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
@@ -270,6 +315,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getData();
|
|
|
+ this.getSelData();
|
|
|
},
|
|
|
};
|
|
|
</script>
|