Commit de359595 authored by zhengke's avatar zhengke

增加轮播图选择

parent 0f7f1bd1
<template>
<div>
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="NavName" label="名称">
</el-table-column>
<el-table-column prop="NavLink" label="导航链接">
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
dataList: [],
selectRow:[],
};
},
created() {},
methods: {
//获取所有菜单
getList() {
this.apipost("/api/Tenant/GetMallNavList", {}, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data
} else {
this.Info(res.data.message);
}
})
},
handleSelectionChange(val){
this.selectRow=JSON.parse(JSON.stringify(val));
},
//父组件调用方法
getChoicedLunbo(){
return this.selectRow;
},
//清空多选方法
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
},
mounted() {
this.getList();
}
};
</script>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="拉取轮播图"> <el-form-item label="拉取轮播图">
<el-button size="small" >选择</el-button> <el-button size="small" @click="isShowLunbo=true">选择</el-button>
</el-form-item> </el-form-item>
<el-form-item label="轮播图"> <el-form-item label="轮播图">
<div flex="dir:top"> <div flex="dir:top">
...@@ -211,11 +211,19 @@ ...@@ -211,11 +211,19 @@
<el-dialog title="选择文件" :visible.sync="choicImg" width="1240px"> <el-dialog title="选择文件" :visible.sync="choicImg" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg> <ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog> </el-dialog>
<!-- 选择轮播图 -->
<el-dialog title="选择文件" :visible.sync="isShowLunbo" width="900px">
<chooseLunbo ref="lunbo"></chooseLunbo>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="quxiaoLunbo()">取 消</el-button>
<el-button size="small" type="danger" @click="getChiceLunbo()">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import chooseMeun from "../../common/chooseMeun.vue"; import chooseMeun from "../../common/chooseMeun.vue";
import chooseLunbo from "../../common/chooseLunbo.vue";
import ChooseImg from "@/components/global/ChooseImg.vue"; import ChooseImg from "@/components/global/ChooseImg.vue";
export default { export default {
props: ["banData","index","dataLeng"], props: ["banData","index","dataLeng"],
...@@ -224,11 +232,14 @@ ...@@ -224,11 +232,14 @@
isShowLink:false, isShowLink:false,
choicImg:false, choicImg:false,
commonIndex:0, commonIndex:0,
//显示轮播图弹窗
isShowLunbo:false
}; };
}, },
components: { components: {
chooseMeun, chooseMeun,
ChooseImg ChooseImg,
chooseLunbo
}, },
created() { created() {
...@@ -277,6 +288,24 @@ ...@@ -277,6 +288,24 @@
delPlugin(){ delPlugin(){
this.$emit('comDelPlugin', this.index); this.$emit('comDelPlugin', this.index);
}, },
//取消选择
quxiaoLunbo(){
this.isShowLunbo=false;
this.$refs.lunbo.toggleSelection();
},
getChiceLunbo(){
var ckedArr=this.$refs.lunbo.getChoicedLunbo();
ckedArr.forEach(x => {
let obj={
picUrl:this.getIconLink(x.NavImg),
url:x.NavLink,
openType:''
}
this.banData.data.banners.push(obj);
});
this.isShowLunbo=false;
this.$refs.lunbo.toggleSelection();
}
}, },
mounted() { mounted() {
......
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