Commit 8ec13f4f authored by zhengke's avatar zhengke

修改

parent 6e968c68
<template>
<!--前台搜尋設定(前台搜索设置)-->
<style>
.webSiteBg {
padding: 20px;
background-color: #fff;
}
</style>
<template>
<!--网站设定(网站设置)-->
<div class="WebSiteSearch">
<div class="BasicSet">
热门关键字
<br />
</div>
<el-form :model="PostMsg" ref="PostMsg" label-width="130px">
<el-tabs v-model="activeName">
<el-tab-pane label="基本設定" name="first">
<div class="webSiteBg">
<el-row>
<el-col :span="8">
<el-form-item label="顯示標題">
<el-input v-model="PostMsg.ShowTitle"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="編輯熱門關鍵字">
<el-input v-model="keywords" @keyup.native.enter="addKeyWords">
<el-button slot="append" @click="addKeyWords()">新增</el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<el-tag v-for="(tag,index) in keyWordsArr" :key="tag" closable :type="tag" @close="closeTag(index)" style="margin-right:10px;">
{{tag}}
</el-tag>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<el-button type="primary" size="small">儲存修改</el-button>
</el-form-item>
</el-col>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane label="地區" name="second">
<div class="webSiteBg">
<el-row>
<el-checkbox-group v-model="SearchAreaArr">
<el-col :span="6" v-for="(item,index) in areaData" :key="index" style="margin-bottom:20px;">
<el-checkbox :label="item.Id" :key="item.AreaName">{{item.AreaName}}</el-checkbox>
</el-col>
</el-checkbox-group>
</el-row>
<el-row>
<el-col :span="24">
<el-button type="primary" size="small" style="margin:40px 0">儲存修改</el-button>
</el-col>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane label="供應商旅行社" name="third">
<div class="webSiteBg">
<el-button @click="setAllArea()">批次設定區域</el-button>
<el-table ref="multipleTable" :data="PostMsg.TravelagencyList" tooltip-effect="dark" style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="100px">
</el-table-column>
<el-table-column prop="IsOpenSearch" label="開放搜尋" width="100px">
<template slot-scope="scope">
<el-switch v-model="scope.row.IsOpenSearch" :active-value="1" :inactive-value="0" active-color="#13ce66"
inactive-color="#dcdfe6" @change="UpdateAdIsSearch(scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column prop="AgencyName" label="旅行社" width="300px">
</el-table-column>
<el-table-column label="設定區域" width="200px">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="setArea(scope.row.Id)">設定</el-button>
</template>
</el-table-column>
<el-table-column prop="SetArea" label="開放區域">
<template slot-scope="scope">
{{getArea(scope.row.SetArea)}}
</template>
</el-table-column>
</el-table>
<el-button type="primary" size="small" style="margin:40px 0">儲存修改</el-button>
</div>
</el-tab-pane>
<el-tab-pane label="搜尋結果頁面" name="fourth">
<div class="webSiteBg">
<el-row>
<el-col :span="8">
<el-form-item label="顯示類型">
<el-select v-model="PostMsg.ShowType" style="width:100%">
<el-option label="豆腐格" value="1" key="1"></el-option>
<el-option label="篩選式列表" value="2" key="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" style="margin:40px 0">儲存修改</el-button>
</el-form-item>
</el-col>
</el-row>
</div>
</el-tab-pane>
</el-tabs>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
searchObj: {},
//选项卡
activeName: 'first',
//关键字
keywords:'',
keyWordsArr:[],
PostMsg: {
Id: 0,
ShowTitle: '',
HotWords: '',
SearchAreaIds: '',
ShowType: '',
TravelagencyList: [],
},
tags: ['标签1','标签2'],
//地区数据
areaData: [],
//总数据
dataList:[],
//选中的地区
SearchAreaArr:[],
};
},
mounted() {
this.getData();
this.getAreaList();
},
methods: {
//获取配置
getData() {
this.apipost(
"ws_get_GetSearchConfig", {},
res => {
if (res.data.resultCode == 1) {
console.log(res, 'resss');
var tempData = res.data.data;
if(tempData){
if (tempData.Id) {
this.PostMsg.Id = tempData.Id;
}
if(tempData.ShowTitle){
this.PostMsg.ShowTitle=tempData.ShowTitle
}
if(tempData.HotWords){
this.PostMsg.HotWords=tempData.HotWords
}
if(tempData.SearchAreaIds){
this.PostMsg.SearchAreaIds=tempData.SearchAreaIds
}
if(tempData.ShowType){
this.PostMsg.ShowType=tempData.ShowType
}
if(tempData.TravelagencyList){
this.PostMsg.TravelagencyList=tempData.TravelagencyList
}
}
this.keyWordsArr=this.PostMsg.HotWords.split(',');
this.SearchAreaArr = this.PostMsg.SearchAreaIds.split(',');
} else {
this.Error(res.data.message);
}
},
err => {}
);
},
//获取地区
getAreaList() {
this.apipost(
"ws_get_GetRootArea", {},
res => {
if (res.data.resultCode == 1) {
console.log(res,'地区');
this.areaData = res.data.data;
} else {
this.Error(res.data.message);
}
},
err => {}
);
},
//关闭标签
closeTag(index) {
this.keyWordsArr.splice(index,1);
},
//多选
handleSelectionChange(val) {
// this.selectRow = JSON.parse(JSON.stringify(val));
},
//开放搜寻
UpdateAdIsSearch(item){
},
//设定区域
setArea(){
},
//返回地区
getArea(){
},
//批次设定区域
setAllArea(){
},
//新增关键字
addKeyWords(){
this.keyWordsArr.push(this.keywords);
this.keywords='';
}
}
}
......
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 to comment