mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-13 12:28:54 +08:00
Merge branch 'feat/appointment-goods' of https://gitee.com/beijing_hongye_huicheng/lilishop-ui into feat/appointment-goods
This commit is contained in:
@@ -22,7 +22,6 @@ onMounted(() => {
|
|||||||
util.bootstrapDynamicRoutesFromCache();
|
util.bootstrapDynamicRoutesFromCache();
|
||||||
util.initRouter();
|
util.initRouter();
|
||||||
appStore.setOpenedList();
|
appStore.setOpenedList();
|
||||||
appStore.initCachepage();
|
|
||||||
if (!localStorage.getItem("category")) {
|
if (!localStorage.getItem("category")) {
|
||||||
getCategoryTree()
|
getCategoryTree()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@@ -313,7 +313,6 @@ util.setCurrentPath = function (name) {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appStore.setCurrentPath(currentPathArr);
|
|
||||||
|
|
||||||
return currentPathArr;
|
return currentPathArr;
|
||||||
};
|
};
|
||||||
@@ -351,7 +350,6 @@ util.openNewPage = function (name, argu, query) {
|
|||||||
appStore.increateTag(tag);
|
appStore.increateTag(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appStore.setCurrentPageName(name);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
util.toDefaultPage = function (routers, name, route, next) {
|
util.toDefaultPage = function (routers, name, route, next) {
|
||||||
@@ -451,16 +449,8 @@ util.initMenuData = function (data) {
|
|||||||
}
|
}
|
||||||
appStore.setNavList(navList);
|
appStore.setNavList(navList);
|
||||||
let currNav = window.localStorage.getItem("currNav");
|
let currNav = window.localStorage.getItem("currNav");
|
||||||
if (currNav) {
|
if (!currNav) {
|
||||||
for (let item of navList) {
|
|
||||||
if (item.name == currNav) {
|
|
||||||
appStore.setCurrNavTitle(item.title);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currNav = HOME_NAV_NAME;
|
currNav = HOME_NAV_NAME;
|
||||||
appStore.setCurrNavTitle(HOME_NAV_ITEM.title);
|
|
||||||
}
|
}
|
||||||
appStore.setCurrNav(currNav);
|
appStore.setCurrNav(currNav);
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,8 @@ export const useAppStore = defineStore("app", {
|
|||||||
added: false,
|
added: false,
|
||||||
navList: [],
|
navList: [],
|
||||||
currNav: "",
|
currNav: "",
|
||||||
currNavTitle: "",
|
|
||||||
cachePage: [],
|
|
||||||
lang: "",
|
lang: "",
|
||||||
isFullScreen: false,
|
|
||||||
openedSubmenuArr: [],
|
openedSubmenuArr: [],
|
||||||
menuTheme: "dark",
|
|
||||||
themeColor: "",
|
|
||||||
storeOpenedList: [
|
storeOpenedList: [
|
||||||
{
|
{
|
||||||
title: "首页",
|
title: "首页",
|
||||||
@@ -27,19 +22,9 @@ export const useAppStore = defineStore("app", {
|
|||||||
name: "home_index",
|
name: "home_index",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
currentPageName: "",
|
|
||||||
currentPath: [
|
|
||||||
{
|
|
||||||
title: "首页",
|
|
||||||
path: "",
|
|
||||||
name: "home_index",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
menuList: [],
|
menuList: [],
|
||||||
routers: [otherRouter],
|
routers: [otherRouter],
|
||||||
tagsList: [...otherRouter.children],
|
tagsList: [...otherRouter.children],
|
||||||
messageCount: 0,
|
|
||||||
dontCache: ["test", "test"],
|
|
||||||
refMenu: "",
|
refMenu: "",
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
@@ -62,9 +47,6 @@ export const useAppStore = defineStore("app", {
|
|||||||
setCurrNav(v) {
|
setCurrNav(v) {
|
||||||
this.currNav = v;
|
this.currNav = v;
|
||||||
},
|
},
|
||||||
setCurrNavTitle(v) {
|
|
||||||
this.currNavTitle = v;
|
|
||||||
},
|
|
||||||
setTagsList(list) {
|
setTagsList(list) {
|
||||||
this.tagsList.push(...list);
|
this.tagsList.push(...list);
|
||||||
},
|
},
|
||||||
@@ -76,19 +58,6 @@ export const useAppStore = defineStore("app", {
|
|||||||
this.openedSubmenuArr.push(name);
|
this.openedSubmenuArr.push(name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closePage(name) {
|
|
||||||
this.cachePage.forEach((item, index) => {
|
|
||||||
if (item == name) {
|
|
||||||
this.cachePage.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
|
||||||
},
|
|
||||||
initCachepage() {
|
|
||||||
if (localStorage.cachePage) {
|
|
||||||
this.cachePage = JSON.parse(localStorage.cachePage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
removeTag(name) {
|
removeTag(name) {
|
||||||
this.storeOpenedList.map((item, index) => {
|
this.storeOpenedList.map((item, index) => {
|
||||||
if (item.name == name) {
|
if (item.name == name) {
|
||||||
@@ -105,8 +74,6 @@ export const useAppStore = defineStore("app", {
|
|||||||
},
|
},
|
||||||
clearAllTags() {
|
clearAllTags() {
|
||||||
this.storeOpenedList.splice(1);
|
this.storeOpenedList.splice(1);
|
||||||
this.cachePage.length = 0;
|
|
||||||
localStorage.cachePage = "";
|
|
||||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||||
},
|
},
|
||||||
clearOtherTags(currentName) {
|
clearOtherTags(currentName) {
|
||||||
@@ -122,8 +89,6 @@ export const useAppStore = defineStore("app", {
|
|||||||
this.storeOpenedList.splice(currentIndex + 1);
|
this.storeOpenedList.splice(currentIndex + 1);
|
||||||
this.storeOpenedList.splice(1, currentIndex - 1);
|
this.storeOpenedList.splice(1, currentIndex - 1);
|
||||||
}
|
}
|
||||||
this.cachePage = this.cachePage.filter((item) => item == currentName);
|
|
||||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
|
||||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||||
},
|
},
|
||||||
setOpenedList() {
|
setOpenedList() {
|
||||||
@@ -131,12 +96,6 @@ export const useAppStore = defineStore("app", {
|
|||||||
? JSON.parse(localStorage.storeOpenedList)
|
? JSON.parse(localStorage.storeOpenedList)
|
||||||
: [otherRouter.children[0]];
|
: [otherRouter.children[0]];
|
||||||
},
|
},
|
||||||
setCurrentPath(pathArr) {
|
|
||||||
this.currentPath = pathArr;
|
|
||||||
},
|
|
||||||
setCurrentPageName(name) {
|
|
||||||
this.currentPageName = name;
|
|
||||||
},
|
|
||||||
setAvatarPath(path) {
|
setAvatarPath(path) {
|
||||||
localStorage.avatorImgPath = path;
|
localStorage.avatorImgPath = path;
|
||||||
},
|
},
|
||||||
@@ -147,14 +106,7 @@ export const useAppStore = defineStore("app", {
|
|||||||
clearOpenedSubmenu() {
|
clearOpenedSubmenu() {
|
||||||
this.openedSubmenuArr.length = 0;
|
this.openedSubmenuArr.length = 0;
|
||||||
},
|
},
|
||||||
setMessageCount(count) {
|
|
||||||
this.messageCount = count;
|
|
||||||
},
|
|
||||||
increateTag(tagObj) {
|
increateTag(tagObj) {
|
||||||
if (this.dontCache.indexOf(tagObj.name) < 0) {
|
|
||||||
this.cachePage.push(tagObj.name);
|
|
||||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
|
||||||
}
|
|
||||||
this.storeOpenedList.push(tagObj);
|
this.storeOpenedList.push(tagObj);
|
||||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ import util from "@/libs/util.js";
|
|||||||
import { logout } from "@/api/index";
|
import { logout } from "@/api/index";
|
||||||
import { getIMDetail } from "@/api/common";
|
import { getIMDetail } from "@/api/common";
|
||||||
import { userMsg } from "@/api/index";
|
import { userMsg } from "@/api/index";
|
||||||
import config from "@/config/index.js";
|
|
||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
import { getStore, setStore } from "@/libs/storage";
|
import { getStore, setStore } from "@/libs/storage";
|
||||||
import { useAppStore } from "@/stores/app";
|
import { useAppStore } from "@/stores/app";
|
||||||
@@ -199,13 +198,11 @@ function resize() {
|
|||||||
watch(
|
watch(
|
||||||
() => route.name,
|
() => route.name,
|
||||||
(name) => {
|
(name) => {
|
||||||
appStore.setCurrentPageName(name);
|
|
||||||
const pathArr = util.setCurrentPath(name);
|
const pathArr = util.setCurrentPath(name);
|
||||||
if (pathArr.length > 2) {
|
if (pathArr.length > 2) {
|
||||||
appStore.addOpenSubmenu(pathArr[1].name);
|
appStore.addOpenSubmenu(pathArr[1].name);
|
||||||
}
|
}
|
||||||
checkTag(name);
|
checkTag(name);
|
||||||
localStorage.currentPageName = name;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ let editor = null;
|
|||||||
let polygon = null;
|
let polygon = null;
|
||||||
let suggestion = null;
|
let suggestion = null;
|
||||||
let TMap = null;
|
let TMap = null;
|
||||||
let geometryId = "";
|
|
||||||
let draftRing = [];
|
let draftRing = [];
|
||||||
let clickRing = [];
|
let clickRing = [];
|
||||||
let areas = [];
|
let areas = [];
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ async function exportStock() {
|
|||||||
navigator.msSaveBlob(blob, randomNumber + ".xlsx");
|
navigator.msSaveBlob(blob, randomNumber + ".xlsx");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => console.log(err));
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
function openImportStock() {
|
function openImportStock() {
|
||||||
importModal.value = true;
|
importModal.value = true;
|
||||||
|
|||||||
@@ -745,8 +745,6 @@ const loadingVideo = ref(false);
|
|||||||
const listImages = ref([]);
|
const listImages = ref([]);
|
||||||
const newSkuValues = ref([]);
|
const newSkuValues = ref([]);
|
||||||
const contentImage = ref("");
|
const contentImage = ref("");
|
||||||
const previewImage = ref(''); // 预览图片地址
|
|
||||||
const global = ref(0);
|
|
||||||
const accessToken = ref(""); //令牌token
|
const accessToken = ref(""); //令牌token
|
||||||
const goodsParams = ref([]);
|
const goodsParams = ref([]);
|
||||||
const categoryId = ref(""); // 商品分类第三级id
|
const categoryId = ref(""); // 商品分类第三级id
|
||||||
@@ -764,8 +762,6 @@ const previewGoodsPicture = ref("");
|
|||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
//展示商品图片
|
//展示商品图片
|
||||||
const goodsPictureVisible = ref(false);
|
const goodsPictureVisible = ref(false);
|
||||||
//展示sku图片
|
|
||||||
const showSkuPicture = ref(false);
|
|
||||||
//选择的sku
|
//选择的sku
|
||||||
const selectedSku = ref({});
|
const selectedSku = ref({});
|
||||||
|
|
||||||
@@ -809,47 +805,10 @@ const baseInfoForm = ref({
|
|||||||
// 原 Options API 中直接挂在 this 上的非响应式字段
|
// 原 Options API 中直接挂在 this 上的非响应式字段
|
||||||
let goodsId;
|
let goodsId;
|
||||||
let currentSkuItem = "";
|
let currentSkuItem = "";
|
||||||
let form;
|
|
||||||
let editTitle;
|
|
||||||
let selectCount;
|
|
||||||
let scrollParent = null;
|
let scrollParent = null;
|
||||||
let _onPublishScroll;
|
let _onPublishScroll;
|
||||||
let _scrollTick = false;
|
let _scrollTick = false;
|
||||||
let _scrollClickTimer;
|
let _scrollClickTimer;
|
||||||
let skuIndex;
|
|
||||||
|
|
||||||
const wholesalePreviewColumns = [
|
|
||||||
{
|
|
||||||
title: "销售规则",
|
|
||||||
width: 480,
|
|
||||||
render: (h, params) => {
|
|
||||||
let guide =
|
|
||||||
"当商品购买数量 ≥" +
|
|
||||||
params.row.num +
|
|
||||||
" 时,售价为 ¥" +
|
|
||||||
params.row.price +
|
|
||||||
" /" +
|
|
||||||
baseInfoForm.value.goodsUnit;
|
|
||||||
return h("div", guide);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const wholesaleColumns = [
|
|
||||||
{
|
|
||||||
title: "购买数量",
|
|
||||||
key: "num",
|
|
||||||
align: "center",
|
|
||||||
slot: "wholesaleNum",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "商品单价",
|
|
||||||
key: "price",
|
|
||||||
align: "center",
|
|
||||||
width: "280px",
|
|
||||||
slot: "wholesalePrice",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const wholesaleData = ref([
|
const wholesaleData = ref([
|
||||||
{
|
{
|
||||||
@@ -890,7 +849,6 @@ const params_panel = ref([]);
|
|||||||
/** 存储未通过校验的单元格位置 */
|
/** 存储未通过校验的单元格位置 */
|
||||||
const validateError = ref([]);
|
const validateError = ref([]);
|
||||||
const currentSkuVal = ref("");
|
const currentSkuVal = ref("");
|
||||||
const skuInfoRules = ref({});
|
|
||||||
/** 品牌列表 */
|
/** 品牌列表 */
|
||||||
const brandList = ref([]);
|
const brandList = ref([]);
|
||||||
/** 店铺分类列表 */
|
/** 店铺分类列表 */
|
||||||
@@ -1035,13 +993,6 @@ function changeSkuOpenImage() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ship大小不正确
|
|
||||||
function handleVideoMaxSize(file) {
|
|
||||||
Notice.warning({
|
|
||||||
title: "超过文件大小限制",
|
|
||||||
desc: "视频大小不能超过10MB",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function parseOssSelectionUrl(item) {
|
function parseOssSelectionUrl(item) {
|
||||||
if (!item) return "";
|
if (!item) return "";
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
@@ -1108,22 +1059,6 @@ function refresh(v) {
|
|||||||
getGoodsBrandList('localRefresh');
|
getGoodsBrandList('localRefresh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getImages(v) {
|
|
||||||
previewImage.value = v;
|
|
||||||
visible.value = true;
|
|
||||||
}
|
|
||||||
function mouseOver(v) {
|
|
||||||
showContent.value = true
|
|
||||||
listImages.value = v
|
|
||||||
if (listImages.value.images.length <= 0) {
|
|
||||||
contentImage.value = '规格专属图片暂无'
|
|
||||||
} else {
|
|
||||||
contentImage.value = '当前规格专属图片'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function mouseLeave() {
|
|
||||||
// showContent.value = false
|
|
||||||
}
|
|
||||||
function getParamOptions(options) {
|
function getParamOptions(options) {
|
||||||
if (!options) return [];
|
if (!options) return [];
|
||||||
return String(options)
|
return String(options)
|
||||||
@@ -1179,15 +1114,6 @@ function selectParams(params, value, paramsIndex) {
|
|||||||
// 同步更新表单项的值
|
// 同步更新表单项的值
|
||||||
params.paramValue = value;
|
params.paramValue = value;
|
||||||
}
|
}
|
||||||
// 编辑sku图片
|
|
||||||
function editSkuPicture(row) {
|
|
||||||
showContent.value = false
|
|
||||||
if (row.images && row.images.length > 0) {
|
|
||||||
previewPicture.value = row.images[0];
|
|
||||||
}
|
|
||||||
selectedSku.value = row;
|
|
||||||
showSkuPicture.value = true;
|
|
||||||
}
|
|
||||||
// 初始化视频操作
|
// 初始化视频操作
|
||||||
async function initVideo() {
|
async function initVideo() {
|
||||||
if (baseInfoForm.value.goodsVideo) {
|
if (baseInfoForm.value.goodsVideo) {
|
||||||
@@ -1349,17 +1275,6 @@ function assignSkuTableIndex() {
|
|||||||
row._index = index;
|
row._index = index;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 更新sku图片
|
|
||||||
function updateSkuPicture() {
|
|
||||||
baseInfoForm.value.regeneratorSkuFlag = true;
|
|
||||||
let _index = selectedSku.value._index;
|
|
||||||
if (_index === undefined || _index === null) {
|
|
||||||
_index = skuTableData.value.indexOf(selectedSku.value);
|
|
||||||
}
|
|
||||||
if (_index >= 0) {
|
|
||||||
skuTableData.value[_index] = selectedSku.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// sku图片上传成功
|
// sku图片上传成功
|
||||||
function handleSuccess(res, file, images) {
|
function handleSuccess(res, file, images) {
|
||||||
if (file.response) {
|
if (file.response) {
|
||||||
@@ -1460,20 +1375,6 @@ function checkWholesalePrice(index) {
|
|||||||
renderTableData(skuTableData.value);
|
renderTableData(skuTableData.value);
|
||||||
syncWholesalePriceToSku();
|
syncWholesalePriceToSku();
|
||||||
}
|
}
|
||||||
// 商品图片上传成功
|
|
||||||
function handleSuccessGoodsPicture(res, file) {
|
|
||||||
if (file.response) {
|
|
||||||
file.url = file.response.result;
|
|
||||||
baseInfoForm.value.goodsGalleryFiles.push(file.url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 图片格式不正确
|
|
||||||
function handleFormatError(file) {
|
|
||||||
Notice.warning({
|
|
||||||
title: "文件格式不正确",
|
|
||||||
desc: "文件 " + file.name + " 的格式不正确",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function beforeVideoUpload(file) {
|
function beforeVideoUpload(file) {
|
||||||
const allowTypes = ["avi", "wmv", "mpeg", "mp4", "mov"];
|
const allowTypes = ["avi", "wmv", "mpeg", "mp4", "mov"];
|
||||||
const ext = (file.name.split(".").pop() || "").toLowerCase();
|
const ext = (file.name.split(".").pop() || "").toLowerCase();
|
||||||
@@ -1510,16 +1411,6 @@ function handleMaxSize(size = 2) {
|
|||||||
desc: `图片大小不能超过${size}MB`,
|
desc: `图片大小不能超过${size}MB`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 图片上传前钩子
|
|
||||||
function handleBeforeUploadGoodsPicture(file) {
|
|
||||||
const check = baseInfoForm.value.goodsGalleryFiles.length < 5;
|
|
||||||
if (!check) {
|
|
||||||
Notice.warning({
|
|
||||||
title: "图片数量不能大于五张",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// sku图片上传前钩子
|
// sku图片上传前钩子
|
||||||
function handleBeforeUpload(file) {
|
function handleBeforeUpload(file) {
|
||||||
const check =
|
const check =
|
||||||
@@ -2189,11 +2080,6 @@ function addSpec($index, item) {
|
|||||||
skuInfoCopy.value = cloneObj(skuInfo.value);
|
skuInfoCopy.value = cloneObj(skuInfo.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleClearSku() {
|
|
||||||
skuInfo.value = [];
|
|
||||||
skuTableData.value = [];
|
|
||||||
renderTableData(skuTableData.value);
|
|
||||||
}
|
|
||||||
/** 移除当前规格值 */
|
/** 移除当前规格值 */
|
||||||
function handleCloseSkuValue(item, index, spec) {
|
function handleCloseSkuValue(item, index, spec) {
|
||||||
if (spec.spec_values.length <= 1) {
|
if (spec.spec_values.length <= 1) {
|
||||||
@@ -2363,55 +2249,6 @@ function renderTableData(skus) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 迭代属性,形成表格
|
|
||||||
* result 渲染的数据
|
|
||||||
* array spec数据
|
|
||||||
*/
|
|
||||||
function specIterator(result, spec, skus) {
|
|
||||||
let table = result;
|
|
||||||
if (spec.length > 0) {
|
|
||||||
//清除当前循环的分组
|
|
||||||
let cloneTemp = cloneObj(spec);
|
|
||||||
cloneTemp.shift();
|
|
||||||
spec[0].spec_values.forEach((specItem) => {
|
|
||||||
let index = skuIndex;
|
|
||||||
if (table[index]) {
|
|
||||||
table[index][spec[0].name] = specItem.value;
|
|
||||||
} else if (skus && skus[index] && specItem.value !== "") {
|
|
||||||
let obj = {
|
|
||||||
...skus[index],
|
|
||||||
id: skus[index].id,
|
|
||||||
sn: skus[index].sn,
|
|
||||||
quantity: skus[index].quantity,
|
|
||||||
cost: skus[index].cost,
|
|
||||||
price: skus[index].price,
|
|
||||||
// [spec[0].name]: skus[index][spec[0].name] ? skus[index][spec[0].name] : specItem.value,
|
|
||||||
[spec[0].name]: specItem.value,
|
|
||||||
images:
|
|
||||||
skus[index].images || baseInfoForm.value.goodsGalleryFiles || [],
|
|
||||||
};
|
|
||||||
if (specItem.value !== "") {
|
|
||||||
obj.id = skus[index].id;
|
|
||||||
}
|
|
||||||
if (skus[index].weight !== "") {
|
|
||||||
obj.weight = skus[index].weight;
|
|
||||||
}
|
|
||||||
table.push(obj);
|
|
||||||
} else if (specItem.value !== "") {
|
|
||||||
table.push({
|
|
||||||
[spec[0].name]: specItem.value,
|
|
||||||
images: baseInfoForm.value.goodsGalleryFiles || [],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
table = specIterator(table, cloneTemp, skus, index);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
skuIndex++;
|
|
||||||
}
|
|
||||||
return table;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 生成所有可能的规格组合
|
* 生成所有可能的规格组合
|
||||||
* @param {Array} skuInfo 规格信息
|
* @param {Array} skuInfo 规格信息
|
||||||
@@ -2469,19 +2306,6 @@ function generateSkuCombinations(skuInfo) {
|
|||||||
return generateCombinations(0, []);
|
return generateCombinations(0, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断相同数组的值
|
|
||||||
function scalarArrayEquals(array1, array2) {
|
|
||||||
return (
|
|
||||||
array1.length === array2.length &&
|
|
||||||
array1.every(function (v, i) {
|
|
||||||
return v === array2[i];
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/** 自动完成表单所需方法*/
|
|
||||||
function filterMethod(value, option) {
|
|
||||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
|
||||||
}
|
|
||||||
/** 数据改变之后 抛出数据 */
|
/** 数据改变之后 抛出数据 */
|
||||||
function updateSkuTable(row, item, rowIndex) {
|
function updateSkuTable(row, item, rowIndex) {
|
||||||
let index = rowIndex;
|
let index = rowIndex;
|
||||||
@@ -2535,15 +2359,10 @@ function selectTree(v) {
|
|||||||
v[0][attr] = "";
|
v[0][attr] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let str = JSON.stringify(v[0]);
|
|
||||||
let menu = JSON.parse(str);
|
|
||||||
form = menu;
|
|
||||||
editTitle = menu.title;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 店内分类选中
|
// 店内分类选中
|
||||||
function changeSelect(v) {
|
function changeSelect(v) {
|
||||||
selectCount = v.length;
|
|
||||||
let ids = "";
|
let ids = "";
|
||||||
v.forEach(function (e) {
|
v.forEach(function (e) {
|
||||||
ids += e.id + ",";
|
ids += e.id + ",";
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ const pendingContent = ref(null); // 编辑器未就绪时暂存待回填内容
|
|||||||
const tinymceId =
|
const tinymceId =
|
||||||
"tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + ""); // 生成唯一的编辑器 ID
|
"tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + ""); // 生成唯一的编辑器 ID
|
||||||
const fullscreen = ref(false); // 标记编辑器是否处于全屏模式
|
const fullscreen = ref(false); // 标记编辑器是否处于全屏模式
|
||||||
const toolbar = ref([]); // 工具栏配置
|
|
||||||
const content = ref(""); // 编辑器内容
|
|
||||||
|
|
||||||
const bindValue = computed(() => {
|
const bindValue = computed(() => {
|
||||||
return props.modelValue ?? props.value ?? "";
|
return props.modelValue ?? props.value ?? "";
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ const switched = ref(false);
|
|||||||
const spinShow = ref(false);
|
const spinShow = ref(false);
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const selectedWay = ref([]);
|
const selectedWay = ref([]);
|
||||||
const callBackData = ref("");
|
|
||||||
const treeProps = reactive({
|
const treeProps = reactive({
|
||||||
label: "title",
|
label: "title",
|
||||||
children: "children",
|
children: "children",
|
||||||
|
|||||||
@@ -122,10 +122,6 @@ function open(type, mutiple) {
|
|||||||
linkVisible.value = true;
|
linkVisible.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function close() {
|
|
||||||
clickClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 外部通过 ref 访问的成员(grep seller/src 全量确认):
|
// 外部通过 ref 访问的成员(grep seller/src 全量确认):
|
||||||
// - open:所有调用方打开弹窗(goods/link)
|
// - open:所有调用方打开弹窗(goods/link)
|
||||||
// - singleGoods:shop/modelList/forYour.vue、mixModel.vue 直接调用
|
// - singleGoods:shop/modelList/forYour.vue、mixModel.vue 直接调用
|
||||||
|
|||||||
@@ -23,14 +23,11 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, onMounted, ref, watch } from "vue";
|
import { nextTick, onMounted, ref, watch } from "vue";
|
||||||
import wapList from "./wap.js";
|
import wapList from "./wap.js";
|
||||||
import goodsDialog from "./goods-dialog";
|
|
||||||
import templateWay from "./template/index";
|
import templateWay from "./template/index";
|
||||||
|
|
||||||
const emit = defineEmits(["selectedLink"]);
|
const emit = defineEmits(["selectedLink"]);
|
||||||
|
|
||||||
const changed = ref("");
|
const changed = ref("");
|
||||||
const selected = ref(0);
|
|
||||||
const selectedLink = ref("");
|
|
||||||
// wap 为共享的模块级数组,保持原 data 引用同一数组的行为
|
// wap 为共享的模块级数组,保持原 data 引用同一数组的行为
|
||||||
const wap = ref(wapList);
|
const wap = ref(wapList);
|
||||||
const activeTab = ref(wapList[0]?.title || "");
|
const activeTab = ref(wapList[0]?.title || "");
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ const thirdIndex = ref(''); // 分类三级下标
|
|||||||
const categoryList = ref([]); // 分类列表一级数据
|
const categoryList = ref([]); // 分类列表一级数据
|
||||||
const secondLevel = ref([]); // 分类列表二级数据
|
const secondLevel = ref([]); // 分类列表二级数据
|
||||||
const thirdLevel = ref([]); // 分类列表三级数据
|
const thirdLevel = ref([]); // 分类列表三级数据
|
||||||
const selectedData = ref(""); // 已选分类数据
|
|
||||||
|
|
||||||
function loadCategoryFromCache() {
|
function loadCategoryFromCache() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -14,18 +14,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
// import Article from "@/views/page/article-manage/articleList.vue";
|
// import Article from "@/views/page/article-manage/articleList.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["selected"]);
|
|
||||||
|
|
||||||
// 无 defineExpose:grep seller/src 全量确认无外部 ref/$refs/$parent 访问本组件成员
|
|
||||||
// (link-dialog.vue 的 $refs["lili-component"][0].type 写入指向首个 tab 的 goods-dialog,与本组件无关)
|
|
||||||
function callbackArticle(val) {
|
|
||||||
val.___type = "pages";
|
|
||||||
|
|
||||||
val.___path = "/pages/passport/article";
|
|
||||||
|
|
||||||
emit("selected", [val]);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.el-card__body) {
|
:deep(.el-card__body) {
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div @click="showMessage" class="message-con">
|
|
||||||
<el-tooltip
|
|
||||||
:visible="value > 0 ? undefined : false"
|
|
||||||
:content="value > 0 ? '有' + value + message : '无未读消息'"
|
|
||||||
placement="bottom"
|
|
||||||
>
|
|
||||||
<el-badge :value="value" :hidden="value <= 0" is-dot>
|
|
||||||
<el-icon :size="22"><Bell /></el-icon>
|
|
||||||
</el-badge>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { Bell } from "@element-plus/icons-vue";
|
|
||||||
import util from "@/libs/util.js";
|
|
||||||
|
|
||||||
defineOptions({ name: "messageTip" });
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
value: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
message: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
function showMessage() {
|
|
||||||
util.openNewPage("message_index");
|
|
||||||
router.push({
|
|
||||||
name: "message_index",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, watch, onMounted } from "vue";
|
import { computed, ref, watch, onMounted } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import util, { HOME_NAV_NAME, HOME_NAV_ITEM } from "@/libs/util.js";
|
import util, { HOME_NAV_NAME } from "@/libs/util.js";
|
||||||
import { setStore } from "@/libs/storage";
|
import { setStore } from "@/libs/storage";
|
||||||
import { useAppStore } from "@/stores/app";
|
import { useAppStore } from "@/stores/app";
|
||||||
|
|
||||||
@@ -76,7 +76,6 @@ function syncRouteMenu(route) {
|
|||||||
|
|
||||||
function activateHomeNav() {
|
function activateHomeNav() {
|
||||||
appStore.setCurrNav(HOME_NAV_NAME);
|
appStore.setCurrNav(HOME_NAV_NAME);
|
||||||
appStore.setCurrNavTitle(HOME_NAV_ITEM.title);
|
|
||||||
setStore("currNav", HOME_NAV_NAME);
|
setStore("currNav", HOME_NAV_NAME);
|
||||||
appStore.updateMenulist([]);
|
appStore.updateMenulist([]);
|
||||||
}
|
}
|
||||||
@@ -92,7 +91,6 @@ function selectNav(name) {
|
|||||||
setStore("currNav", name);
|
setStore("currNav", name);
|
||||||
if (name === HOME_NAV_NAME) {
|
if (name === HOME_NAV_NAME) {
|
||||||
appStore.updateMenulist([]);
|
appStore.updateMenulist([]);
|
||||||
appStore.setCurrNavTitle(HOME_NAV_ITEM.title);
|
|
||||||
if (route.name !== "home_index") {
|
if (route.name !== "home_index") {
|
||||||
router.push({ name: "home_index" });
|
router.push({ name: "home_index" });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onBeforeUnmount } from "vue";
|
import { ref, watch, onBeforeUnmount } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useAppStore } from "@/stores/app";
|
import { useAppStore } from "@/stores/app";
|
||||||
|
|
||||||
@@ -73,8 +73,6 @@ const actionList = {
|
|||||||
const scrollCon = ref(null);
|
const scrollCon = ref(null);
|
||||||
const scrollBody = ref(null);
|
const scrollBody = ref(null);
|
||||||
|
|
||||||
const tagsList = computed(() => appStore.storeOpenedList);
|
|
||||||
|
|
||||||
const isActive = (item) => {
|
const isActive = (item) => {
|
||||||
return item.children
|
return item.children
|
||||||
? item.children[0].name === currentPageName.value
|
? item.children[0].name === currentPageName.value
|
||||||
@@ -109,7 +107,6 @@ const closePage = (event, name) => {
|
|||||||
tagBodyLeft.value = Math.min(tagBodyLeft.value + tagWidth, 0);
|
tagBodyLeft.value = Math.min(tagBodyLeft.value + tagWidth, 0);
|
||||||
}
|
}
|
||||||
appStore.removeTag(name);
|
appStore.removeTag(name);
|
||||||
appStore.closePage(name);
|
|
||||||
storeOpenedList = appStore.storeOpenedList;
|
storeOpenedList = appStore.storeOpenedList;
|
||||||
localStorage.storeOpenedList = JSON.stringify(storeOpenedList);
|
localStorage.storeOpenedList = JSON.stringify(storeOpenedList);
|
||||||
if (currentPageName.value === name) {
|
if (currentPageName.value === name) {
|
||||||
|
|||||||
@@ -72,7 +72,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref, useAttrs, watch } from "vue";
|
import { nextTick, ref, useAttrs, watch } from "vue";
|
||||||
import { View } from "@element-plus/icons-vue";
|
import { View } from "@element-plus/icons-vue";
|
||||||
import { uploadFile } from "@/libs/axios";
|
|
||||||
import { getStore } from "@/libs/storage";
|
import { getStore } from "@/libs/storage";
|
||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||||
@@ -110,7 +109,6 @@ const attrs = useAttrs();
|
|||||||
const accessToken = ref({});
|
const accessToken = ref({});
|
||||||
const currentValue = ref(props.modelValue ?? props.value ?? "");
|
const currentValue = ref(props.modelValue ?? props.value ?? "");
|
||||||
const viewImage = ref(false);
|
const viewImage = ref(false);
|
||||||
const uploadFileUrl = ref(uploadFile);
|
|
||||||
const picModalFlag = ref(false);
|
const picModalFlag = ref(false);
|
||||||
const selectedFormBtnName = ref("");
|
const selectedFormBtnName = ref("");
|
||||||
const picIndex = ref("");
|
const picIndex = ref("");
|
||||||
|
|||||||
@@ -84,7 +84,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
||||||
import { Camera, Delete, View } from "@element-plus/icons-vue";
|
import { Camera, Delete, View } from "@element-plus/icons-vue";
|
||||||
import { uploadFile } from "@/libs/axios";
|
|
||||||
import { getStore } from "@/libs/storage";
|
import { getStore } from "@/libs/storage";
|
||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
import vuedraggable from "vuedraggable";
|
import vuedraggable from "vuedraggable";
|
||||||
@@ -123,7 +122,6 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(["update:modelValue", "input", "on-change", "uploadchange"]);
|
const emit = defineEmits(["update:modelValue", "input", "on-change", "uploadchange"]);
|
||||||
|
|
||||||
const accessToken = ref({});
|
const accessToken = ref({});
|
||||||
const uploadFileUrl = uploadFile;
|
|
||||||
const uploadList = ref([]);
|
const uploadList = ref([]);
|
||||||
const viewImage = ref(false);
|
const viewImage = ref(false);
|
||||||
const imgUrl = ref("");
|
const imgUrl = ref("");
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ defineOptions({ name: "map" });
|
|||||||
|
|
||||||
const emit = defineEmits(["getAddress"]);
|
const emit = defineEmits(["getAddress"]);
|
||||||
|
|
||||||
const showMap = ref(false);
|
|
||||||
const mapSearch = ref("");
|
const mapSearch = ref("");
|
||||||
const map = ref(null);
|
const map = ref(null);
|
||||||
const autoComplete = ref(null);
|
const autoComplete = ref(null);
|
||||||
|
|||||||
@@ -367,8 +367,6 @@ const afterSaleImage = ref([]); //会员申诉图片
|
|||||||
const submitLoading = ref(false); // 添加或编辑提交状态
|
const submitLoading = ref(false); // 添加或编辑提交状态
|
||||||
const confirmLoading = ref(false); // 确认收货提交状态
|
const confirmLoading = ref(false); // 确认收货提交状态
|
||||||
const storeMsg = ref({}); // 商家地址信息
|
const storeMsg = ref({}); // 商家地址信息
|
||||||
// 原代码未在 data 声明、直接挂 this 上的字段,补声明避免 ReferenceError
|
|
||||||
let loading = false;
|
|
||||||
//商家处理意见
|
//商家处理意见
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
serviceStatus: "PASS",
|
serviceStatus: "PASS",
|
||||||
@@ -480,9 +478,7 @@ const canConfirmReceipt = computed(() => {
|
|||||||
|
|
||||||
// 获取售后详情
|
// 获取售后详情
|
||||||
function getDetail() {
|
function getDetail() {
|
||||||
loading = true;
|
|
||||||
API_Order.getAfterSaleOrderDetail(sn.value).then((res) => {
|
API_Order.getAfterSaleOrderDetail(sn.value).then((res) => {
|
||||||
loading = false;
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
afterSaleInfo.value = res.result;
|
afterSaleInfo.value = res.result;
|
||||||
afterSaleInfo.value.showDelivery = showDelivery(
|
afterSaleInfo.value.showDelivery = showDelivery(
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ function downLoad() {
|
|||||||
navigator.msSaveBlob(blob, "批量发货导入模板.xls");
|
navigator.msSaveBlob(blob, "批量发货导入模板.xls");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -887,7 +887,6 @@ import { formatCardKeyStatus } from "@/constants/cardKey";
|
|||||||
import {
|
import {
|
||||||
collectCardKeyFulfillLines,
|
collectCardKeyFulfillLines,
|
||||||
orderHasCardKeySection,
|
orderHasCardKeySection,
|
||||||
flattenOrderCardKeys,
|
|
||||||
cardKeyFulfillAlertType,
|
cardKeyFulfillAlertType,
|
||||||
resolveCardKeyFulfillMessage,
|
resolveCardKeyFulfillMessage,
|
||||||
} from "@/constants/goodsType";
|
} from "@/constants/goodsType";
|
||||||
@@ -1094,9 +1093,6 @@ const hasCardKeySection = computed(() => {
|
|||||||
const cardKeyFulfillLines = computed(() => {
|
const cardKeyFulfillLines = computed(() => {
|
||||||
return collectCardKeyFulfillLines(data.value);
|
return collectCardKeyFulfillLines(data.value);
|
||||||
});
|
});
|
||||||
const ecouponCardKeyRows = computed(() => {
|
|
||||||
return flattenOrderCardKeys(data.value, true);
|
|
||||||
});
|
|
||||||
const canShip = computed(() => {
|
const canShip = computed(() => {
|
||||||
return canShowShipButton(allowOperation.value, orderInfo.value?.order);
|
return canShowShipButton(allowOperation.value, orderInfo.value?.order);
|
||||||
});
|
});
|
||||||
@@ -1180,9 +1176,6 @@ function getPromotionText(row) {
|
|||||||
}
|
}
|
||||||
return resultText === "" ? "未参与" : resultText;
|
return resultText === "" ? "未参与" : resultText;
|
||||||
}
|
}
|
||||||
function gotoHomes () {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
function getOrderItemId(item) {
|
function getOrderItemId(item) {
|
||||||
return item && (item.id || item.orderItemId || item.sn);
|
return item && (item.id || item.orderItemId || item.sn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,28 +169,6 @@ defineOptions({ name: "orderList" });
|
|||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const fields = ref({
|
|
||||||
订单编号: "sn",
|
|
||||||
下单时间: "createTime",
|
|
||||||
客户名称: "memberName",
|
|
||||||
支付方式: {
|
|
||||||
field: "clientType",
|
|
||||||
callback: (value) => {
|
|
||||||
if (value == "H5") return "移动端";
|
|
||||||
if (value == "PC") return "PC端";
|
|
||||||
if (value == "WECHAT_MP") return "小程序端";
|
|
||||||
if (value == "APP") return "移动应用端";
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
商品数量: "groupNum",
|
|
||||||
付款状态: {
|
|
||||||
field: "payStatus",
|
|
||||||
callback: (value) =>
|
|
||||||
value == "UNPAID" ? "未付款" : value == "PAID" ? "已付款" : "",
|
|
||||||
},
|
|
||||||
店铺: "storeName",
|
|
||||||
});
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -318,16 +296,6 @@ function orderPromotionText(v) {
|
|||||||
};
|
};
|
||||||
return map[v] || v || "-";
|
return map[v] || v || "-";
|
||||||
}
|
}
|
||||||
function orderPromotionTagType(v) {
|
|
||||||
const map = {
|
|
||||||
NORMAL: "primary",
|
|
||||||
PINTUAN: "danger",
|
|
||||||
GIFT: "success",
|
|
||||||
POINTS: "info",
|
|
||||||
KANJIA: "warning",
|
|
||||||
};
|
|
||||||
return map[v] || "info";
|
|
||||||
}
|
|
||||||
function paymentMethodText(v) {
|
function paymentMethodText(v) {
|
||||||
const map = {
|
const map = {
|
||||||
NOT_ACTUALLY_PAID: "-",
|
NOT_ACTUALLY_PAID: "-",
|
||||||
@@ -449,9 +417,7 @@ async function exportOrder() {
|
|||||||
navigator.msSaveBlob(blob, "订单列表.xlsx");
|
navigator.msSaveBlob(blob, "订单列表.xlsx");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function orderStatusClick(name) {
|
function orderStatusClick(name) {
|
||||||
if (name === "ALL" || name === "" || name === undefined) {
|
if (name === "ALL" || name === "" || name === undefined) {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ import { useAppStore } from "@/stores/app";
|
|||||||
|
|
||||||
defineOptions({ name: "coupon-recevie" });
|
defineOptions({ name: "coupon-recevie" });
|
||||||
|
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
promotionStatus: {
|
promotionStatus: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
@@ -186,8 +186,7 @@ watch(
|
|||||||
() => route.query,
|
() => route.query,
|
||||||
(query) => {
|
(query) => {
|
||||||
searchForm.couponId = query.couponId;
|
searchForm.couponId = query.couponId;
|
||||||
// 原代码此处判断的 couponId 在 data 中并不存在,恒为 undefined;保持原行为
|
if (query.couponId) {
|
||||||
if (props.couponId) {
|
|
||||||
getDataList();
|
getDataList();
|
||||||
} else {
|
} else {
|
||||||
searchFormRef.value?.resetFields();
|
searchFormRef.value?.resetFields();
|
||||||
@@ -226,8 +225,7 @@ function handleSearch() {
|
|||||||
function changeSelect(e) {
|
function changeSelect(e) {
|
||||||
selectList.value = e;
|
selectList.value = e;
|
||||||
selectCount.value = e.length;
|
selectCount.value = e.length;
|
||||||
// 原代码此处判断的 getType 组件并未声明该 prop,恒为 undefined;保持原行为
|
if (searchForm.getType === "ACTIVITY") check();
|
||||||
if (props.getType === "ACTIVITY") check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDataList() {
|
function getDataList() {
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ import { useRoute, useRouter } from "vue-router";
|
|||||||
import {
|
import {
|
||||||
getShopCouponList,
|
getShopCouponList,
|
||||||
updateCouponStatus,
|
updateCouponStatus,
|
||||||
deleteShopCoupon,
|
|
||||||
} from "@/api/promotion";
|
} from "@/api/promotion";
|
||||||
import { formatPromotionCouponValidityHtml } from "@/utils/promotions";
|
import { formatPromotionCouponValidityHtml } from "@/utils/promotions";
|
||||||
import { Message, Modal } from "@/utils/message";
|
import { Message, Modal } from "@/utils/message";
|
||||||
@@ -467,27 +466,6 @@ function close(v) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(v) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: "确认删除",
|
|
||||||
content: "确认要删除此优惠券么?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
deleteShopCoupon(v.id)
|
|
||||||
.then((res) => {
|
|
||||||
Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
Message.success("优惠券已删除");
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
Modal.remove();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function delAll() {
|
function delAll() {
|
||||||
if (selectCount.value <= 0) {
|
if (selectCount.value <= 0) {
|
||||||
Message.warning("您还未选择要下架的优惠券");
|
Message.warning("您还未选择要下架的优惠券");
|
||||||
|
|||||||
@@ -125,7 +125,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { uploadFile } from "@/libs/axios";
|
|
||||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||||
import { addLive, addLiveGoods, editLive, getLiveInfo, delRoomLiveGoods } from "@/api/promotion";
|
import { addLive, addLiveGoods, editLive, getLiveInfo, delRoomLiveGoods } from "@/api/promotion";
|
||||||
import liveGoods from "./liveGoods";
|
import liveGoods from "./liveGoods";
|
||||||
@@ -140,7 +139,6 @@ const spinShow = ref(false);
|
|||||||
const liveGoodsVisible = ref(false);
|
const liveGoodsVisible = ref(false);
|
||||||
const imageVisible = ref(false);
|
const imageVisible = ref(false);
|
||||||
const imageSrc = ref("");
|
const imageSrc = ref("");
|
||||||
const action = uploadFile;
|
|
||||||
const accessToken = ref({});
|
const accessToken = ref({});
|
||||||
const liveStatus = ref("NEW");
|
const liveStatus = ref("NEW");
|
||||||
const liveRulesForm = {
|
const liveRulesForm = {
|
||||||
@@ -236,7 +234,7 @@ function callBackData(way) {
|
|||||||
liveGoodsVisible.value = false;
|
liveGoodsVisible.value = false;
|
||||||
spinShow.value = true;
|
spinShow.value = true;
|
||||||
addLiveGoods({
|
addLiveGoods({
|
||||||
roomId: route.query.roomId,
|
roomId: route.query.id,
|
||||||
liveGoodsId: way.liveGoodsId,
|
liveGoodsId: way.liveGoodsId,
|
||||||
goodsId: way.goodsId,
|
goodsId: way.goodsId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form :model="liveForm" ref="liveFormRef" :rules="liveRulesForm" label-width="120px">
|
<el-form :model="liveForm" ref="liveFormRef" label-width="120px">
|
||||||
<el-form-item label="直播标题" prop="name">
|
<el-form-item label="直播标题" prop="name">
|
||||||
<div class="form-field-block">
|
<div class="form-field-block">
|
||||||
<el-input disabled v-model="liveForm.name" style="width:460px"></el-input>
|
<el-input disabled v-model="liveForm.name" style="width:460px"></el-input>
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
v-model="times"
|
v-model="times"
|
||||||
@change="handleChangeTime"
|
|
||||||
start-placeholder="开始时间"
|
start-placeholder="开始时间"
|
||||||
end-placeholder="结束时间"
|
end-placeholder="结束时间"
|
||||||
placeholder="直播计划开始时间-直播计划结束时间"
|
placeholder="直播计划开始时间-直播计划结束时间"
|
||||||
@@ -111,10 +110,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="createLives()">保存</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@@ -128,8 +123,6 @@
|
|||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { getLiveInfo } from "@/api/promotion.js";
|
import { getLiveInfo } from "@/api/promotion.js";
|
||||||
import { Notice } from "@/utils/message";
|
|
||||||
import { getStore } from "@/libs/storage";
|
|
||||||
import { unixToDate } from "@/utils/filters";
|
import { unixToDate } from "@/utils/filters";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -152,29 +145,16 @@ const commodityList = ref("");
|
|||||||
// liveFormRef:模板 ref 改名避免与 liveForm 变量互相覆盖
|
// liveFormRef:模板 ref 改名避免与 liveForm 变量互相覆盖
|
||||||
const liveFormRef = ref(null);
|
const liveFormRef = ref(null);
|
||||||
|
|
||||||
// 原代码未在 data 声明、直接挂 this 的字段,script setup 下需显式声明
|
|
||||||
let accessToken;
|
|
||||||
let liveStatus;
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
getLiveDetail();
|
getLiveDetail();
|
||||||
}
|
}
|
||||||
accessToken = {
|
|
||||||
accessToken: getStore("accessToken"),
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleView(src) {
|
function handleView(src) {
|
||||||
imageVisible.value = true;
|
imageVisible.value = true;
|
||||||
imageSrc.value = src;
|
imageSrc.value = src;
|
||||||
}
|
}
|
||||||
function handleMaxSize(file) {
|
|
||||||
Notice.warning({
|
|
||||||
title: "文件大小过大",
|
|
||||||
desc: "所选文件大小过大, 不得超过 1M.",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function getLiveDetail() {
|
async function getLiveDetail() {
|
||||||
let result = await getLiveInfo(route.query.id);
|
let result = await getLiveInfo(route.query.id);
|
||||||
|
|
||||||
@@ -191,7 +171,6 @@ async function getLiveDetail() {
|
|||||||
unixToDate(data.startTime, "yyyy-MM-dd hh:mm"),
|
unixToDate(data.startTime, "yyyy-MM-dd hh:mm"),
|
||||||
unixToDate(data.endTime, "yyyy-MM-dd hh:mm"),
|
unixToDate(data.endTime, "yyyy-MM-dd hh:mm"),
|
||||||
];
|
];
|
||||||
liveStatus = data.status;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -347,7 +347,6 @@ const orderParam = reactive({
|
|||||||
endDate: null,
|
endDate: null,
|
||||||
});
|
});
|
||||||
const orderTotal = ref(0);
|
const orderTotal = ref(0);
|
||||||
const refundTotal = ref(0);
|
|
||||||
const billStatusList = ref([
|
const billStatusList = ref([
|
||||||
{ status: "OUT", value: "已出账", title: "生成账单" },
|
{ status: "OUT", value: "已出账", title: "生成账单" },
|
||||||
{ status: "CHECK", value: "已对账", title: "商家对账" },
|
{ status: "CHECK", value: "已对账", title: "商家对账" },
|
||||||
@@ -471,9 +470,7 @@ function download() {
|
|||||||
navigator.msSaveBlob(blob, "结算单-" + id.value + ".xlsx");
|
navigator.msSaveBlob(blob, "结算单-" + id.value + ".xlsx");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function init() {
|
function init() {
|
||||||
id.value = route.query.id;
|
id.value = route.query.id;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, watch, onMounted, nextTick } from "vue";
|
import { ref, reactive, watch, onMounted } from "vue";
|
||||||
// 自定义指令:script setup 中以 vXxx 命名的顶层变量即注册为指令
|
// 自定义指令:script setup 中以 vXxx 命名的顶层变量即注册为指令
|
||||||
import vChangeSize from "../directives/changeSize";
|
import vChangeSize from "../directives/changeSize";
|
||||||
import vDragItem from "../directives/dragItem";
|
import vDragItem from "../directives/dragItem";
|
||||||
@@ -112,7 +112,6 @@ const tooSmall = ref(false);
|
|||||||
const showModal = ref(false);
|
const showModal = ref(false);
|
||||||
const picModelFlag = ref(false);
|
const picModelFlag = ref(false);
|
||||||
const currentIndex = ref(0);
|
const currentIndex = ref(0);
|
||||||
const currentShowIndex = ref(-1);
|
|
||||||
const zoneForm = reactive({
|
const zoneForm = reactive({
|
||||||
img: "",
|
img: "",
|
||||||
link: "",
|
link: "",
|
||||||
@@ -158,15 +157,6 @@ function showModalFn(index) {
|
|||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
currentIndex.value = index;
|
currentIndex.value = index;
|
||||||
}
|
}
|
||||||
// 选择图片
|
|
||||||
function handleSelectImg() {
|
|
||||||
picModelFlag.value = true;
|
|
||||||
nextTick(() => {
|
|
||||||
if (ossManageRef.value) {
|
|
||||||
ossManageRef.value.selectImage = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 选择图片回调
|
// 选择图片回调
|
||||||
function callbackSelected(item) {
|
function callbackSelected(item) {
|
||||||
picModelFlag.value = false;
|
picModelFlag.value = false;
|
||||||
@@ -217,13 +207,9 @@ function settingZone(val) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function saveZone() {}
|
|
||||||
function cancelZone() {
|
function cancelZone() {
|
||||||
showModal.value = false;
|
showModal.value = false;
|
||||||
}
|
}
|
||||||
function delZone() {
|
|
||||||
delItem(currentIndex.value);
|
|
||||||
}
|
|
||||||
function delItem(index) {
|
function delItem(index) {
|
||||||
emit("delItem", index);
|
emit("delItem", index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ const picModelFlag = ref(false);
|
|||||||
const showModal = ref(false);
|
const showModal = ref(false);
|
||||||
const showModalNav = ref(false);
|
const showModalNav = ref(false);
|
||||||
const selectedNav = ref(null);
|
const selectedNav = ref(null);
|
||||||
const promotionTags = ref(["买2免1", "领200神券", "199减100", "母婴5折抢", "充100送20"]);
|
|
||||||
const topAdvert = ref({
|
const topAdvert = ref({
|
||||||
type: "topAdvert",
|
type: "topAdvert",
|
||||||
img: "",
|
img: "",
|
||||||
@@ -227,9 +226,7 @@ function handleAddNav() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMoveEnd({ newIndex, oldIndex }) {
|
function handleMoveEnd({ newIndex, oldIndex }) {}
|
||||||
console.log("index", newIndex, oldIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleModel(type) {
|
function handleModel(type) {
|
||||||
if (type == "topAdvert") {
|
if (type == "topAdvert") {
|
||||||
|
|||||||
@@ -194,9 +194,7 @@ const showModal = ref(false);
|
|||||||
const picModelFlag = ref(false);
|
const picModelFlag = ref(false);
|
||||||
const selectedData = ref(""); //选中的数据
|
const selectedData = ref(""); //选中的数据
|
||||||
const goodsIndex = ref(0); // 商品索引
|
const goodsIndex = ref(0); // 商品索引
|
||||||
const align = ref("");
|
|
||||||
const defaultCallbackImageType = ref("");
|
const defaultCallbackImageType = ref("");
|
||||||
const current = ref("");
|
|
||||||
|
|
||||||
const liliDialogRef = ref(null);
|
const liliDialogRef = ref(null);
|
||||||
const ossManageRef = 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].price = val[0].price;
|
||||||
props.data.options.data.hot.list[goodsIndex.value].url =
|
props.data.options.data.hot.list[goodsIndex.value].url =
|
||||||
formatLinkType(val[0]);
|
formatLinkType(val[0]);
|
||||||
|
|
||||||
console.log(val, selectedData.value, goodsIndex.value);
|
|
||||||
}
|
}
|
||||||
// 选择链接回调
|
// 选择链接回调
|
||||||
function selectedLink(val) {
|
function selectedLink(val) {
|
||||||
console.log(val, selectedData.value)
|
|
||||||
if (selectedData.value == "image") {
|
if (selectedData.value == "image") {
|
||||||
props.data.options.data.image.url =
|
props.data.options.data.image.url =
|
||||||
formatLinkType(val);
|
formatLinkType(val);
|
||||||
} else {
|
} else {
|
||||||
console.log(props.data.options.data.list, goodsIndex.value)
|
|
||||||
props.data.options.data.list[
|
props.data.options.data.list[
|
||||||
goodsIndex.value
|
goodsIndex.value
|
||||||
].url = formatLinkType(val);
|
].url = formatLinkType(val);
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ const tabIndex = ref(0);
|
|||||||
const current = ref(0);
|
const current = ref(0);
|
||||||
const showModal = ref(false);
|
const showModal = ref(false);
|
||||||
const selected = ref({}); // 已选数据
|
const selected = ref({}); // 已选数据
|
||||||
const picModelFlag = ref(false);
|
|
||||||
const tabCurrentlyIndex = ref(0); // 选项卡索引
|
const tabCurrentlyIndex = ref(0); // 选项卡索引
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -187,7 +186,6 @@ function delGoods(val) {
|
|||||||
|
|
||||||
// 切换选项卡
|
// 切换选项卡
|
||||||
function handleClickTab(name) {
|
function handleClickTab(name) {
|
||||||
console.log(name);
|
|
||||||
tabCurrentlyIndex.value = name;
|
tabCurrentlyIndex.value = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +197,6 @@ function addCurrentGoods() {
|
|||||||
|
|
||||||
// 编辑模块
|
// 编辑模块
|
||||||
function handleSelectModel(item) {
|
function handleSelectModel(item) {
|
||||||
console.log(item);
|
|
||||||
selected.value = item;
|
selected.value = item;
|
||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
}
|
}
|
||||||
@@ -226,14 +223,6 @@ function selectedLink(val) {
|
|||||||
selected.value[current.value].url = formatLinkType(val);
|
selected.value[current.value].url = formatLinkType(val);
|
||||||
selected.value[current.value].type =
|
selected.value[current.value].type =
|
||||||
val.___type === "other" && val.url === "" ? "link" : "other";
|
val.___type === "other" && val.url === "" ? "link" : "other";
|
||||||
|
|
||||||
console.log(selected.value[current.value]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSelectLink(index) {
|
|
||||||
// 调起选择链接弹窗
|
|
||||||
liliDialog.value.open("link");
|
|
||||||
current.value = index;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -218,10 +218,8 @@ function handleSelectLink(val, index) {
|
|||||||
function callbackSelected(val) {
|
function callbackSelected(val) {
|
||||||
picModelFlag.value = false;
|
picModelFlag.value = false;
|
||||||
if (defaultCallbackImageType.value == "default") {
|
if (defaultCallbackImageType.value == "default") {
|
||||||
console.log(current.value.data.image);
|
|
||||||
current.value.data.image.src = val.url;
|
current.value.data.image.src = val.url;
|
||||||
} else {
|
} 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.list[goodsIndex.value].img = val.url;
|
||||||
|
|
||||||
// props.data.options[align.value].data[selectedData.value][goodsIndex.value].url = val.img
|
// props.data.options[align.value].data[selectedData.value][goodsIndex.value].url = val.img
|
||||||
@@ -229,7 +227,6 @@ function callbackSelected(val) {
|
|||||||
}
|
}
|
||||||
// 选择商品回调
|
// 选择商品回调
|
||||||
function selectedGoodsData(val) {
|
function selectedGoodsData(val) {
|
||||||
console.log(val);
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
props.data.options[align.value].data.list[goodsIndex.value].img =
|
props.data.options[align.value].data.list[goodsIndex.value].img =
|
||||||
val[0].thumbnail;
|
val[0].thumbnail;
|
||||||
@@ -240,14 +237,12 @@ function selectedGoodsData(val) {
|
|||||||
props.data.options[align.value].data.list[goodsIndex.value].url =
|
props.data.options[align.value].data.list[goodsIndex.value].url =
|
||||||
val[0].url;
|
val[0].url;
|
||||||
});
|
});
|
||||||
console.log(props.data.options[align.value].data.list[goodsIndex.value]);
|
|
||||||
proxy.$forceUpdate();
|
proxy.$forceUpdate();
|
||||||
}
|
}
|
||||||
// 选择链接回调
|
// 选择链接回调
|
||||||
function selectedLink(val) {
|
function selectedLink(val) {
|
||||||
if (selectedData.value != "list") {
|
if (selectedData.value != "list") {
|
||||||
props.data.options[align.value].data[selectedData.value].url = formatLinkType(val);
|
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") {
|
if (selectedData.value == "list") {
|
||||||
props.data.options[align.value].data[selectedData.value][goodsIndex.value]
|
props.data.options[align.value].data[selectedData.value][goodsIndex.value]
|
||||||
@@ -262,7 +257,6 @@ function selectedLink(val) {
|
|||||||
function handleSelectModel(alignVal) {
|
function handleSelectModel(alignVal) {
|
||||||
align.value = alignVal;
|
align.value = alignVal;
|
||||||
current.value = props.data.options[alignVal];
|
current.value = props.data.options[alignVal];
|
||||||
console.log(props.data.options[alignVal]);
|
|
||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ const ossManageRef = ref(null);
|
|||||||
function callbackSelected(val) {
|
function callbackSelected(val) {
|
||||||
picModelFlag.value = false;
|
picModelFlag.value = false;
|
||||||
selected.value[current.value].img = val.url;
|
selected.value[current.value].img = val.url;
|
||||||
console.log(selected.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑模块
|
// 编辑模块
|
||||||
@@ -100,7 +99,6 @@ function handleSelectModel(item) {
|
|||||||
|
|
||||||
// 选择商品回调
|
// 选择商品回调
|
||||||
function selectedGoodsData(val) {
|
function selectedGoodsData(val) {
|
||||||
console.log(val);
|
|
||||||
let goods = val[0];
|
let goods = val[0];
|
||||||
selected.value.img = goods.thumbnail;
|
selected.value.img = goods.thumbnail;
|
||||||
selected.value.price = goods.price;
|
selected.value.price = goods.price;
|
||||||
|
|||||||
@@ -89,12 +89,9 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const flag = ref(false);
|
|
||||||
const tabIndex = ref(0);
|
|
||||||
const current = ref(0);
|
const current = ref(0);
|
||||||
const showModal = ref(false);
|
const showModal = ref(false);
|
||||||
const selected = ref({}); // 已选数据
|
const selected = ref({}); // 已选数据
|
||||||
const picModelFlag = ref(false);
|
|
||||||
|
|
||||||
const liliDialog = ref(null);
|
const liliDialog = ref(null);
|
||||||
|
|
||||||
@@ -108,7 +105,6 @@ function addCurrentGoods() {
|
|||||||
}
|
}
|
||||||
// 编辑模块
|
// 编辑模块
|
||||||
function handleSelectModel(item) {
|
function handleSelectModel(item) {
|
||||||
console.log(item);
|
|
||||||
selected.value = item;
|
selected.value = item;
|
||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
}
|
}
|
||||||
@@ -132,13 +128,6 @@ function selectedLink(val) {
|
|||||||
selected.value[current.value].url = formatLinkType(val);
|
selected.value[current.value].url = formatLinkType(val);
|
||||||
selected.value[current.value].type =
|
selected.value[current.value].type =
|
||||||
val.___type === "other" && val.url === "" ? "link" : "other";
|
val.___type === "other" && val.url === "" ? "link" : "other";
|
||||||
|
|
||||||
console.log(selected.value[current.value]);
|
|
||||||
}
|
|
||||||
function handleSelectLink(index) {
|
|
||||||
// 调起选择链接弹窗
|
|
||||||
liliDialog.value.open("link");
|
|
||||||
current.value = index;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,6 @@ function selectedLink(val) {
|
|||||||
}
|
}
|
||||||
// 选择商品回调
|
// 选择商品回调
|
||||||
function selectedGoodsData(val) {
|
function selectedGoodsData(val) {
|
||||||
console.log(val);
|
|
||||||
let goods = val[0];
|
let goods = val[0];
|
||||||
selected.value.img = goods.thumbnail;
|
selected.value.img = goods.thumbnail;
|
||||||
selected.value.price = goods.price;
|
selected.value.price = goods.price;
|
||||||
|
|||||||
@@ -155,9 +155,7 @@ function getTemplateItem(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(modelForm, function (val) {
|
watch(modelForm, function (val) {}, { deep: true });
|
||||||
console.log(val);
|
|
||||||
}, { deep: true });
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.renovation {
|
.renovation {
|
||||||
|
|||||||
@@ -89,12 +89,6 @@ defineOptions({ name: "logistics" });
|
|||||||
const row = ref({});
|
const row = ref({});
|
||||||
const openModal = ref(false);
|
const openModal = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const searchForm = ref({
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
sort: "createTime",
|
|
||||||
order: "desc",
|
|
||||||
});
|
|
||||||
const openModalTitle = ref("开启信息");
|
const openModalTitle = ref("开启信息");
|
||||||
const ruleValidate = ref({});
|
const ruleValidate = ref({});
|
||||||
const faceSheetForm = ref({
|
const faceSheetForm = ref({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<el-card style="margin-left: 10px">
|
<el-card style="margin-left: 10px">
|
||||||
<el-tabs v-model="type" @click="handleClickType">
|
<el-tabs v-model="type" @tab-click="handleClickType">
|
||||||
<el-tab-pane label="基本信息" name="INFO">
|
<el-tab-pane label="基本信息" name="INFO">
|
||||||
<el-form ref="formRef" :model="form" label-width="100px" :rules="formValidate">
|
<el-form ref="formRef" :model="form" label-width="100px" :rules="formValidate">
|
||||||
<el-form-item label="店铺名称">
|
<el-form-item label="店铺名称">
|
||||||
@@ -133,16 +133,10 @@ import { Message } from "@/utils/message";
|
|||||||
defineOptions({ name: "shopSetting" });
|
defineOptions({ name: "shopSetting" });
|
||||||
|
|
||||||
const currentKey = ref(""); //存储当前点击地址的key
|
const currentKey = ref(""); //存储当前点击地址的key
|
||||||
const showMap = ref(false); // 是否展示地图
|
|
||||||
const type = ref("INFO");
|
const type = ref("INFO");
|
||||||
|
|
||||||
const storeName = ref(""); //店铺名称
|
const storeName = ref(""); //店铺名称
|
||||||
|
|
||||||
const regionId = ref([]); // 地区id
|
|
||||||
// 历史遗留:loading、regionGoods、regionIdS 未在原 data 中声明,仅在方法内赋值,保持原行为
|
|
||||||
let loading = false;
|
|
||||||
let regionGoods = null;
|
|
||||||
let regionIdS = null;
|
|
||||||
const addressForm = ref({
|
const addressForm = ref({
|
||||||
// 退货地址
|
// 退货地址
|
||||||
salesConsigneeName: "", // 收货人姓名
|
salesConsigneeName: "", // 收货人姓名
|
||||||
@@ -155,11 +149,6 @@ const addressForm = ref({
|
|||||||
const udeskForm = ref({
|
const udeskForm = ref({
|
||||||
merchantEuid: "",
|
merchantEuid: "",
|
||||||
});
|
});
|
||||||
const udeskFormValidate = {
|
|
||||||
merchantEuid: [
|
|
||||||
{ required: true, message: "请输入店铺坐席ID", trigger: "blur" },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
const afterFormValidate = {
|
const afterFormValidate = {
|
||||||
salesConsigneeMobile: [
|
salesConsigneeMobile: [
|
||||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||||
@@ -261,7 +250,6 @@ const addressGoodsValidate = {
|
|||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
const addressGoodsRef = ref(null);
|
const addressGoodsRef = ref(null);
|
||||||
const addressFormRef = ref(null);
|
const addressFormRef = ref(null);
|
||||||
const udeskFormRef = ref(null);
|
|
||||||
const mapRef = ref(null);
|
const mapRef = ref(null);
|
||||||
|
|
||||||
// 回调地址
|
// 回调地址
|
||||||
@@ -315,8 +303,6 @@ function init() {
|
|||||||
|
|
||||||
|
|
||||||
function setAddressGoods() {
|
function setAddressGoods() {
|
||||||
console.log(addressGoodsRef.value)
|
|
||||||
|
|
||||||
addressGoodsRef.value.validate((valid) => {
|
addressGoodsRef.value.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
API_Shop.editDeliverAddress(addressGoods.value).then(res => {
|
API_Shop.editDeliverAddress(addressGoods.value).then(res => {
|
||||||
@@ -329,9 +315,7 @@ function setAddressGoods() {
|
|||||||
}
|
}
|
||||||
//获取店铺信息
|
//获取店铺信息
|
||||||
function getShopInfo() {
|
function getShopInfo() {
|
||||||
loading = true;
|
|
||||||
API_Shop.getShopInfo().then((res) => {
|
API_Shop.getShopInfo().then((res) => {
|
||||||
loading = false;
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
form.value = res.result;
|
form.value = res.result;
|
||||||
|
|
||||||
@@ -358,17 +342,11 @@ function getDeliverAddress() {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
if (res.result != '' && res.result != null) {
|
if (res.result != '' && res.result != null) {
|
||||||
addressGoods.value = res.result;
|
addressGoods.value = res.result;
|
||||||
regionGoods = res.result.salesConsignorAddressPath;
|
|
||||||
regionIdS = res.result.salesConsignorAddressId;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//重置
|
|
||||||
function handleReset() {
|
|
||||||
formRef.value.resetFields();
|
|
||||||
}
|
|
||||||
//提交保存
|
//提交保存
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
formRef.value.validate((valid) => {
|
formRef.value.validate((valid) => {
|
||||||
@@ -384,29 +362,16 @@ 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切换
|
//tab切换
|
||||||
function handleClickType(v) {
|
function handleClickType(pane) {
|
||||||
|
const name = pane.paneName;
|
||||||
//退款
|
//退款
|
||||||
if (v == "INFO") {
|
if (name === "INFO") {
|
||||||
getShopInfo();
|
getShopInfo();
|
||||||
}
|
}
|
||||||
//退货
|
//退货
|
||||||
if (v == "REFUND_GOODS_ADDRESS") {
|
if (name === "REFUND_GOODS_ADDRESS") {
|
||||||
getRefundGoodsAddress();
|
getRefundGoodsAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门">
|
<el-form-item label="部门">
|
||||||
<department-choose @change="handleSelectDep" style="width: 150px;" ref="dep"></department-choose>
|
<department-choose @on-change="handleSelectDep" style="width: 150px;" ref="dep"></department-choose>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary" class="search-btn" @click="handleSearch">
|
<el-button type="primary" class="search-btn" @click="handleSearch">
|
||||||
<el-icon><Search /></el-icon>
|
<el-icon><Search /></el-icon>
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ const loading = ref(true);
|
|||||||
const maxHeight = ref("500px");
|
const maxHeight = ref("500px");
|
||||||
const strict = ref(true);
|
const strict = ref(true);
|
||||||
const userLoading = ref(false);
|
const userLoading = ref(false);
|
||||||
const loadingEdit = ref(false);
|
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const selectList = ref([]);
|
const selectList = ref([]);
|
||||||
const selectCount = ref(0);
|
const selectCount = ref(0);
|
||||||
@@ -136,7 +135,6 @@ const showParent = ref(false);
|
|||||||
const modalTitle = ref("");
|
const modalTitle = ref("");
|
||||||
const editTitle = ref("");
|
const editTitle = ref("");
|
||||||
const selectedRole = ref([]);
|
const selectedRole = ref([]);
|
||||||
const searchKey = ref("");
|
|
||||||
const currentNodeKey = ref(null);
|
const currentNodeKey = ref(null);
|
||||||
const treeProps = {
|
const treeProps = {
|
||||||
label: "title",
|
label: "title",
|
||||||
@@ -165,7 +163,6 @@ const formValidate = {
|
|||||||
};
|
};
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const dataEdit = ref([]);
|
|
||||||
const users = ref([]);
|
const users = ref([]);
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
@@ -254,18 +251,6 @@ function cancelSelect() {
|
|||||||
editTitle.value = "";
|
editTitle.value = "";
|
||||||
selectedRole.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() {
|
function cancelAdd() {
|
||||||
modalVisible.value = false;
|
modalVisible.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ import {
|
|||||||
addRole as addRoleReq,
|
addRole as addRoleReq,
|
||||||
editRole,
|
editRole,
|
||||||
deleteRole,
|
deleteRole,
|
||||||
loadDepartment,
|
|
||||||
selectRoleMenu,
|
selectRoleMenu,
|
||||||
saveRoleMenu,
|
saveRoleMenu,
|
||||||
} from "@/api/index";
|
} from "@/api/index";
|
||||||
@@ -178,15 +177,12 @@ const rolePermsWay = ref([]);
|
|||||||
const openLevel = ref("0");
|
const openLevel = ref("0");
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const treeLoading = ref(true);
|
const treeLoading = ref(true);
|
||||||
const depTreeLoading = ref(true);
|
|
||||||
const submitPermLoading = ref(false);
|
const submitPermLoading = ref(false);
|
||||||
const submitDepLoading = ref(false);
|
|
||||||
const sortColumn = ref("");
|
const sortColumn = ref("");
|
||||||
const sortType = ref("desc");
|
const sortType = ref("desc");
|
||||||
const modalType = ref(0);
|
const modalType = ref(0);
|
||||||
const roleModalVisible = ref(false);
|
const roleModalVisible = ref(false);
|
||||||
const permModalVisible = ref(false);
|
const permModalVisible = ref(false);
|
||||||
const depModalVisible = ref(false);
|
|
||||||
const modalTitle = ref("");
|
const modalTitle = ref("");
|
||||||
const roleForm = ref({
|
const roleForm = ref({
|
||||||
name: "",
|
name: "",
|
||||||
@@ -204,10 +200,6 @@ const pageSize = ref(20);
|
|||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const permData = ref([]);
|
const permData = ref([]);
|
||||||
const editRolePermId = ref("");
|
const editRolePermId = ref("");
|
||||||
const selectAllFlag = ref(false);
|
|
||||||
const depData = ref([]);
|
|
||||||
const dataType = ref(0);
|
|
||||||
const editDepartments = ref([]);
|
|
||||||
const saveRoleWay = ref([]);
|
const saveRoleWay = ref([]);
|
||||||
const permTreeKey = ref(0);
|
const permTreeKey = ref(0);
|
||||||
const permCheckedKeys = ref([]);
|
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) {
|
function computeExpandedKeys(level) {
|
||||||
const keys = [];
|
const keys = [];
|
||||||
const walk = (nodes, depth) => {
|
const walk = (nodes, depth) => {
|
||||||
|
|||||||
@@ -530,7 +530,6 @@ import { CircleClose } from "@element-plus/icons-vue";
|
|||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
import alignTextLeftImg from "@/assets/align-text-left.png";
|
import alignTextLeftImg from "@/assets/align-text-left.png";
|
||||||
import alignTextCenterImg from "@/assets/align-text-center.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 ossManage from "@/views/sys/oss-manage/ossManage";
|
||||||
import { modelData } from "./config";
|
import { modelData } from "./config";
|
||||||
import hotzone from "@/views/shop/hotzone";
|
import hotzone from "@/views/shop/hotzone";
|
||||||
@@ -540,7 +539,7 @@ import categoryTemplate from "@/views/lili-dialog/template/category";
|
|||||||
const props = defineProps(["res"]);
|
const props = defineProps(["res"]);
|
||||||
const emit = defineEmits(["handleDrawer"]);
|
const emit = defineEmits(["handleDrawer"]);
|
||||||
|
|
||||||
// alignTextLeftImg/alignTextCenterImg/alignTextRightImg、ways(选择链接的类型)、modelData(装修数据) 为 import 常量,模板中直接使用
|
// alignTextLeftImg/alignTextCenterImg、ways(选择链接的类型)、modelData(装修数据) 为 import 常量,模板中直接使用
|
||||||
const picModelFlag = ref(false); //图片选择器
|
const picModelFlag = ref(false); //图片选择器
|
||||||
const linkType = ref("goods"); // dialog弹窗口类型
|
const linkType = ref("goods"); // dialog弹窗口类型
|
||||||
const styleFlag = ref(false); //广告魔方开关
|
const styleFlag = ref(false); //广告魔方开关
|
||||||
@@ -548,10 +547,8 @@ const textAlign = ref(
|
|||||||
props.res.options.list[0] ? props.res.options.list[0].textAlign : "center"
|
props.res.options.list[0] ? props.res.options.list[0].textAlign : "center"
|
||||||
); //文字对齐方式
|
); //文字对齐方式
|
||||||
const promotionsFlag = ref(false); //广告魔方开关
|
const promotionsFlag = ref(false); //广告魔方开关
|
||||||
const selectedLinkIndex = ref(""); //选择链接的索引
|
|
||||||
const selectedGoods = ref(""); // 已选商品
|
const selectedGoods = ref(""); // 已选商品
|
||||||
const selectedLinks = ref(""); // 已选链接
|
const selectedLinks = ref(""); // 已选链接
|
||||||
const modelList = ref(""); // 装修列表
|
|
||||||
const enableSelectCategory = ref(false); //商品是否绑定分类
|
const enableSelectCategory = ref(false); //商品是否绑定分类
|
||||||
const pendingCategory = ref(null); // 选择分类弹窗草稿
|
const pendingCategory = ref(null); // 选择分类弹窗草稿
|
||||||
const goodsSelectedIndex = ref(0); //绑定商品分类的索引
|
const goodsSelectedIndex = ref(0); //绑定商品分类的索引
|
||||||
@@ -601,8 +598,6 @@ function confirmCategory(val) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
props.res.options.list[0].titleWay[goodsSelectedIndex.value] = data;
|
props.res.options.list[0].titleWay[goodsSelectedIndex.value] = data;
|
||||||
|
|
||||||
console.log(props.res.options.list[0]);
|
|
||||||
}
|
}
|
||||||
// 商品排序
|
// 商品排序
|
||||||
function slotGoods(list, key, val) {
|
function slotGoods(list, key, val) {
|
||||||
@@ -639,7 +634,6 @@ function slotGoods(list, key, val) {
|
|||||||
|
|
||||||
// 轮播图排序
|
// 轮播图排序
|
||||||
function slotBanner(val, key, index, down) {
|
function slotBanner(val, key, index, down) {
|
||||||
console.log(val);
|
|
||||||
if (down == "down") {
|
if (down == "down") {
|
||||||
downData(val.options.list, index);
|
downData(val.options.list, index);
|
||||||
} else {
|
} else {
|
||||||
@@ -749,24 +743,9 @@ function clickLink(val, index, oval) {
|
|||||||
liliDialogFlag(false);
|
liliDialogFlag(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function addZone(zoneInfo) {
|
|
||||||
selectedLinks.value.zoneInfo.push(zoneInfo);
|
|
||||||
}
|
|
||||||
function changeZone(zoneInfo) {
|
function changeZone(zoneInfo) {
|
||||||
selectedLinks.value.zoneInfo = 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) {
|
function addDecorate(type, data) {
|
||||||
if (type === "notice") {
|
if (type === "notice") {
|
||||||
@@ -789,15 +768,6 @@ function addDecorate(type, data) {
|
|||||||
props.res.options.list.push(way);
|
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) {
|
function callbackSelected(val) {
|
||||||
picModelFlag.value = false;
|
picModelFlag.value = false;
|
||||||
|
|||||||
@@ -91,14 +91,12 @@ const route = useRoute();
|
|||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
// templates: 模板类型,modelData: 装修模型,均为 import 常量,模板中直接使用
|
// templates: 模板类型,modelData: 装修模型,均为 import 常量,模板中直接使用
|
||||||
const qrcode = ref(""); // 二维码
|
|
||||||
const selected = ref(0); // 已选下标
|
const selected = ref(0); // 已选下标
|
||||||
const contentData = ref({
|
const contentData = ref({
|
||||||
// 总数据
|
// 总数据
|
||||||
list: [],
|
list: [],
|
||||||
});
|
});
|
||||||
const decorateData = ref(""); // 装修数据
|
const decorateData = ref(""); // 装修数据
|
||||||
const decoratePromotionsData = ref(""); // 装修数据
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
contentData,
|
contentData,
|
||||||
|
|||||||
@@ -176,60 +176,10 @@ function updateHome() {
|
|||||||
saveDialog.value = false;
|
saveDialog.value = false;
|
||||||
Message.error("修改失败,请稍后重试");
|
Message.error("修改失败,请稍后重试");
|
||||||
}
|
}
|
||||||
console.log(res);
|
|
||||||
})
|
})
|
||||||
.catch(error => {});
|
.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() {
|
function goBack() {
|
||||||
router.go(-1);
|
router.go(-1);
|
||||||
@@ -254,7 +204,6 @@ function submit(submitWay) {
|
|||||||
saveDialog.value = false;
|
saveDialog.value = false;
|
||||||
Message.error("保存失败,请稍后重试");
|
Message.error("保存失败,请稍后重试");
|
||||||
}
|
}
|
||||||
console.log(res);
|
|
||||||
})
|
})
|
||||||
.catch(error => {});
|
.catch(error => {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,31 +313,7 @@ const chartList = ref([]); // 绘制订单图表数据
|
|||||||
const orderChart = ref(""); //订单图表
|
const orderChart = ref(""); //订单图表
|
||||||
|
|
||||||
const overViewList = ref({}); // 绘制订单统计概览
|
const overViewList = ref({}); // 绘制订单统计概览
|
||||||
const overViewChart = ref(""); //订单订单统计概览图标
|
|
||||||
|
|
||||||
// 时间
|
|
||||||
const dateList = ref([
|
|
||||||
{
|
|
||||||
title: "今天",
|
|
||||||
selected: false,
|
|
||||||
value: "TODAY",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "昨天",
|
|
||||||
selected: false,
|
|
||||||
value: "YESTERDAY",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "过去7天",
|
|
||||||
selected: true,
|
|
||||||
value: "LAST_SEVEN",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "过去30天",
|
|
||||||
selected: false,
|
|
||||||
value: "LAST_THIRTY",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
// 订单传参
|
// 订单传参
|
||||||
const orderParams = ref({
|
const orderParams = ref({
|
||||||
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
||||||
@@ -352,12 +328,6 @@ const overViewParams = ref({
|
|||||||
storeId: "",
|
storeId: "",
|
||||||
year: "",
|
year: "",
|
||||||
});
|
});
|
||||||
const defaultParams = ref({
|
|
||||||
month: "",
|
|
||||||
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
|
||||||
storeId: "",
|
|
||||||
year: "",
|
|
||||||
});
|
|
||||||
// 退单订单
|
// 退单订单
|
||||||
const refundParams = ref({
|
const refundParams = ref({
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -438,7 +408,6 @@ function initOrderChart() {
|
|||||||
|
|
||||||
function clickBreadcrumb(item, index) {
|
function clickBreadcrumb(item, index) {
|
||||||
let callback = JSON.parse(JSON.stringify(item));
|
let callback = JSON.parse(JSON.stringify(item));
|
||||||
console.log("callback", callback);
|
|
||||||
orderParams.value = callback;
|
orderParams.value = callback;
|
||||||
|
|
||||||
overViewParams.value = callback;
|
overViewParams.value = callback;
|
||||||
|
|||||||
@@ -82,15 +82,6 @@ import { customRouterPush } from "@/utils/filters";
|
|||||||
|
|
||||||
defineProps(["res"]);
|
defineProps(["res"]);
|
||||||
|
|
||||||
const orderStatusList = reactive({ // 订单状态
|
|
||||||
UNDELIVERED: "待发货",
|
|
||||||
UNPAID: "未付款",
|
|
||||||
PAID: "已付款",
|
|
||||||
DELIVERED: "已发货",
|
|
||||||
CANCELLED: "已关闭",
|
|
||||||
COMPLETED: "已完成",
|
|
||||||
TAKE: "已完成",
|
|
||||||
});
|
|
||||||
// 售后类型
|
// 售后类型
|
||||||
const serviceTypeList = reactive({
|
const serviceTypeList = reactive({
|
||||||
CANCEL: "取消",
|
CANCEL: "取消",
|
||||||
|
|||||||
@@ -372,9 +372,6 @@
|
|||||||
* - isComponent=true 时作为弹窗选择器嵌入商品编辑、店铺装修等页面
|
* - isComponent=true 时作为弹窗选择器嵌入商品编辑、店铺装修等页面
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const playIcon =
|
|
||||||
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23409eff' d='M8 5v14l11-7z'/%3E%3C/svg%3E";
|
|
||||||
|
|
||||||
// DPlayer 实例:原为模块级变量(多实例共享),保持原有作用域
|
// DPlayer 实例:原为模块级变量(多实例共享),保持原有作用域
|
||||||
let dp;
|
let dp;
|
||||||
</script>
|
</script>
|
||||||
@@ -400,7 +397,6 @@ import {
|
|||||||
updateFileDirectory,
|
updateFileDirectory,
|
||||||
} from "@/api/index";
|
} from "@/api/index";
|
||||||
import { sellerUrl } from "@/libs/axios";
|
import { sellerUrl } from "@/libs/axios";
|
||||||
import config from "@/config/index";
|
|
||||||
import { getStore } from "@/libs/storage";
|
import { getStore } from "@/libs/storage";
|
||||||
|
|
||||||
defineOptions({ name: "oss-manage" });
|
defineOptions({ name: "oss-manage" });
|
||||||
@@ -432,7 +428,6 @@ const emit = defineEmits(["callback", "selected"]);
|
|||||||
// $forceUpdate 依赖组件实例
|
// $forceUpdate 依赖组件实例
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
const fileDirectoryId = ref("");
|
|
||||||
const groupFormValidate = ref({
|
const groupFormValidate = ref({
|
||||||
id: "",
|
id: "",
|
||||||
level: 0,
|
level: 0,
|
||||||
@@ -452,10 +447,8 @@ const enableGroup = ref(false); // 是否展示分组
|
|||||||
const selectImage = ref(false); //是否是选择
|
const selectImage = ref(false); //是否是选择
|
||||||
const accessToken = ref({}); // 上传token鉴权
|
const accessToken = ref({}); // 上传token鉴权
|
||||||
const loading = ref(false); // 表单加载状态
|
const loading = ref(false); // 表单加载状态
|
||||||
const fileType = ref("pic"); // 兼容外部调用:pic / video
|
|
||||||
const showType = ref("list"); // 展示类型
|
const showType = ref("list"); // 展示类型
|
||||||
const modalVisible = ref(false); // 添加或编辑显示
|
const modalVisible = ref(false); // 添加或编辑显示
|
||||||
const uploadVisible = ref(false); // 上传展示
|
|
||||||
const videoVisible = ref(false); // 视频预览
|
const videoVisible = ref(false); // 视频预览
|
||||||
const picVisible = ref(false); // 图片预览
|
const picVisible = ref(false); // 图片预览
|
||||||
const fileVisible = ref(false); // 文件预览
|
const fileVisible = ref(false); // 文件预览
|
||||||
@@ -493,343 +486,6 @@ const formValidate = {
|
|||||||
const submitLoading = ref(false); // 添加或编辑提交状态
|
const submitLoading = ref(false); // 添加或编辑提交状态
|
||||||
const selectList = ref([]); // 多选数据
|
const selectList = ref([]); // 多选数据
|
||||||
const selectCount = ref(0); // 多选计数
|
const selectCount = ref(0); // 多选计数
|
||||||
const totalSize = ref(""); // 文件大小统计
|
|
||||||
const columns = ref([
|
|
||||||
// 表头
|
|
||||||
{
|
|
||||||
type: "selection",
|
|
||||||
width: 60,
|
|
||||||
align: "center",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "缩略图(点击预览)",
|
|
||||||
key: "url",
|
|
||||||
width: 300,
|
|
||||||
align: "center",
|
|
||||||
render: (h, params) => {
|
|
||||||
if (isImageFile(params.row)) {
|
|
||||||
return h("img", {
|
|
||||||
attrs: {
|
|
||||||
src: params.row.url || "",
|
|
||||||
alt: "加载图片失败",
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showPic(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else if (isVideoFile(params.row)) {
|
|
||||||
// 如果视频文件大小超过5MB不予加载video
|
|
||||||
if (params.row.fileSize < 1024 * 1024 * 5) {
|
|
||||||
return h(
|
|
||||||
"video",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showVideo(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[
|
|
||||||
h("source", {
|
|
||||||
attrs: {
|
|
||||||
src: params.row.url,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return h("img", {
|
|
||||||
attrs: {
|
|
||||||
src: playIcon,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showVideo(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return h("span", "非多媒体类型");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "文件类型",
|
|
||||||
key: "fileType",
|
|
||||||
width: 115,
|
|
||||||
className: selectImage.value == true ? "none" : "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "文件大小",
|
|
||||||
key: "fileSize",
|
|
||||||
width: 115,
|
|
||||||
sortable: true,
|
|
||||||
className: selectImage.value == true ? "none" : "",
|
|
||||||
render: (h, params) => {
|
|
||||||
let m =
|
|
||||||
((params.row.fileSize * 1.0) / (1024 * 1024)).toFixed(2) + " MB";
|
|
||||||
return h("span", m);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "上传者",
|
|
||||||
key: "createBy",
|
|
||||||
width: 200,
|
|
||||||
render: (h, params) => {
|
|
||||||
let m;
|
|
||||||
if (params.row.userEnums == "MANAGER") {
|
|
||||||
m = "[管理员]";
|
|
||||||
} else if (params.row.userEnums == "STORE") {
|
|
||||||
m = "[商家]";
|
|
||||||
} else if (params.row.userEnums == "CUSTOMER") {
|
|
||||||
m = "[客服]";
|
|
||||||
} else {
|
|
||||||
m = "[用户]";
|
|
||||||
}
|
|
||||||
m += params.row.createBy;
|
|
||||||
return h("span", m);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
key: "action",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
// width: 300,
|
|
||||||
render: (h, params) => {
|
|
||||||
return h("div", [
|
|
||||||
h(
|
|
||||||
"a",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
color: "#2d8cf0",
|
|
||||||
cursor: "pointer",
|
|
||||||
textDecoration: "none",
|
|
||||||
marginRight: "5px",
|
|
||||||
display: selectImage.value === true ? "inline-block" : "none",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
selectedParams(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"选择"
|
|
||||||
),
|
|
||||||
h(
|
|
||||||
"span",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
margin: "0 8px",
|
|
||||||
color: "#dcdee2",
|
|
||||||
display: selectImage.value === true ? "inline-block" : "none",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"|"
|
|
||||||
),
|
|
||||||
h(
|
|
||||||
"a",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
color: "#2d8cf0",
|
|
||||||
cursor: "pointer",
|
|
||||||
textDecoration: "none",
|
|
||||||
marginRight: "5px",
|
|
||||||
display: selectImage.value == true ? "none" : "inline-block",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
download(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"下载"
|
|
||||||
),
|
|
||||||
h(
|
|
||||||
"span",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
margin: "0 8px",
|
|
||||||
color: "#dcdee2",
|
|
||||||
display: selectImage.value == true ? "none" : "inline-block",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"|"
|
|
||||||
),
|
|
||||||
h(
|
|
||||||
"a",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
color: "#2d8cf0",
|
|
||||||
cursor: "pointer",
|
|
||||||
textDecoration: "none",
|
|
||||||
display: selectImage.value == true ? "none" : "inline-block",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
remove(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"删除"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const viewColumns = ref([
|
|
||||||
{
|
|
||||||
title: "缩略图(点击预览)",
|
|
||||||
key: "url",
|
|
||||||
// width: 150,
|
|
||||||
align: "center",
|
|
||||||
render: (h, params) => {
|
|
||||||
if (isImageFile(params.row)) {
|
|
||||||
return h("img", {
|
|
||||||
attrs: {
|
|
||||||
src: params.row.url || "",
|
|
||||||
alt: "加载图片失败",
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showPic(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else if (isVideoFile(params.row)) {
|
|
||||||
// 如果视频文件大小超过5MB不予加载video
|
|
||||||
if (params.row.fileSize < 1024 * 1024 * 5) {
|
|
||||||
return h(
|
|
||||||
"video",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showVideo(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[
|
|
||||||
h("source", {
|
|
||||||
attrs: {
|
|
||||||
src: params.row.url,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return h("img", {
|
|
||||||
attrs: {
|
|
||||||
src: playIcon,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
cursor: "pointer",
|
|
||||||
width: "80px",
|
|
||||||
height: "60px",
|
|
||||||
margin: "10px 0",
|
|
||||||
"object-fit": "contain",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
showVideo(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return h("span", "非多媒体类型");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "上传者",
|
|
||||||
key: "createBy",
|
|
||||||
width: 120,
|
|
||||||
sortable: true,
|
|
||||||
render: (h, params) => {
|
|
||||||
let m;
|
|
||||||
if (params.row.userEnums == "MANAGER") {
|
|
||||||
m = "[管理员]";
|
|
||||||
} else if (params.row.userEnums == "STORE") {
|
|
||||||
m = "[商家]";
|
|
||||||
} else if (params.row.userEnums == "CUSTOMER") {
|
|
||||||
m = "[客服]";
|
|
||||||
} else {
|
|
||||||
m = "[用户]";
|
|
||||||
}
|
|
||||||
m += params.row.createBy;
|
|
||||||
return h("span", m);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
key: "action",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
width: 300,
|
|
||||||
render: (h, params) => {
|
|
||||||
return h("div", [
|
|
||||||
h(
|
|
||||||
"Button",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
type: "default",
|
|
||||||
size: "small",
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
marginRight: "5px",
|
|
||||||
display:
|
|
||||||
selectImage.value === true ? "inline-block" : "none",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
selectedParams(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"选择"
|
|
||||||
)
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const data = ref([]); // 表单数据
|
const data = ref([]); // 表单数据
|
||||||
const total = ref(0); // 表单数据总数
|
const total = ref(0); // 表单数据总数
|
||||||
const pageSizeOpts = ref([5, 10, 20]); // 页码展示项
|
const pageSizeOpts = ref([5, 10, 20]); // 页码展示项
|
||||||
@@ -843,51 +499,12 @@ const insertOrUpdate = ref("insert");
|
|||||||
const groupLoading = ref(false);
|
const groupLoading = ref(false);
|
||||||
// 图片列表
|
// 图片列表
|
||||||
const selectedOss = ref([]);
|
const selectedOss = ref([]);
|
||||||
const buttonProps = {type: 'default', size: 'small',};
|
|
||||||
// 历史遗留死代码:模板未使用 myData,其 render 中的 append 从未定义,原样保留
|
|
||||||
const myData = ref([
|
|
||||||
{
|
|
||||||
title: 'parent 1',
|
|
||||||
expand: true,
|
|
||||||
render: (h, {root, node, data}) => {
|
|
||||||
return h('span', {style: {display: 'inline-block', width: '100%'}}, [
|
|
||||||
h('span', [h("Icon", {type: 'ios-folder-outline', style: {marginRight: '8px'}}), h('span', data.title)]),
|
|
||||||
h('span', {style: {display: 'inline-block', float: 'right', marginRight: '32px'}},
|
|
||||||
[h("Button", {
|
|
||||||
...buttonProps,
|
|
||||||
icon: 'ios-add',
|
|
||||||
type: 'primary',
|
|
||||||
style: {width: '64px'},
|
|
||||||
onClick: () => {
|
|
||||||
// eslint-disable-next-line no-undef -- 历史遗留:append 从未定义,原样保留
|
|
||||||
append(data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
])
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: 'child 1-1',
|
|
||||||
expand: true,
|
|
||||||
children: [{title: 'leaf 1-1-1', expand: true}, {title: 'leaf 1-1-2', expand: true}]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'child 1-2',
|
|
||||||
expand: true,
|
|
||||||
children: [{title: 'leaf 1-2-1', expand: true}, {title: 'leaf 1-2-1', expand: true}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 模板 ref:up/form/formValidate 与顶层变量重名,改名避免互相覆盖
|
// 模板 ref:up/form/formValidate 与顶层变量重名,改名避免互相覆盖
|
||||||
const upRef = ref(null);
|
const upRef = ref(null);
|
||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
const formValidateRef = ref(null);
|
const formValidateRef = ref(null);
|
||||||
const dplayerRef = ref(null);
|
const dplayerRef = ref(null);
|
||||||
// 历史遗留:模板中不存在 ref="table",clearSelectAll 调用会报错,原样保留
|
|
||||||
const tableRef = ref(null);
|
|
||||||
|
|
||||||
watch(selectImage, (val) => {
|
watch(selectImage, (val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
@@ -989,18 +606,6 @@ function onMouseOver(item, index) {
|
|||||||
function onMouseOut(item, index) {
|
function onMouseOut(item, index) {
|
||||||
data.value[index].isShowPreview = false;
|
data.value[index].isShowPreview = false;
|
||||||
}
|
}
|
||||||
function handleRoleTabChange(name) {
|
|
||||||
activeRoleTab.value = name;
|
|
||||||
searchForm.pageNumber = 1;
|
|
||||||
searchForm.userEnums = name;
|
|
||||||
delete searchForm.fileDirectoryId;
|
|
||||||
selectedGroupData.value = "";
|
|
||||||
groupFormValidate.value.id = "";
|
|
||||||
groupFormValidate.value.level = 0;
|
|
||||||
selectedOss.value = [];
|
|
||||||
updateTreeDataByRole();
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
function handleCategoryTabChange(name) {
|
function handleCategoryTabChange(name) {
|
||||||
activeCategoryTab.value = name;
|
activeCategoryTab.value = name;
|
||||||
searchForm.fileCategory = name;
|
searchForm.fileCategory = name;
|
||||||
@@ -1089,62 +694,7 @@ function pageChange(value) {
|
|||||||
searchForm.pageNumber = value;
|
searchForm.pageNumber = value;
|
||||||
getDataList();
|
getDataList();
|
||||||
}
|
}
|
||||||
// 自定义tree节点显示内容和交互
|
|
||||||
function renderContent(h, {root, node, data}) {
|
|
||||||
if (data.value === '0') {
|
|
||||||
return h('span', {style: {display: 'inline-block', width: '100%'}},
|
|
||||||
[
|
|
||||||
h('span', [h("Icon", {type: 'ios-paper-outline', style: {marginRight: '8px'}}), h('span', data.title)]),
|
|
||||||
h('span', {style: {display: 'inline-block', float: 'right', marginRight: '10px'}}, [])
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return h('span', {style: {display: 'inline-block', width: '100%'}},
|
|
||||||
[
|
|
||||||
h('span', [h("Icon", {type: 'ios-paper-outline', style: {marginRight: '8px'}}), h('span', data.title)]),
|
|
||||||
h('span', {style: {display: 'inline-block', float: 'right', marginRight: '10px'}},
|
|
||||||
[
|
|
||||||
h("Dropdown", {style: {marginLeft: "4px"}},
|
|
||||||
[
|
|
||||||
h("Icon", {
|
|
||||||
props: {type: 'ios-more', size: "20",},
|
|
||||||
style: {display: 'inline-block'},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
h("DropdownMenu", {
|
|
||||||
slot: "list"
|
|
||||||
}, [
|
|
||||||
h("DropdownItem", {
|
|
||||||
nativeOn: {
|
|
||||||
click: () => {
|
|
||||||
handleContextMenuEdit(root, node, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, "编辑"),
|
|
||||||
h("DropdownItem", {
|
|
||||||
nativeOn: {
|
|
||||||
click: () => {
|
|
||||||
handleContextMenuDelete()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, "删除"),
|
|
||||||
])
|
|
||||||
]),
|
|
||||||
])
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function handleContextMenu(val) {
|
|
||||||
console.log('handleContextMenu', val);
|
|
||||||
selectedGroupData.value = val;
|
|
||||||
}
|
|
||||||
// 编辑分组
|
// 编辑分组
|
||||||
function handleContextMenuEdit(root, node, data) {
|
function handleContextMenuEdit(root, node, data) {
|
||||||
insertOrUpdate.value = "update";
|
insertOrUpdate.value = "update";
|
||||||
@@ -1202,20 +752,6 @@ function handleClickAddGroup() {
|
|||||||
};
|
};
|
||||||
enableGroup.value = true;
|
enableGroup.value = true;
|
||||||
}
|
}
|
||||||
function copyFileUrl(row) {
|
|
||||||
const textArea = document.createElement("textarea");
|
|
||||||
textArea.value = row.url;
|
|
||||||
document.body.appendChild(textArea);
|
|
||||||
textArea.focus();
|
|
||||||
textArea.select();
|
|
||||||
try {
|
|
||||||
document.execCommand("copy");
|
|
||||||
ElMessage.success("复制成功");
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Unable to copy to clipboard", err);
|
|
||||||
}
|
|
||||||
document.body.removeChild(textArea);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取全部文件目录
|
// 获取全部文件目录
|
||||||
function getAllList(parent_id) {
|
function getAllList(parent_id) {
|
||||||
@@ -1270,12 +806,6 @@ function handleCateChange(data) {
|
|||||||
selectedOss.value = [];
|
selectedOss.value = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 选择
|
|
||||||
*/
|
|
||||||
function selectedParams(val) {
|
|
||||||
emit("callback", val);
|
|
||||||
}
|
|
||||||
function handleSelectConfirm() {
|
function handleSelectConfirm() {
|
||||||
if (!selectedOss.value.length) {
|
if (!selectedOss.value.length) {
|
||||||
ElMessage.warning("请选择图片");
|
ElMessage.warning("请选择图片");
|
||||||
@@ -1341,38 +871,6 @@ function closeVideo() {
|
|||||||
}
|
}
|
||||||
pendingVideoUrl.value = "";
|
pendingVideoUrl.value = "";
|
||||||
}
|
}
|
||||||
// 分页 改变页码
|
|
||||||
function changePage(v) {
|
|
||||||
searchForm.pageNumber = v;
|
|
||||||
getDataList();
|
|
||||||
clearSelectAll();
|
|
||||||
}
|
|
||||||
// 分页 改变页数
|
|
||||||
function changePageSize(v) {
|
|
||||||
searchForm.pageNumber = 1;
|
|
||||||
searchForm.pageSize = v;
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
// 排序
|
|
||||||
function changeSort(e) {
|
|
||||||
searchForm.sort = e.key;
|
|
||||||
searchForm.order = e.order;
|
|
||||||
if (e.order == "normal") {
|
|
||||||
searchForm.order = "";
|
|
||||||
}
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
// 起止时间筛选已移除
|
|
||||||
// 改变查看方式
|
|
||||||
function changeShowType() {
|
|
||||||
searchForm.pageNumber = 1;
|
|
||||||
if (showType.value == "list") {
|
|
||||||
searchForm.pageSize = 20;
|
|
||||||
} else {
|
|
||||||
searchForm.pageSize = 12;
|
|
||||||
}
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
function getDataList(type = null) {
|
function getDataList(type = null) {
|
||||||
if (showType.value == "list") {
|
if (showType.value == "list") {
|
||||||
@@ -1399,18 +897,6 @@ function getDataList(type = null) {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 兼容外部按场景切换分类(如装修选图/选视频)
|
|
||||||
function changeFileType() {
|
|
||||||
const categoryMap = {
|
|
||||||
pic: "IMAGE",
|
|
||||||
video: "VIDEO",
|
|
||||||
file: "FILE",
|
|
||||||
all: "IMAGE",
|
|
||||||
};
|
|
||||||
const category = categoryMap[fileType.value] || "IMAGE";
|
|
||||||
activeCategoryTab.value = category;
|
|
||||||
handleCategoryTabChange(category);
|
|
||||||
}
|
|
||||||
function isImageFile(row) {
|
function isImageFile(row) {
|
||||||
return row?.fileCategory === "IMAGE" || (row?.fileType && row.fileType.includes("image"));
|
return row?.fileCategory === "IMAGE" || (row?.fileType && row.fileType.includes("image"));
|
||||||
}
|
}
|
||||||
@@ -1457,10 +943,6 @@ function handleSuccess(res, file) {
|
|||||||
function handleError(error, file, fileList) {
|
function handleError(error, file, fileList) {
|
||||||
ElMessage.error(error.toString());
|
ElMessage.error(error.toString());
|
||||||
}
|
}
|
||||||
// 清空上传文件
|
|
||||||
function clearFiles() {
|
|
||||||
upRef.value.clearFiles();
|
|
||||||
}
|
|
||||||
// 取消修改文件名
|
// 取消修改文件名
|
||||||
function handleCancel() {
|
function handleCancel() {
|
||||||
modalVisible.value = false;
|
modalVisible.value = false;
|
||||||
@@ -1491,9 +973,7 @@ function removeAll() {
|
|||||||
ElMessage.success("批量删除文件成功");
|
ElMessage.success("批量删除文件成功");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
console.log("失败", err);
|
|
||||||
});
|
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
// 单个删除文件
|
// 单个删除文件
|
||||||
@@ -1529,37 +1009,6 @@ function handleSubmit() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 修改文件名modal
|
|
||||||
function rename(v) {
|
|
||||||
modalTitle.value = "编辑文件名";
|
|
||||||
// 转换null为""
|
|
||||||
for (let attr in v) {
|
|
||||||
if (v[attr] == null) {
|
|
||||||
v[attr] = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let str = JSON.stringify(v);
|
|
||||||
let data = JSON.parse(str);
|
|
||||||
form.value = data;
|
|
||||||
oldKey.value = data.fileKey;
|
|
||||||
modalVisible.value = true;
|
|
||||||
}
|
|
||||||
// 清除选中状态
|
|
||||||
function clearSelectAll() {
|
|
||||||
tableRef.value.selectAll(false);
|
|
||||||
totalSize.value = "";
|
|
||||||
}
|
|
||||||
// 选中回调
|
|
||||||
function changeSelect(e) {
|
|
||||||
selectList.value = e;
|
|
||||||
selectCount.value = e.length;
|
|
||||||
let size = 0;
|
|
||||||
e.forEach((item) => {
|
|
||||||
size += item.fileSize * 1.0;
|
|
||||||
});
|
|
||||||
totalSize.value = ((size * 1.0) / (1024 * 1024)).toFixed(2) + " MB";
|
|
||||||
emit("selected", e)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!props.isComponent) {
|
if (!props.isComponent) {
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ module.exports = {
|
|||||||
args[0].cdn = { css: [], js: [] };
|
args[0].cdn = { css: [], js: [] };
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
|
if (enableProduction) {
|
||||||
|
// 生产构建剥离 console.*,防止调试日志残留上线
|
||||||
|
config.optimization.minimizer("terser").tap((args) => {
|
||||||
|
args[0].terserOptions.compress = args[0].terserOptions.compress || {};
|
||||||
|
args[0].terserOptions.compress.drop_console = true;
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
pluginOptions: {
|
pluginOptions: {
|
||||||
"style-resources-loader": {
|
"style-resources-loader": {
|
||||||
|
|||||||
Reference in New Issue
Block a user