@@ -127,36 +100,9 @@ import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission";
import { buildDateTextList, formatMoney, formatQuantity, sumNumber, toUnixRange } from "@/pages/product/component/chartUtils";
-const pageNavBarRight = reactive({
- icon: "",
- badge: undefined as number | undefined,
- text: "",
- textColor: "",
- disabled: false,
- action: undefined as (() => void | Promise
) | undefined
-});
-function setPageNavBarRightIcon(value?: string, action?: () => void | Promise): void {
- pageNavBarRight.icon = value || "";
- pageNavBarRight.badge = undefined;
- pageNavBarRight.disabled = false;
- pageNavBarRight.action = action;
- if (value) {
- pageNavBarRight.text = "";
- pageNavBarRight.textColor = "";
- }
-}
-function clearPageNavBarRight(): void {
- Object.assign(pageNavBarRight, { icon: "", badge: undefined, text: "", textColor: "", disabled: false, action: undefined });
-}
-async function handlePageNavBarRightAction(): Promise {
- if (pageNavBarRight.disabled || !pageNavBarRight.action) {
- return;
- }
- await pageNavBarRight.action();
-}
import { getCurrentStoreId } from "@/utils/store";
@@ -211,15 +157,11 @@ watch(storeId, async () => {
}, { immediate: true });
onMounted(async () => {
- setPageNavBarRightIcon("refresh", reload);
if (!currentStoreStore.currentStoreId) {
await currentStoreStore.loadLoginStore();
}
});
-onUnmounted(() => {
- clearPageNavBarRight();
-});
async function reload(): Promise {
clearStoreChartCache();
@@ -428,44 +370,4 @@ function pad(value: number): string {
}
}
-.nav-right-slot {
- width: 6rem;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-end;
-
- .badge {
- :deep(.t-badge__content) {
- display: flex;
- align-items: center;
- }
- }
-
- .button,
- .nav-text {
- color: var(--td-text-color-primary, #333);
- border: none;
- padding: 0;
- display: inline-flex;
- background: transparent;
- align-items: center;
- justify-content: center;
- }
-
- .button {
- &:disabled {
- color: var(--td-text-color-disabled);
- cursor: not-allowed;
- }
- }
-
- .nav-text {
- font: inherit;
- cursor: default;
-
- &.clickable { cursor: pointer; }
- &.disabled { cursor: not-allowed; }
- }
-}
diff --git a/src/pages/product/ProductEdit.vue b/src/pages/product/ProductEdit.vue
index 0bc0414..7cc4edf 100644
--- a/src/pages/product/ProductEdit.vue
+++ b/src/pages/product/ProductEdit.vue
@@ -7,41 +7,14 @@
@left-click="$router.back()"
>
-
-
-
-
-
-
-
+ 保存
+
@@ -261,37 +234,6 @@ import { formatProductAmount, getProductStatusText, getProductTypeText, normaliz
import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission";
-const pageNavBarRight = reactive({
- icon: "",
- badge: undefined as number | undefined,
- text: "",
- textColor: "",
- disabled: false,
- action: undefined as (() => void | Promise
) | undefined
-});
-
-function setPageNavBarRightText(value?: string, color?: string, action?: () => void | Promise): void {
- pageNavBarRight.text = value || "";
- pageNavBarRight.textColor = color || "";
- pageNavBarRight.disabled = false;
- pageNavBarRight.action = action;
- if (value) {
- pageNavBarRight.badge = undefined;
- pageNavBarRight.icon = "";
- }
-}
-
-function clearPageNavBarRight(): void {
- Object.assign(pageNavBarRight, { icon: "", badge: undefined, text: "", textColor: "", disabled: false, action: undefined });
-}
-
-async function handlePageNavBarRightAction(): Promise {
- if (pageNavBarRight.disabled || !pageNavBarRight.action) {
- return;
- }
- await pageNavBarRight.action();
-}
-
import type { PhotoItem } from "@/types/Photo";
type PickerValue = string | number;
@@ -1177,18 +1119,12 @@ async function load(): Promise {
}
onMounted(async () => {
- clearPageNavBarRight();
- if (userStore.hasPermissions(savePermissionCode.value)) {
- setPageNavBarRightText("保存", "var(--td-brand-color)", save);
- }
try {
await load();
} catch (error) {
Message.error(getErrorMessage(error, "产品加载失败"));
}
});
-
-onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/product/ProductStockBatchConfigure.vue b/src/pages/product/ProductStockBatchConfigure.vue
index 0f22fd9..0b4fe12 100644
--- a/src/pages/product/ProductStockBatchConfigure.vue
+++ b/src/pages/product/ProductStockBatchConfigure.vue
@@ -7,41 +7,14 @@
@left-click="$router.back()"
>
-
-
-
-
-
-
-
+