@@ -136,8 +136,8 @@ import {initData} from "@/api/bxg/data";
import singlePic from '@/components/singlematerial'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '热门榜单', url: 'bxg/api/yxStoreHotList', sort: 'id,desc', crudMethod: { ...crudYxStoreHotList }})
-const defaultForm = { id: null, listName: null, sort: 0, productList: null, isShow: 1,listImage:'',
- mouth:null,
+const defaultForm = { id: null, listName: null, isShow: 1,listImage:'',
+ mouth:null, sort: 0, productList:"[]",
createTime: null, updateTime: null, isDel: null, tenantId: Cookies.get('tenantId') }
export default {
name: 'YxStoreHotList',
@@ -173,107 +173,107 @@ export default {
// },
},
mounted () {
- this.getInfo();
+ // this.getInfo();
},
methods: {
cancel(){
this.productNameList=[]
},
- cascaderChange(val) {
- this.productList=[]
- this.productNameList=[];
- let productList=[];
- productList=this.getCascader(val,this.oldProductList,this.$refs.quitCascader.getCheckedNodes(true));
- this.productList = productList //回显的数据
- this.oldProductList=productList;
- // console.log('val',val,'element',productList,'Nodes',this.$refs.quitCascader.getCheckedNodes(true))
- this.form.productList=JSON.stringify(this.productList.map(item=>item[1]));
- },
- getCascader(newVal,oldVal,Nodes) {
- let productList = []
- // console.log('val',newVal,'element',oldVal,'Nodes',Nodes)
- //这次只选了一个,返回选择的
- if(newVal.length <= 1) {
- productList=newVal;
- //比上一次的减少了
- }else if(newVal.length < this.oldProductList.length) {
- let newValList=newVal.map(item=>item[1])
- let oldValList=oldVal.map(item=>item[1])
- let diff = newValList.concat(oldValList).filter((value, index, arr) => {
- return arr.indexOf(value) === arr.lastIndexOf(value)
- });
- oldVal.forEach((item,index)=> {
- diff.forEach(ele=>{
- if(item[1]==ele) {
- oldVal.splice(index,1)
- }
- })
- })
- productList=oldVal
- //新增
- }else {
- let newValList=newVal.map(item=>item[1])
- let oldValList=oldVal.map(item=>item[1])
- let diff = newValList.concat(oldValList).filter((value, index, arr) => {
- return arr.indexOf(value) === arr.lastIndexOf(value)
- });
- newVal.forEach((item)=> {
- diff.forEach(ele=>{
- if(item[1]==ele) {
- oldVal.push(item)
- }
- })
- });
- productList=oldVal
- }
- console.log('val',newVal,'productList',productList)
- let productNameList=[];
- productList.forEach(ele=>{
- Nodes.forEach(item=>{
- if (item.value==ele[1]){
- // productNameList=item.parent.label+'/'+item.label+productNameList;
- // console.log('item.parent.label+\'/\'+item.label',item.parent.label+'/'+item.label)
- productNameList.push(item.parent.label+'/'+item.label)
- }
- })
- })
- console.log('productList',productNameList)
- this.productNameList=productNameList;
- return productList;
- },
- change(val){
- console.log('选的子级',val)
- let productList=val.map(item=>item[1])
- this.form.productList=JSON.stringify(productList)
- console.log('选的子级',this.form.productList)
- },
- async getInfo(){
- //查询商品分类
- let that = this;
- await getInfo(0).then( res => {
- //商品分类
- that.cateList = res.cateList
- })
- for (const item of that.cateList) {
- await initData('/bxg/api/yxStoreProduct', {
- page: 0,
- size: 999,
- sort: 'id,desc',
- cateId:item.value,
- }).then(data=>{
- data.content.forEach(ele=>{
- //不能直接使用ele,会有浅拷贝问题
- // let ele1=JSON.parse(JSON.stringify(ele))
- // that.$set(ele,'value',ele1)
- that.$set(ele,'value',ele.id)
- that.$set(ele,'label',ele.storeName)
- }
- )
- that.$set(item,'children',data.content)
- })
- }
- console.log(that.cateList,'that.cateList')
- },
+ // cascaderChange(val) {
+ // this.productList=[]
+ // this.productNameList=[];
+ // let productList=[];
+ // productList=this.getCascader(val,this.oldProductList,this.$refs.quitCascader.getCheckedNodes(true));
+ // this.productList = productList //回显的数据
+ // this.oldProductList=productList;
+ // // console.log('val',val,'element',productList,'Nodes',this.$refs.quitCascader.getCheckedNodes(true))
+ // this.form.productList=JSON.stringify(this.productList.map(item=>item[1]));
+ // },
+ // getCascader(newVal,oldVal,Nodes) {
+ // let productList = []
+ // // console.log('val',newVal,'element',oldVal,'Nodes',Nodes)
+ // //这次只选了一个,返回选择的
+ // if(newVal.length <= 1) {
+ // productList=newVal;
+ // //比上一次的减少了
+ // }else if(newVal.length < this.oldProductList.length) {
+ // let newValList=newVal.map(item=>item[1])
+ // let oldValList=oldVal.map(item=>item[1])
+ // let diff = newValList.concat(oldValList).filter((value, index, arr) => {
+ // return arr.indexOf(value) === arr.lastIndexOf(value)
+ // });
+ // oldVal.forEach((item,index)=> {
+ // diff.forEach(ele=>{
+ // if(item[1]==ele) {
+ // oldVal.splice(index,1)
+ // }
+ // })
+ // })
+ // productList=oldVal
+ // //新增
+ // }else {
+ // let newValList=newVal.map(item=>item[1])
+ // let oldValList=oldVal.map(item=>item[1])
+ // let diff = newValList.concat(oldValList).filter((value, index, arr) => {
+ // return arr.indexOf(value) === arr.lastIndexOf(value)
+ // });
+ // newVal.forEach((item)=> {
+ // diff.forEach(ele=>{
+ // if(item[1]==ele) {
+ // oldVal.push(item)
+ // }
+ // })
+ // });
+ // productList=oldVal
+ // }
+ // console.log('val',newVal,'productList',productList)
+ // let productNameList=[];
+ // productList.forEach(ele=>{
+ // Nodes.forEach(item=>{
+ // if (item.value==ele[1]){
+ // // productNameList=item.parent.label+'/'+item.label+productNameList;
+ // // console.log('item.parent.label+\'/\'+item.label',item.parent.label+'/'+item.label)
+ // productNameList.push(item.parent.label+'/'+item.label)
+ // }
+ // })
+ // })
+ // console.log('productList',productNameList)
+ // this.productNameList=productNameList;
+ // return productList;
+ // },
+ // change(val){
+ // console.log('选的子级',val)
+ // let productList=val.map(item=>item[1])
+ // this.form.productList=JSON.stringify(productList)
+ // console.log('选的子级',this.form.productList)
+ // },
+ // async getInfo(){
+ // //查询商品分类
+ // let that = this;
+ // await getInfo(0).then( res => {
+ // //商品分类
+ // that.cateList = res.cateList
+ // })
+ // for (const item of that.cateList) {
+ // await initData('/bxg/api/yxStoreProduct', {
+ // page: 0,
+ // size: 999,
+ // sort: 'id,desc',
+ // cateId:item.value,
+ // }).then(data=>{
+ // data.content.forEach(ele=>{
+ // //不能直接使用ele,会有浅拷贝问题
+ // // let ele1=JSON.parse(JSON.stringify(ele))
+ // // that.$set(ele,'value',ele1)
+ // that.$set(ele,'value',ele.id)
+ // that.$set(ele,'label',ele.storeName)
+ // }
+ // )
+ // that.$set(item,'children',data.content)
+ // })
+ // }
+ // console.log(that.cateList,'that.cateList')
+ // },
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
return true
diff --git a/src/views/bxg/shop/yxStoreHotListRecord/index.vue b/src/views/bxg/shop/yxStoreHotListRecord/index.vue
new file mode 100644
index 0000000..9ebf06b
--- /dev/null
+++ b/src/views/bxg/shop/yxStoreHotListRecord/index.vue
@@ -0,0 +1,284 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 显示
+ 隐藏
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 显示
+ 隐藏
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+