chore(seller): 清理死代码与失效机制,生产构建剥离 console

- 删除零引用组件 main-components/message-tip.vue
- 清理 113 处 no-unused-vars(重点 goodsOperationSec 20+ 项、ossManage 25 项,含死代码链级联删除;renovation 的 ModelForm 为 vue-eslint-parser 误报,保留并核实)
- stores/app.js 移除只写不读的死字段(currNavTitle/menuTheme/themeColor/isFullScreen/messageCount/currentPageName/currentPath)及失效的 cachePage/dontCache 缓存页机制(无 keep-alive 消费方),同步清理 util.js/App.vue/Main.vue/shrinkable-menu/tags-page-opened 的调用点
- 删除 30 处 console.log 调试残留;生产构建 terser 配置 drop_console 兜底
This commit is contained in:
lifenlong
2026-10-14 20:31:25 +08:00
parent 2a2c3f8174
commit 92dd179525
47 changed files with 20 additions and 1233 deletions

View File

@@ -347,7 +347,6 @@ const orderParam = reactive({
endDate: null,
});
const orderTotal = ref(0);
const refundTotal = ref(0);
const billStatusList = ref([
{ status: "OUT", value: "已出账", title: "生成账单" },
{ status: "CHECK", value: "已对账", title: "商家对账" },
@@ -471,9 +470,7 @@ function download() {
navigator.msSaveBlob(blob, "结算单-" + id.value + ".xlsx");
}
})
.catch((err) => {
console.log(err);
});
.catch((err) => {});
}
function init() {
id.value = route.query.id;

View File

@@ -91,7 +91,7 @@
</template>
<script setup>
import { ref, reactive, watch, onMounted, nextTick } from "vue";
import { ref, reactive, watch, onMounted } from "vue";
// 自定义指令:script setup 中以 vXxx 命名的顶层变量即注册为指令
import vChangeSize from "../directives/changeSize";
import vDragItem from "../directives/dragItem";
@@ -112,7 +112,6 @@ const tooSmall = ref(false);
const showModal = ref(false);
const picModelFlag = ref(false);
const currentIndex = ref(0);
const currentShowIndex = ref(-1);
const zoneForm = reactive({
img: "",
link: "",
@@ -158,15 +157,6 @@ function showModalFn(index) {
showModal.value = true;
currentIndex.value = index;
}
// 选择图片
function handleSelectImg() {
picModelFlag.value = true;
nextTick(() => {
if (ossManageRef.value) {
ossManageRef.value.selectImage = true;
}
});
}
// 选择图片回调
function callbackSelected(item) {
picModelFlag.value = false;
@@ -217,13 +207,9 @@ function settingZone(val) {
break;
}
}
function saveZone() {}
function cancelZone() {
showModal.value = false;
}
function delZone() {
delItem(currentIndex.value);
}
function delItem(index) {
emit("delItem", index);
}

View File

@@ -159,7 +159,6 @@ const picModelFlag = ref(false);
const showModal = ref(false);
const showModalNav = ref(false);
const selectedNav = ref(null);
const promotionTags = ref(["买2免1", "领200神券", "199减100", "母婴5折抢", "充100送20"]);
const topAdvert = ref({
type: "topAdvert",
img: "",
@@ -227,9 +226,7 @@ function handleAddNav() {
});
}
function handleMoveEnd({ newIndex, oldIndex }) {
console.log("index", newIndex, oldIndex);
}
function handleMoveEnd({ newIndex, oldIndex }) {}
function handleModel(type) {
if (type == "topAdvert") {

View File

@@ -194,9 +194,7 @@ const showModal = ref(false);
const picModelFlag = ref(false);
const selectedData = ref(""); //选中的数据
const goodsIndex = ref(0); // 商品索引
const align = ref("");
const defaultCallbackImageType = ref("");
const current = ref("");
const liliDialogRef = ref(null);
const ossManageRef = ref(null);
@@ -244,17 +242,13 @@ function selectedGoodsData(val) {
props.data.options.data.hot.list[goodsIndex.value].price = val[0].price;
props.data.options.data.hot.list[goodsIndex.value].url =
formatLinkType(val[0]);
console.log(val, selectedData.value, goodsIndex.value);
}
// 选择链接回调
function selectedLink(val) {
console.log(val, selectedData.value)
if (selectedData.value == "image") {
props.data.options.data.image.url =
formatLinkType(val);
} else {
console.log(props.data.options.data.list, goodsIndex.value)
props.data.options.data.list[
goodsIndex.value
].url = formatLinkType(val);

View File

@@ -142,7 +142,6 @@ const tabIndex = ref(0);
const current = ref(0);
const showModal = ref(false);
const selected = ref({}); // 已选数据
const picModelFlag = ref(false);
const tabCurrentlyIndex = ref(0); // 选项卡索引
onMounted(() => {
@@ -187,7 +186,6 @@ function delGoods(val) {
// 切换选项卡
function handleClickTab(name) {
console.log(name);
tabCurrentlyIndex.value = name;
}
@@ -199,7 +197,6 @@ function addCurrentGoods() {
// 编辑模块
function handleSelectModel(item) {
console.log(item);
selected.value = item;
showModal.value = true;
}
@@ -226,14 +223,6 @@ function selectedLink(val) {
selected.value[current.value].url = formatLinkType(val);
selected.value[current.value].type =
val.___type === "other" && val.url === "" ? "link" : "other";
console.log(selected.value[current.value]);
}
function handleSelectLink(index) {
// 调起选择链接弹窗
liliDialog.value.open("link");
current.value = index;
}
</script>

View File

@@ -218,10 +218,8 @@ function handleSelectLink(val, index) {
function callbackSelected(val) {
picModelFlag.value = false;
if (defaultCallbackImageType.value == "default") {
console.log(current.value.data.image);
current.value.data.image.src = val.url;
} else {
console.log(goodsIndex.value, props.data.options[align.value].data.list);
props.data.options[align.value].data.list[goodsIndex.value].img = val.url;
// props.data.options[align.value].data[selectedData.value][goodsIndex.value].url = val.img
@@ -229,7 +227,6 @@ function callbackSelected(val) {
}
// 选择商品回调
function selectedGoodsData(val) {
console.log(val);
nextTick(() => {
props.data.options[align.value].data.list[goodsIndex.value].img =
val[0].thumbnail;
@@ -240,14 +237,12 @@ function selectedGoodsData(val) {
props.data.options[align.value].data.list[goodsIndex.value].url =
val[0].url;
});
console.log(props.data.options[align.value].data.list[goodsIndex.value]);
proxy.$forceUpdate();
}
// 选择链接回调
function selectedLink(val) {
if (selectedData.value != "list") {
props.data.options[align.value].data[selectedData.value].url = formatLinkType(val);
console.log(props.data.options[align.value].data[selectedData.value])
}
if (selectedData.value == "list") {
props.data.options[align.value].data[selectedData.value][goodsIndex.value]
@@ -262,7 +257,6 @@ function selectedLink(val) {
function handleSelectModel(alignVal) {
align.value = alignVal;
current.value = props.data.options[alignVal];
console.log(props.data.options[alignVal]);
showModal.value = true;
}
</script>

View File

@@ -88,7 +88,6 @@ const ossManageRef = ref(null);
function callbackSelected(val) {
picModelFlag.value = false;
selected.value[current.value].img = val.url;
console.log(selected.value)
}
// 编辑模块
@@ -100,7 +99,6 @@ function handleSelectModel(item) {
// 选择商品回调
function selectedGoodsData(val) {
console.log(val);
let goods = val[0];
selected.value.img = goods.thumbnail;
selected.value.price = goods.price;

View File

@@ -89,12 +89,9 @@ const props = defineProps({
},
});
const flag = ref(false);
const tabIndex = ref(0);
const current = ref(0);
const showModal = ref(false);
const selected = ref({}); // 已选数据
const picModelFlag = ref(false);
const liliDialog = ref(null);
@@ -108,7 +105,6 @@ function addCurrentGoods() {
}
// 编辑模块
function handleSelectModel(item) {
console.log(item);
selected.value = item;
showModal.value = true;
}
@@ -132,13 +128,6 @@ function selectedLink(val) {
selected.value[current.value].url = formatLinkType(val);
selected.value[current.value].type =
val.___type === "other" && val.url === "" ? "link" : "other";
console.log(selected.value[current.value]);
}
function handleSelectLink(index) {
// 调起选择链接弹窗
liliDialog.value.open("link");
current.value = index;
}
</script>

View File

@@ -284,7 +284,6 @@ function selectedLink(val) {
}
// 选择商品回调
function selectedGoodsData(val) {
console.log(val);
let goods = val[0];
selected.value.img = goods.thumbnail;
selected.value.price = goods.price;

View File

@@ -155,9 +155,7 @@ function getTemplateItem(id) {
});
}
watch(modelForm, function (val) {
console.log(val);
}, { deep: true });
watch(modelForm, function (val) {}, { deep: true });
</script>
<style lang="scss" scoped>
.renovation {

View File

@@ -89,12 +89,6 @@ defineOptions({ name: "logistics" });
const row = ref({});
const openModal = ref(false);
const loading = ref(true);
const searchForm = ref({
pageNumber: 1,
pageSize: 10,
sort: "createTime",
order: "desc",
});
const openModalTitle = ref("开启信息");
const ruleValidate = ref({});
const faceSheetForm = ref({

View File

@@ -133,16 +133,10 @@ import { Message } from "@/utils/message";
defineOptions({ name: "shopSetting" });
const currentKey = ref(""); //存储当前点击地址的key
const showMap = ref(false); // 是否展示地图
const type = ref("INFO");
const storeName = ref(""); //店铺名称
const regionId = ref([]); // 地区id
// 历史遗留:loading、regionGoods、regionIdS 未在原 data 中声明,仅在方法内赋值,保持原行为
let loading = false;
let regionGoods = null;
let regionIdS = null;
const addressForm = ref({
// 退货地址
salesConsigneeName: "", // 收货人姓名
@@ -155,11 +149,6 @@ const addressForm = ref({
const udeskForm = ref({
merchantEuid: "",
});
const udeskFormValidate = {
merchantEuid: [
{ required: true, message: "请输入店铺坐席ID", trigger: "blur" },
],
};
const afterFormValidate = {
salesConsigneeMobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
@@ -261,7 +250,6 @@ const addressGoodsValidate = {
const formRef = ref(null);
const addressGoodsRef = ref(null);
const addressFormRef = ref(null);
const udeskFormRef = ref(null);
const mapRef = ref(null);
// 回调地址
@@ -315,8 +303,6 @@ function init() {
function setAddressGoods() {
console.log(addressGoodsRef.value)
addressGoodsRef.value.validate((valid) => {
if (valid) {
API_Shop.editDeliverAddress(addressGoods.value).then(res => {
@@ -329,9 +315,7 @@ function setAddressGoods() {
}
//获取店铺信息
function getShopInfo() {
loading = true;
API_Shop.getShopInfo().then((res) => {
loading = false;
if (res.success) {
form.value = res.result;
@@ -358,17 +342,11 @@ function getDeliverAddress() {
if (res.success) {
if (res.result != '' && res.result != null) {
addressGoods.value = res.result;
regionGoods = res.result.salesConsignorAddressPath;
regionIdS = res.result.salesConsignorAddressId;
}
}
})
}
//重置
function handleReset() {
formRef.value.resetFields();
}
//提交保存
function handleSubmit() {
formRef.value.validate((valid) => {
@@ -384,20 +362,6 @@ function handleSubmit() {
}
});
}
function merchantSubmit() {
udeskFormRef.value.validate((valid) => {
if (valid) {
submitLoading.value = true;
API_Shop.updatEmerchantId(udeskForm.value).then((res) => {
submitLoading.value = false;
if (res.success) {
Message.success("修改成功");
getShopInfo();
}
});
}
});
}
//tab切换
function handleClickType(v) {

View File

@@ -128,7 +128,6 @@ const loading = ref(true);
const maxHeight = ref("500px");
const strict = ref(true);
const userLoading = ref(false);
const loadingEdit = ref(false);
const modalVisible = ref(false);
const selectList = ref([]);
const selectCount = ref(0);
@@ -136,7 +135,6 @@ const showParent = ref(false);
const modalTitle = ref("");
const editTitle = ref("");
const selectedRole = ref([]);
const searchKey = ref("");
const currentNodeKey = ref(null);
const treeProps = {
label: "title",
@@ -165,7 +163,6 @@ const formValidate = {
};
const submitLoading = ref(false);
const data = ref([]);
const dataEdit = ref([]);
const users = ref([]);
function init() {
@@ -254,18 +251,6 @@ function cancelSelect() {
editTitle.value = "";
selectedRole.value = [];
}
function selectTreeEdit(v) {
if (v.length > 0) {
for (const attr in v[0]) {
if (v[0][attr] == null) {
v[0][attr] = "";
}
}
const data = JSON.parse(JSON.stringify(v[0]));
form.value.parentId = data.id;
form.value.parentTitle = data.title;
}
}
function cancelAdd() {
modalVisible.value = false;
}

View File

@@ -156,7 +156,6 @@ import {
addRole as addRoleReq,
editRole,
deleteRole,
loadDepartment,
selectRoleMenu,
saveRoleMenu,
} from "@/api/index";
@@ -178,15 +177,12 @@ const rolePermsWay = ref([]);
const openLevel = ref("0");
const loading = ref(true);
const treeLoading = ref(true);
const depTreeLoading = ref(true);
const submitPermLoading = ref(false);
const submitDepLoading = ref(false);
const sortColumn = ref("");
const sortType = ref("desc");
const modalType = ref(0);
const roleModalVisible = ref(false);
const permModalVisible = ref(false);
const depModalVisible = ref(false);
const modalTitle = ref("");
const roleForm = ref({
name: "",
@@ -204,10 +200,6 @@ const pageSize = ref(20);
const total = ref(0);
const permData = ref([]);
const editRolePermId = ref("");
const selectAllFlag = ref(false);
const depData = ref([]);
const dataType = ref(0);
const editDepartments = ref([]);
const saveRoleWay = ref([]);
const permTreeKey = ref(0);
const permCheckedKeys = ref([]);
@@ -474,24 +466,6 @@ function saveRole() {
}
});
}
function loadData(item, callback) {
loadDepartment(item.id, { openDataFilter: false }).then((res) => {
if (res.success) {
res.result.forEach(function (e) {
e.checked = false;
if (e.isParent) {
e.loading = false;
e.children = [];
}
if (e.status == -1) {
e.title = "[已禁用] " + e.title;
e.disabled = true;
}
});
callback(res.result);
}
});
}
function computeExpandedKeys(level) {
const keys = [];
const walk = (nodes, depth) => {

View File

@@ -530,7 +530,6 @@ import { CircleClose } from "@element-plus/icons-vue";
import { Message } from "@/utils/message";
import alignTextLeftImg from "@/assets/align-text-left.png";
import alignTextCenterImg from "@/assets/align-text-center.png";
import alignTextRightImg from "@/assets/align-text-right.png";
import ossManage from "@/views/sys/oss-manage/ossManage";
import { modelData } from "./config";
import hotzone from "@/views/shop/hotzone";
@@ -540,7 +539,7 @@ import categoryTemplate from "@/views/lili-dialog/template/category";
const props = defineProps(["res"]);
const emit = defineEmits(["handleDrawer"]);
// alignTextLeftImg/alignTextCenterImg/alignTextRightImg、ways(选择链接的类型)、modelData(装修数据) 为 import 常量,模板中直接使用
// alignTextLeftImg/alignTextCenterImg、ways(选择链接的类型)、modelData(装修数据) 为 import 常量,模板中直接使用
const picModelFlag = ref(false); //图片选择器
const linkType = ref("goods"); // dialog弹窗口类型
const styleFlag = ref(false); //广告魔方开关
@@ -548,10 +547,8 @@ const textAlign = ref(
props.res.options.list[0] ? props.res.options.list[0].textAlign : "center"
); //文字对齐方式
const promotionsFlag = ref(false); //广告魔方开关
const selectedLinkIndex = ref(""); //选择链接的索引
const selectedGoods = ref(""); // 已选商品
const selectedLinks = ref(""); // 已选链接
const modelList = ref(""); // 装修列表
const enableSelectCategory = ref(false); //商品是否绑定分类
const pendingCategory = ref(null); // 选择分类弹窗草稿
const goodsSelectedIndex = ref(0); //绑定商品分类的索引
@@ -601,8 +598,6 @@ function confirmCategory(val) {
}
);
props.res.options.list[0].titleWay[goodsSelectedIndex.value] = data;
console.log(props.res.options.list[0]);
}
// 商品排序
function slotGoods(list, key, val) {
@@ -639,7 +634,6 @@ function slotGoods(list, key, val) {
// 轮播图排序
function slotBanner(val, key, index, down) {
console.log(val);
if (down == "down") {
downData(val.options.list, index);
} else {
@@ -749,24 +743,9 @@ function clickLink(val, index, oval) {
liliDialogFlag(false);
}
}
function addZone(zoneInfo) {
selectedLinks.value.zoneInfo.push(zoneInfo);
}
function changeZone(zoneInfo) {
selectedLinks.value.zoneInfo = zoneInfo;
}
//点击图片解析成base64
function changeFile(item, index) {
const file = document.getElementById("files" + index).files[0];
if (file == void 0) return false;
const reader = new FileReader();
reader.readAsDataURL(file);
nextTick((res) => {
reader.onload = (e) => {
item.img = e.target.result;
};
});
}
//添加设置
function addDecorate(type, data) {
if (type === "notice") {
@@ -789,15 +768,6 @@ function addDecorate(type, data) {
props.res.options.list.push(way);
}
}
function addHotPoint() {
let way = {
img: "https://picsum.photos/id/264/200/200",
text: "标题",
link: "",
url: "",
};
props.res.options.list[0].points.push(way);
}
// 图片选择器回显
function callbackSelected(val) {
picModelFlag.value = false;

View File

@@ -91,14 +91,12 @@ const route = useRoute();
const appStore = useAppStore();
// templates: 模板类型,modelData: 装修模型,均为 import 常量,模板中直接使用
const qrcode = ref(""); // 二维码
const selected = ref(0); // 已选下标
const contentData = ref({
// 总数据
list: [],
});
const decorateData = ref(""); // 装修数据
const decoratePromotionsData = ref(""); // 装修数据
watch(
contentData,

View File

@@ -176,60 +176,10 @@ function updateHome() {
saveDialog.value = false;
Message.error("修改失败,请稍后重试");
}
console.log(res);
})
.catch(error => {});
}
// 更新
function update(submitWay) {
console.log(appStore.openStyleStore[0], "123123123");
if (appStore.openStyleStore == void 0) {
Message.error("请装修楼层!");
return false;
}
progress.value = false;
let id = route.query.id;
const pagetype = route.query.pagetype;
console.log(appStore.openStyleStore, submitWay);
const pageType = {
INDEX: "INDEX",
ALERT: "OPEN_SCREEN_PAGE",
OPEN_SCREEN_ANIMATION: "OPEN_SCREEN_ANIMATION",
}[pagetype ? pagetype : "INDEX"];
if (pagetype) {
submitWay.pageData = JSON.stringify(
appStore.openStyleStore[0]
);
submitWay.pageType = pageType;
id = appStore.openStoreId;
}
API_Other.updateHome(id, submitWay)
.then((res) => {
num.value = 50;
if (res.success) {
num.value = 80;
/**制作保存成功动画¸ */
setTimeout(() => {
saveDialog.value = false;
Message.success("修改成功");
goBack();
}, 1000);
} else {
saveDialog.value = false;
Message.error("修改失败,请稍后重试");
}
console.log(res);
})
.catch((error) => {});
}
// 返回查询数据页面
function goBack() {
router.go(-1);
@@ -254,7 +204,6 @@ function submit(submitWay) {
saveDialog.value = false;
Message.error("保存失败,请稍后重试");
}
console.log(res);
})
.catch(error => {});
}