Files
lilishop-ui/manager/src/components/lili-dialog/link-dialog.vue
pikachu1995@126.com 8484936e3d refactor(axios): 优化HTTP请求拦截器和错误处理机制
- 移除调试用的console.log语句
- 调整表格列对齐方式,将操作列从居中改为右对齐
- 添加搜索表单功能,包括账单号、店铺名称、生成时间等筛选条件
- 重构axios拦截器逻辑,简化错误处理流程
- 实现统一的token刷新机制,使用单例模式避免重复请求
- 优化防抖函数实现,提高性能表现
- 添加401和403状态码的特殊处理逻辑
- 统一错误提示信息的显示方式
- 优化表格列宽度设置,调整金额相关列的显示效果
- 删除未使用的组件文件和样式代码
- 移除调试相关的代码和注释
- 优化图标组件的导入方式,使用markRaw包装
- 优化热词统计图表的数据显示逻辑,添加空数据提示
2026-10-08 14:39:12 +08:00

130 lines
3.0 KiB
Vue

<template>
<div class="wrapper">
<el-tabs v-model="activeTab" class="tabs">
<el-tab-pane
:label="item.title"
:name="item.title"
v-for="(item, i) in wap"
:key="i"
>
<component
ref="lili-component"
:is="templateWay[item.name]"
@selected="
(val) => {
changed = val;
}
"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import wap from "./wap.js";
import goodsDialog from "./goods-dialog";
import templateWay from "./template/index";
export default {
components: {
goodsDialog
},
setup() {
return { templateWay };
},
data() {
return {
changed: "", // 变更模板
selected: 0, // 已选数据
selectedLink: "", //选中的链接
wap, // tab标签
activeTab: wap[0]?.title || "",
};
},
watch: {
changed: {
handler(val) {
this.$emit("selectedLink", val[0]); //因为是单选,所以直接返回第一个
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$refs["lili-component"][0].type = "single"; //商品页面设置成为单选
});
let url = window.location.href
if(url.indexOf('/floorList/renovation') != -1){
//此处去重防止移动楼层多次点击push 太多数据
let obj = {};
this.wap = this.wap.reduce((cur, next) => {
//对象去重
if (next.title != undefined) {
obj[next.title]
? ""
: (obj[next.title] = true && cur.push(next));
}
return cur;
}, []);
if (this.$route.path !== '/floorList/main') {
this.wap.forEach((items, indexs) => {
if (items.title == '活动') {
this.wap.splice(indexs, 1)
}
})
}
}else{
this.wap.push( {
title: "活动",
url: "3",
name: "marketing"
})
let obj = {};
this.wap = this.wap.reduce((cur, next) => {
//对象去重
if (next.title != undefined) {
obj[next.title]
? ""
: (obj[next.title] = true && cur.push(next));
}
return cur;
}, []);
}
this.wap.forEach((item) => {
if (item) {
item.selected = false;
}
});
},
methods: {
// isVisible(item) {
// const type = this.$route.query.pagetype;
// if (type == "INDEX" && [ "discover"].includes(item.name)) {
// return false;
// }else if(type == "DISCOVER" && item.name == 'special'){
// return false;
// }else{
// return true
// }
// },
}
};
</script>
<style scoped lang="scss">
@import "./style.scss";
.wap-content-list {
display: flex;
flex-wrap: wrap;
}
.wap-flex {
margin: 2px;
}
.tabs {
width: 100%;
}
:deep(.el-tabs__content) {
height: 500px;
overflow: auto;
}
</style>