Commit ed94b25b authored by zhengke's avatar zhengke

修改

parent c0a6e71b
......@@ -217,7 +217,7 @@
</template>
<el-button type="danger" size="small" @click="deletePlug(index)">刪除</el-button>
<span class="Movie_sj">上架</span>
<el-switch v-model="item.isShelves" :active-value="1" :inactive-value="0" active-color="#13ce66"
<el-switch v-model="item.isShelves" @change="getSearchCount(item)" :active-value="1" :inactive-value="0" active-color="#13ce66"
inactive-color="#dcdfe6"></el-switch>
</div>
</div>
......@@ -454,6 +454,34 @@
//数据改变
initData(tempData) {
this.dataList = tempData;
},
//遍历搜寻框只能上架一个
getSearchCount(item){
var isCount=0,isCount2=0;
this.dataList.forEach(x=>{
if(x.Id=='search_s'&&x.isShelves==1){
isCount++;
}
if(x.Id=='search_s'&&x.isShelves==0){
isCount--;
}
if(x.Id=='search_sf'&&x.isShelves==1){
isCount2++;
}
if(x.Id=='search_sf'&&x.isShelves==0){
isCount2--;
}
})
if(item.Id=='search_s'&&isCount>0){
this.Error('搜尋輪播橫已经存在了');
item.isShelves=0
}
if(item.Id=='search_sf'&&isCount2>0){
this.Error('搜尋輪播淡出已经存在了');
item.isShelves=0
}
this.$forceUpdate();
}
},
mounted() {
......
......@@ -122,7 +122,7 @@
<div class="webSliderDiv myWebDiv" @click="clickIndex=index">
<el-upload :http-request="UploadImage" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" action="">
<img v-if="item.ImageUrl" :src="item.ImageUrl" style="width:auto;" class="web_imgUrl" alt="" />
<img v-if="item.ImageUrl" :src="item.ImageUrl" class="web_imgUrl" alt="" />
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
......@@ -201,7 +201,7 @@
<div class="webSliderDiv webImg_radius" @click="clickIndex=index">
<el-upload :http-request="UploadImage" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" action="">
<img v-if="item.ImageUrl" :src="item.ImageUrl" style="width:auto;" class="web_imgUrl" alt="" />
<img v-if="item.ImageUrl" :src="item.ImageUrl" class="web_imgUrl" alt="" />
<div class="addIconDiv">
<i class="web_addImg iconfont icon-img_haha"></i>
<i class="web_delImg iconfont icon-img_delete_small" style="margin-left:10px;"
......
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