+
@@ -37,7 +36,6 @@
diff --git a/src/pages/ai/AiChatPage.vue b/src/pages/ai/AiChatPage.vue
index ca241cc..0b595aa 100644
--- a/src/pages/ai/AiChatPage.vue
+++ b/src/pages/ai/AiChatPage.vue
@@ -1,6 +1,26 @@
+
+
+
+
+
`${userStore.loginUser.user?.id || userStore.l
const canUseAi = computed(() => userStore.hasRoles(gaoRoleCodes.storeManager));
const isGlobalManager = computed(() => userStore.hasRoles(gaoRoleCodes.globalManager));
const aiStoreId = computed(() => canUseAi.value && isGlobalManager.value ? currentStoreStore.currentStoreId : undefined);
+type AiChatPanelExpose = {
+ isBusy: boolean;
+ openConversationList: () => void;
+};
+const aiChatPanelRef = useTemplateRef("aiChatPanel");
function startNewConversation(): void {
conversationResetToken.value += 1;
@@ -33,6 +58,18 @@ function startNewConversation(): void {
diff --git a/src/pages/customer/CustomerEdit.vue b/src/pages/customer/CustomerEdit.vue
index bf93810..4e47200 100644
--- a/src/pages/customer/CustomerEdit.vue
+++ b/src/pages/customer/CustomerEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -236,8 +281,6 @@ import type { MediaSelectorAddAction } from "@/components/mediaSelector/types";
import TagSelector from "@/components/TagSelector.vue";
import CustomerTagCard from "@/pages/customer/component/CustomerTagCard.vue";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
-import { useNavBarStore } from "@/store/navBarStore";
-import { useSettingStore } from "@/store/settingStore";
import type { BodyAreaValue, Customer, CustomerAttachmentType, EditableCustomerPhoto } from "@/types/Customer";
import type { Tag } from "@/types/Tag";
import { bodyAreaLabelMap } from "@/utils/bodyArea";
@@ -247,16 +290,63 @@ import { corePermissionCodes, gaoRoleCodes, permissionCodes } from "@/utils/perm
import { compressUploadImage } from "@/utils/imageCompression";
import { saveCapturedFilesFromInput } from "@/utils/twaBridge";
+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 setPageNavBarRightDisabled(value: boolean): void {
+ pageNavBarRight.disabled = value;
+}
+
+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 { useSettingStore } from "@/store/settingStore";
+
defineOptions({
name: "CustomerEdit"
});
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "CustomerCreate":
+ return "新增客户";
+ case "CustomerEdit":
+ return "编辑客户";
+ default:
+ return "";
+ }
+});
const router = useRouter();
const userStore = useUserStore();
const settingStore = useSettingStore();
const currentStoreStore = useCurrentStoreStore();
-const navBarStore = useNavBarStore();
const isCreateMode = computed(() => route.name === "CustomerCreate");
const savePermissionCode = computed(() => isCreateMode.value ? permissionCodes.customer.create : permissionCodes.customer.update);
const hasCustomerDeletePermission = computed(() => userStore.hasPermissions(permissionCodes.customer.delete));
@@ -497,7 +587,7 @@ function handlePhotoAction(action: MediaSelectorAddAction): void {
}
watch(isCustomerBound, (value) => {
- navBarStore.setRightDisabled(value);
+ setPageNavBarRightDisabled(value);
if (!value) {
return;
}
@@ -553,10 +643,10 @@ async function loadDetail() {
onMounted(loadDetail);
onMounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (userStore.hasPermissions(savePermissionCode.value)) {
- navBarStore.setRightText("保存", "var(--td-brand-color)", doSubmit);
- navBarStore.setRightDisabled(isCustomerBound.value);
+ setPageNavBarRightText("保存", "var(--td-brand-color)", doSubmit);
+ setPageNavBarRightDisabled(isCustomerBound.value);
}
});
@@ -741,7 +831,7 @@ async function toBoundCustomerEdit(): Promise {
}
onUnmounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
function buildAttachmentList(): Attachment[] {
@@ -862,5 +952,46 @@ function buildAttachmentList(): Attachment[] {
}
}
}
+
+.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/customer/CustomerInviteRank.vue b/src/pages/customer/CustomerInviteRank.vue
index 69805c6..88de49c 100644
--- a/src/pages/customer/CustomerInviteRank.vue
+++ b/src/pages/customer/CustomerInviteRank.vue
@@ -1,49 +1,58 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/customer/CustomerInviteRelation.vue b/src/pages/customer/CustomerInviteRelation.vue
index 430021e..29231a4 100644
--- a/src/pages/customer/CustomerInviteRelation.vue
+++ b/src/pages/customer/CustomerInviteRelation.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
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 { Customer } from "@/types/Customer";
+
type InviteColorLegendItem = {
color: string;
label: string;
@@ -69,7 +145,6 @@ defineOptions({
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
-const navBarStore = useNavBarStore();
const router = useRouter();
const chartComponent = ref>();
const customerList = ref([]);
@@ -197,7 +272,7 @@ async function toInviteRank(): Promise {
// ---------- 生命周期 ----------
onMounted(async () => {
- navBarStore.setRightText("排行", "var(--td-brand-color)", toInviteRank);
+ setPageNavBarRightText("排行", "var(--td-brand-color)", toInviteRank);
await loadCustomers();
});
@@ -206,7 +281,7 @@ watch(searchKeyword, () => {
});
onBeforeUnmount(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
@@ -299,4 +374,45 @@ onBeforeUnmount(() => {
}
}
}
+
+.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/customer/CustomerInviteeList.vue b/src/pages/customer/CustomerInviteeList.vue
index 0065490..ddcb49b 100644
--- a/src/pages/customer/CustomerInviteeList.vue
+++ b/src/pages/customer/CustomerInviteeList.vue
@@ -1,4 +1,11 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 清空
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- 删除
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 清空
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -467,4 +542,45 @@ onUnmounted(() => {
.option-popup {
padding: 1rem;
}
+
+.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/event/EventEdit.vue b/src/pages/event/EventEdit.vue
index f3d9f3c..29f7731 100644
--- a/src/pages/event/EventEdit.vue
+++ b/src/pages/event/EventEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -232,14 +277,45 @@ import type { ColorObject } from "tdesign-mobile-vue";
import EventAPI from "@/api/EventAPI";
import EventOptionEditor from "@/pages/event/component/EventOptionEditor.vue";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { EventBizType, EventItem, EventLimitType, EventOptionGroup, EventStatus, EventValueType, EventValueUnit } from "@/types/EventItem";
import { getErrorMessage } from "@/utils/error";
import { normalizeEventOptionGroupList, prepareEventOptionGroupList, validateEventOptionGroupList } from "@/utils/eventOption";
import { getEventBizTypeText } from "@/utils/event";
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
import { Message } from "@/utils/message";
+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 { EventBizType, EventItem, EventLimitType, EventOptionGroup, EventStatus, EventValueType, EventValueUnit } from "@/types/EventItem";
+
type PickerValue = string | number;
type LimitOption = {
@@ -252,8 +328,18 @@ defineOptions({
});
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "EventCreate":
+ return "新增登记事件";
+ case "EventEdit":
+ return "编辑登记事件";
+ default:
+ return "";
+ }
+});
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
const routeId = computed(() => String(route.params.id || ""));
@@ -724,9 +810,9 @@ async function fillForm(): Promise {
}
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (userStore.hasPermissions(savePermissionCode.value)) {
- navBarStore.setRightText("保存", "var(--td-brand-color)", saveEventItem);
+ setPageNavBarRightText("保存", "var(--td-brand-color)", saveEventItem);
}
try {
await fillForm();
@@ -735,7 +821,7 @@ onMounted(async () => {
}
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/event/EventList.vue b/src/pages/event/EventList.vue
index c00db68..58b6541 100644
--- a/src/pages/event/EventList.vue
+++ b/src/pages/event/EventList.vue
@@ -1,107 +1,169 @@
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
- 删除
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
-
-
@@ -418,4 +478,46 @@ onUnmounted(() => {
}
}
}
+
+.nav-actions {
+ --td-popover-padding: 0 .5rem;
+
+ width: 6rem;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ :deep(.t-popover__content) { border-radius: .875rem; }
+
+ .trigger { padding: 0; }
+
+ .menu {
+ gap: .25rem;
+ display: grid;
+ padding: .5rem 0;
+ min-width: 9rem;
+
+ .menu-item {
+ --td-button-medium-height: 32px;
+ --td-button-medium-padding-horizontal: 10px;
+
+ gap: .25rem;
+ width: 100%;
+ font-weight: unset;
+ justify-content: flex-start;
+ }
+ }
+}
+
+:global(html.theme-dark) {
+ .nav-actions {
+ :deep(.t-popover__content) {
+ color: #e2e8f0;
+ background: rgba(30, 41, 59, .98);
+ }
+
+ .menu-item { color: #e2e8f0; }
+ }
+}
diff --git a/src/pages/event/EventRecordDetail.vue b/src/pages/event/EventRecordDetail.vue
index 1c0ac9b..0a2ca55 100644
--- a/src/pages/event/EventRecordDetail.vue
+++ b/src/pages/event/EventRecordDetail.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
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 { EventRecord } from "@/types/EventRecord";
+
defineOptions({
name: "EventRecordDetail"
});
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
// ---------- 记录数据 ----------
@@ -383,16 +458,16 @@ watch(() => route.params.id, async () => {
}, { immediate: true });
function updateNavBarAction(): void {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (canUpdateRecord.value) {
- navBarStore.setRightText("编辑", "var(--td-brand-color)", toEdit);
+ setPageNavBarRightText("编辑", "var(--td-brand-color)", toEdit);
}
}
watch(canUpdateRecord, updateNavBarAction, { immediate: true });
onUnmounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
@@ -435,5 +510,46 @@ onUnmounted(() => {
}
}
}
+
+.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/event/EventRecordEdit.vue b/src/pages/event/EventRecordEdit.vue
index d7dcf52..05c170e 100644
--- a/src/pages/event/EventRecordEdit.vue
+++ b/src/pages/event/EventRecordEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -222,8 +267,6 @@ import EventOptionSelector from "@/components/EventOptionSelector.vue";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import EventSelector from "@/components/EventSelector.vue";
import { useEventRecordPhoto } from "@/pages/event/component/useEventRecordPhoto";
-import { useNavBarStore } from "@/store/navBarStore";
-import { useSettingStore } from "@/store/settingStore";
import type { Customer } from "@/types/Customer";
import type { EventItem, EventOptionSelectionMap } from "@/types/EventItem";
import type { EventRecord } from "@/types/EventRecord";
@@ -233,15 +276,60 @@ import { getEventRecordPhotoURL, hasPhotoAttachment } from "@/utils/eventRecord"
import { getEventNumberValuePlaceholder, resolveEventNumberValue } from "@/utils/eventValue";
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 { useSettingStore } from "@/store/settingStore";
+
defineOptions({
name: "EventRecordEdit"
});
const router = useRouter();
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "CustomerEventRecordCreate":
+ return "登记";
+ case "EventRecordCreate":
+ return "新增登记事件记录";
+ case "EventRecordEdit":
+ return "编辑登记事件记录";
+ default:
+ return "";
+ }
+});
const settingStore = useSettingStore();
const userStore = useUserStore();
-const navBarStore = useNavBarStore();
// ---------- 路由权限 ----------
@@ -712,14 +800,14 @@ async function loadRecordForEdit(): Promise {
onMounted(loadPageData);
onMounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (userStore.hasPermissions(pageAccess.value)) {
- navBarStore.setRightText(saveButtonText.value, "var(--td-brand-color)", submitRecord);
+ setPageNavBarRightText(saveButtonText.value, "var(--td-brand-color)", submitRecord);
}
});
onUnmounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
watch(customerCode, async (value) => {
@@ -889,4 +977,45 @@ watch(customerCode, async (value) => {
}
}
}
+
+.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/event/EventRecordList.vue b/src/pages/event/EventRecordList.vue
index 11a9214..1fe92b3 100644
--- a/src/pages/event/EventRecordList.vue
+++ b/src/pages/event/EventRecordList.vue
@@ -1,141 +1,197 @@
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
@@ -805,4 +865,46 @@ onUnmounted(() => {
}
}
}
+
+.nav-actions {
+ --td-popover-padding: 0 .5rem;
+
+ width: 6rem;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ :deep(.t-popover__content) { border-radius: .875rem; }
+
+ .trigger { padding: 0; }
+
+ .menu {
+ gap: .25rem;
+ display: grid;
+ padding: .5rem 0;
+ min-width: 9rem;
+
+ .menu-item {
+ --td-button-medium-height: 32px;
+ --td-button-medium-padding-horizontal: 10px;
+
+ gap: .25rem;
+ width: 100%;
+ font-weight: unset;
+ justify-content: flex-start;
+ }
+ }
+}
+
+:global(html.theme-dark) {
+ .nav-actions {
+ :deep(.t-popover__content) {
+ color: #e2e8f0;
+ background: rgba(30, 41, 59, .98);
+ }
+
+ .menu-item { color: #e2e8f0; }
+ }
+}
diff --git a/src/pages/event/EventRecordRank.vue b/src/pages/event/EventRecordRank.vue
index 08fa4e4..193950b 100644
--- a/src/pages/event/EventRecordRank.vue
+++ b/src/pages/event/EventRecordRank.vue
@@ -1,127 +1,136 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
@@ -238,4 +312,45 @@ onUnmounted(() => {
}
}
}
+
+.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/followUpReminder/FollowUpReminderDetail.vue b/src/pages/followUpReminder/FollowUpReminderDetail.vue
index 1d8fd48..8681b3b 100644
--- a/src/pages/followUpReminder/FollowUpReminderDetail.vue
+++ b/src/pages/followUpReminder/FollowUpReminderDetail.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -89,12 +134,43 @@ import { getErrorMessage } from "@/utils/error";
import FollowUpReminderAPI from "@/api/FollowUpReminderAPI";
import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { FollowUpReminder, FollowUpReminderNotifyChannel, FollowUpReminderStatus } from "@/types/FollowUpReminder";
import type { PhotoItem } from "@/types/Photo";
import { getAttachmentReadURL } from "@/utils/attachment";
import { corePermissionCodes, 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 { FollowUpReminder, FollowUpReminderNotifyChannel, FollowUpReminderStatus } from "@/types/FollowUpReminder";
+
type NotifyTagTheme = "default" | "success" | "warning" | "primary" | "danger";
defineOptions({
@@ -103,7 +179,6 @@ defineOptions({
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const detail = ref();
@@ -181,7 +256,7 @@ async function loadDetail(): Promise {
loadToken = token;
detail.value = undefined;
internalNotifyStatus.value = undefined;
- navBarStore.clearRight();
+ clearPageNavBarRight();
const id = String(route.params.id || "");
if (!id) {
return;
@@ -207,7 +282,7 @@ async function loadDetail(): Promise {
function setEditAction(): void {
if (canUpdate.value) {
- navBarStore.setRightText("编辑", "var(--td-brand-color)", toEdit);
+ setPageNavBarRightText("编辑", "var(--td-brand-color)", toEdit);
}
}
@@ -305,7 +380,7 @@ function confirmDelete(): void {
async function remove(id: string): Promise {
isDeleting.value = true;
- navBarStore.clearRight();
+ clearPageNavBarRight();
try {
await FollowUpReminderAPI.remove(id);
Message.success("跟进提醒已删除");
@@ -322,7 +397,7 @@ watch(() => route.params.id, async () => {
await loadDetail();
}, { immediate: true });
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/followUpReminder/FollowUpReminderEdit.vue b/src/pages/followUpReminder/FollowUpReminderEdit.vue
index d9b3d35..c42d8ab 100644
--- a/src/pages/followUpReminder/FollowUpReminderEdit.vue
+++ b/src/pages/followUpReminder/FollowUpReminderEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -120,8 +165,6 @@ import CustomerSelector from "@/components/CustomerSelector.vue";
import ManagedUserSelector from "@/pages/followUpReminder/component/ManagedUserSelector.vue";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { Customer } from "@/types/Customer";
import type { ManagedUser } from "@/types/ManagedUser";
import type {
FollowUpReminder,
@@ -135,15 +178,58 @@ import { getAttachmentReadURL } from "@/utils/attachment";
import { parseDateTime } from "@/utils/date";
import { gaoRoleCodes, 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 { Customer } from "@/types/Customer";
+
defineOptions({
name: "FollowUpReminderEdit"
});
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "CustomerFollowUpReminderCreate":
+ return "新增跟进提醒";
+ case "CustomerFollowUpReminderEdit":
+ return "编辑跟进提醒";
+ default:
+ return "";
+ }
+});
const router = useRouter();
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
-const navBarStore = useNavBarStore();
const routeId = computed(() => String(route.params.id || ""));
const isEditMode = computed(() => !!routeId.value);
@@ -567,7 +653,7 @@ async function save(): Promise {
}
onMounted(async () => {
- navBarStore.setRightText(isEditMode.value ? "保存" : "提交", "var(--td-brand-color)", save);
+ setPageNavBarRightText(isEditMode.value ? "保存" : "提交", "var(--td-brand-color)", save);
try {
await loadForm();
} catch (error) {
@@ -575,7 +661,7 @@ onMounted(async () => {
}
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/followUpReminder/FollowUpReminderList.vue b/src/pages/followUpReminder/FollowUpReminderList.vue
index 9e45e65..215a0a3 100644
--- a/src/pages/followUpReminder/FollowUpReminderList.vue
+++ b/src/pages/followUpReminder/FollowUpReminderList.vue
@@ -1,180 +1,236 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 完成
+ 删除
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
-
diff --git a/src/pages/fulfillment/OrderFulfillmentCreate.vue b/src/pages/fulfillment/OrderFulfillmentCreate.vue
index 72889f3..14d04d1 100644
--- a/src/pages/fulfillment/OrderFulfillmentCreate.vue
+++ b/src/pages/fulfillment/OrderFulfillmentCreate.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -150,8 +195,6 @@ import { Time } from "timi-web";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import ProductSkuTags from "@/components/ProductSkuTags.vue";
import ProductStockPreview from "@/components/ProductStockPreview.vue";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { Attachment } from "timi-web-api";
import { useUserStore } from "timi-web-api";
import type { GaoOrderFulfillmentItemRequest } from "@/types/Fulfillment";
import type { GaoSalesOrderItem, SalesOrder } from "@/types/SalesOrder";
@@ -178,10 +221,42 @@ import {
import { uploadPhotoList } from "@/utils/photo";
import { getProductPhotoURL, getProductQuantityStep } from "@/utils/product";
+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 { Attachment } from "timi-web-api";
+
defineOptions({ name: "OrderFulfillmentCreate" });
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const order = ref();
const quantityMap = reactive>({});
@@ -615,12 +690,12 @@ async function save(): Promise {
}
onMounted(async () => {
- navBarStore.setRightText("提交", "var(--td-brand-color)", save);
+ setPageNavBarRightText("提交", "var(--td-brand-color)", save);
await loadData();
});
onUnmounted(() => {
window.clearTimeout(stockPreviewTimer);
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
@@ -750,4 +825,45 @@ onUnmounted(() => {
}
}
+
+.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/fulfillment/OrderFulfillmentDetail.vue b/src/pages/fulfillment/OrderFulfillmentDetail.vue
index 96ef137..c8db602 100644
--- a/src/pages/fulfillment/OrderFulfillmentDetail.vue
+++ b/src/pages/fulfillment/OrderFulfillmentDetail.vue
@@ -1,4 +1,11 @@
+
@@ -131,8 +138,6 @@ import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import ProductSkuTags from "@/components/ProductSkuTags.vue";
import ProductStockPreview from "@/components/ProductStockPreview.vue";
import OrderFulfillmentRevoke from "@/pages/fulfillment/components/OrderFulfillmentRevoke.vue";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { OrderFulfillment, OrderFulfillmentItem } from "@/types/Fulfillment";
import type { GaoSalesOrderItemType, SalesOrder } from "@/types/SalesOrder";
import type { PhotoItem } from "@/types/Photo";
import { addPackageQuantity, getPackageQuantityText } from "@/utils/package";
@@ -146,11 +151,12 @@ import { permissionCodes } from "@/utils/permission";
import type { ProductStockPreviewItem } from "@/utils/productStock";
import { buildProductStockPreview, mergeProductStockRequirements } from "@/utils/productStock";
+import type { OrderFulfillment, OrderFulfillmentItem } from "@/types/Fulfillment";
+
type ReasonAction = "reject" | "cancel";
defineOptions({ name: "OrderFulfillmentDetail" });
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const fulfillment = ref();
const order = ref();
@@ -341,7 +347,6 @@ async function submitReason(): Promise {
finally { operating.value = false; }
}
onMounted(loadData);
-onUnmounted(() => navBarStore.clearRight());
diff --git a/src/pages/home/QuickSignInPage.vue b/src/pages/home/QuickSignInPage.vue
index c9bf404..1771788 100644
--- a/src/pages/home/QuickSignInPage.vue
+++ b/src/pages/home/QuickSignInPage.vue
@@ -1,4 +1,11 @@
+
diff --git a/src/pages/notify/NotifyCreate.vue b/src/pages/notify/NotifyCreate.vue
index 73741d5..017aefa 100644
--- a/src/pages/notify/NotifyCreate.vue
+++ b/src/pages/notify/NotifyCreate.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -82,7 +127,38 @@ import NotifyRecipientPicker, {
type NotifyRecipientScopeOption
} from "@/pages/notify/component/NotifyRecipientPicker.vue";
import { corePermissionCodes, coreRoleCodes, gaoRoleCodes, permissionCodes } from "@/utils/permission";
-import { useNavBarStore } from "@/store/navBarStore";
+
+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 { useCurrentStoreStore } from "@/store/currentStoreStore";
defineOptions({
@@ -90,7 +166,6 @@ defineOptions({
});
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
const notifyEditorRef = ref();
@@ -192,7 +267,7 @@ const scheduleDraftText = ref("");
const minimumScheduleText = computed(() => Time.formatDateTime(new Date(Time.now() + Time.M)));
function updateNavActionText(): void {
- navBarStore.setRightText(scheduleAtText.value ? "提交" : "发送", "var(--td-brand-color)", saveNotification);
+ setPageNavBarRightText(scheduleAtText.value ? "提交" : "发送", "var(--td-brand-color)", saveNotification);
}
watch(scheduleAtText, updateNavActionText);
@@ -356,7 +431,7 @@ async function loadRecipients(): Promise {
// ---------- 生命周期 ----------
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (!canCreate.value) {
return;
}
@@ -370,7 +445,7 @@ onMounted(async () => {
await loadRecipients();
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/notify/NotifyDetail.vue b/src/pages/notify/NotifyDetail.vue
index be20659..7bc783b 100644
--- a/src/pages/notify/NotifyDetail.vue
+++ b/src/pages/notify/NotifyDetail.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
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 { corePermissionCodes } from "@/utils/permission";
+
type NotifyTagTheme = "default" | "success" | "warning" | "primary" | "danger";
type RecipientFilter = "all" | "unread" | "read";
@@ -57,7 +133,6 @@ defineOptions({
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const canDeleteNotify = computed(() => userStore.hasPermissions(corePermissionCodes.notify.delete));
const canCancelNotify = computed(() => userStore.hasPermissions(corePermissionCodes.notify.cancel));
@@ -108,7 +183,7 @@ async function loadDetail(): Promise {
const requestToken = loadToken + 1;
loadToken = requestToken;
detail.value = undefined;
- navBarStore.clearRight();
+ clearPageNavBarRight();
const notifyId = String(route.params.id || "");
if (!notifyId) {
return;
@@ -133,7 +208,7 @@ async function loadDetail(): Promise {
function setRightAction(): void {
if (detail.value?.id && canDeleteNotify.value) {
- navBarStore.setRightText("删除", "var(--td-error-color)", confirmDelete);
+ setPageNavBarRightText("删除", "var(--td-error-color)", confirmDelete);
}
}
@@ -188,7 +263,7 @@ async function confirmDelete(): Promise {
async onConfirm() {
dialog.destroy();
isDeleting.value = true;
- navBarStore.clearRight();
+ clearPageNavBarRight();
try {
await NotifyAPI.managementDelete(notifyId);
Message.success("通知已删除");
@@ -257,8 +332,8 @@ watch(() => route.params.id, async () => {
await loadDetail();
}, { immediate: true });
-onMounted(() => navBarStore.clearRight());
-onUnmounted(() => navBarStore.clearRight());
+onMounted(() => clearPageNavBarRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/notify/NotifyList.vue b/src/pages/notify/NotifyList.vue
index 0633d6c..f1764ee 100644
--- a/src/pages/notify/NotifyList.vue
+++ b/src/pages/notify/NotifyList.vue
@@ -1,60 +1,108 @@
-
-
+
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 删除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取消
- 删除
-
-
-
-
-
-
+
+
+
+
+
+
@@ -64,7 +112,38 @@ import { NotifyAPI, type Notify, type NotifyManagementItem, type Page, type Page
import { DialogPlugin } from "tdesign-mobile-vue";
import { Message } from "@/utils/message";
import { getErrorMessage } from "@/utils/error";
-import { useNavBarStore } from "@/store/navBarStore";
+
+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 { corePermissionCodes } from "@/utils/permission";
type NotifyTagTheme = "default" | "success" | "warning" | "primary" | "danger";
@@ -75,7 +154,6 @@ defineOptions({
const pageSize = 20;
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const canReadNotify = computed(() => userStore.hasPermissions(corePermissionCodes.notify.read));
const canCreateNotify = computed(() => userStore.hasPermissions(corePermissionCodes.notify.create));
@@ -255,17 +333,17 @@ async function confirmDelete(item: NotifyManagementItem): Promise {
// ---------- 生命周期 ----------
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (!canReadNotify.value) {
return;
}
if (canCreateNotify.value) {
- navBarStore.setRightText("新建", "var(--td-brand-color)", toCreate);
+ setPageNavBarRightText("新建", "var(--td-brand-color)", toCreate);
}
await reloadList();
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/notify/NotifyRecipientList.vue b/src/pages/notify/NotifyRecipientList.vue
index 630a3a9..2199779 100644
--- a/src/pages/notify/NotifyRecipientList.vue
+++ b/src/pages/notify/NotifyRecipientList.vue
@@ -1,4 +1,11 @@
+
route.query.filter, () => {
recipientFilter.value = getRecipientFilterFromRoute();
});
-onMounted(() => navBarStore.clearRight());
diff --git a/src/pages/notify/UserNotifyList.vue b/src/pages/notify/UserNotifyList.vue
index 4a0a45f..86aea4d 100644
--- a/src/pages/notify/UserNotifyList.vue
+++ b/src/pages/notify/UserNotifyList.vue
@@ -1,67 +1,115 @@
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 未读
+
+
+
+ 未读
+ :loading="deletingId === item.id"
+ @click.stop="confirmDelete(item)"
+ >
+ 删除
+
-
-
-
- 删除
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -70,10 +118,41 @@ import { PassTimeLabel } from "timi-web";
import { NotifyAPI, type NotifyDetail, type Page, type PageResult, useUserStore } from "timi-web-api";
import { DialogPlugin } from "tdesign-mobile-vue";
import { Message } from "@/utils/message";
-import { useNavBarStore } from "@/store/navBarStore";
-import { getErrorMessage } from "@/utils/error";
import { corePermissionCodes } 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 { getErrorMessage } from "@/utils/error";
+
type NotifyFilter = "all" | "unread";
defineOptions({
@@ -82,7 +161,6 @@ defineOptions({
const pageSize = 20;
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const canReadNotify = computed(() => userStore.hasPermissions(corePermissionCodes.notify.read));
@@ -276,9 +354,9 @@ function updateNavBarAction(): void {
if (!isPageActive) {
return;
}
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (0 < unreadCount.value) {
- navBarStore.setRightText("全部已读", "var(--td-brand-color)", markAllRead);
+ setPageNavBarRightText("全部已读", "var(--td-brand-color)", markAllRead);
}
}
@@ -305,7 +383,7 @@ async function toDetail(item: NotifyDetail): Promise {
// ---------- 生命周期 ----------
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (!canReadNotify.value) {
return;
}
@@ -320,7 +398,7 @@ onMounted(async () => {
onUnmounted(() => {
isPageActive = false;
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
@@ -407,4 +485,45 @@ onUnmounted(() => {
}
}
}
+
+.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/package/PackageConfigDetail.vue b/src/pages/package/PackageConfigDetail.vue
index 98be8bf..a2b36df 100644
--- a/src/pages/package/PackageConfigDetail.vue
+++ b/src/pages/package/PackageConfigDetail.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -92,19 +137,49 @@ import { useUserStore } from "timi-web-api";
import PackageAPI from "@/api/PackageAPI";
import ProductSkuTags from "@/components/ProductSkuTags.vue";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { GaoPackageConfig, PackageConfigItem, PackageConfigStatus } from "@/types/Package";
import { getErrorMessage } from "@/utils/error";
import { formatPackageAmount, getPackageConfigStatusText } from "@/utils/package";
import { Message } from "@/utils/message";
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
import { getProductPhotoURL as getProductPhotoUrl } from "@/utils/product";
+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 { GaoPackageConfig, PackageConfigItem, PackageConfigStatus } from "@/types/Package";
+
defineOptions({ name: "PackageConfigDetail" });
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
const config = ref();
@@ -197,20 +272,20 @@ function removeConfig(): void {
onMounted(async () => {
await loadData();
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (canUpdate.value) {
- navBarStore.setRightText("编辑", "var(--td-brand-color)", toEdit);
+ setPageNavBarRightText("编辑", "var(--td-brand-color)", toEdit);
}
});
watch(canUpdate, value => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (value) {
- navBarStore.setRightText("编辑", "var(--td-brand-color)", toEdit);
+ setPageNavBarRightText("编辑", "var(--td-brand-color)", toEdit);
}
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/package/PackageConfigEdit.vue b/src/pages/package/PackageConfigEdit.vue
index 982b1af..7b9395c 100644
--- a/src/pages/package/PackageConfigEdit.vue
+++ b/src/pages/package/PackageConfigEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -112,29 +157,74 @@
diff --git a/src/pages/package/PackageConfigList.vue b/src/pages/package/PackageConfigList.vue
index 019ed6a..7d9917c 100644
--- a/src/pages/package/PackageConfigList.vue
+++ b/src/pages/package/PackageConfigList.vue
@@ -1,102 +1,163 @@
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
- ¥
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
@@ -313,4 +372,46 @@ onUnmounted(() => {
}
}
}
+
+.nav-actions {
+ --td-popover-padding: 0 .5rem;
+
+ width: 6rem;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ :deep(.t-popover__content) { border-radius: .875rem; }
+
+ .trigger { padding: 0; }
+
+ .menu {
+ gap: .25rem;
+ display: grid;
+ padding: .5rem 0;
+ min-width: 9rem;
+
+ .menu-item {
+ --td-button-medium-height: 32px;
+ --td-button-medium-padding-horizontal: 10px;
+
+ gap: .25rem;
+ width: 100%;
+ font-weight: unset;
+ justify-content: flex-start;
+ }
+ }
+}
+
+:global(html.theme-dark) {
+ .nav-actions {
+ :deep(.t-popover__content) {
+ color: #e2e8f0;
+ background: rgba(30, 41, 59, .98);
+ }
+
+ .menu-item { color: #e2e8f0; }
+ }
+}
diff --git a/src/pages/package/PackageOrderConfigList.vue b/src/pages/package/PackageOrderConfigList.vue
index 678a12f..0a25c8c 100644
--- a/src/pages/package/PackageOrderConfigList.vue
+++ b/src/pages/package/PackageOrderConfigList.vue
@@ -1,70 +1,80 @@
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -72,19 +82,18 @@
import { type DropdownValue } from "tdesign-mobile-vue";
import { Toolkit } from "timi-web";
import PackageAPI from "@/api/PackageAPI";
-import { useNavBarStore } from "@/store/navBarStore";
-import type { GaoPackageConfig, PackageConfigItem, PackageConfigStatus } from "@/types/Package";
import { getErrorMessage } from "@/utils/error";
import { Message } from "@/utils/message";
import { formatPackageAmount, getPackageConfigStatusText, getPackageQuantityText } from "@/utils/package";
import { permissionCodes } from "@/utils/permission";
import { getProductSkuSnapshotText } from "@/utils/product";
+import type { GaoPackageConfig, PackageConfigItem, PackageConfigStatus } from "@/types/Package";
+
defineOptions({ name: "PackageOrderConfigList" });
const route = useRoute();
const router = useRouter();
-const navBarStore = useNavBarStore();
const keyword = ref("");
const status = ref("ALL");
@@ -184,7 +193,6 @@ function getProductText(item: PackageConfigItem): string {
}
onMounted(async () => {
- navBarStore.clearRight();
try {
await reload();
} catch (error) {
@@ -193,7 +201,6 @@ onMounted(async () => {
});
onUnmounted(() => {
- navBarStore.clearRight();
reloadByKeyword.cancel();
});
diff --git a/src/pages/package/PackagePurchase.vue b/src/pages/package/PackagePurchase.vue
index 6eefd2c..0c4fd8c 100644
--- a/src/pages/package/PackagePurchase.vue
+++ b/src/pages/package/PackagePurchase.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -342,8 +387,6 @@ import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
import ProductSelectFormItem from "@/components/productSelector/ProductSelectFormItem.vue";
import ProductStockPreview from "@/components/ProductStockPreview.vue";
import { usePackagePurchase } from "@/pages/package/usePackagePurchase";
-import { useNavBarStore } from "@/store/navBarStore";
-import { useSettingStore } from "@/store/settingStore";
import type { Customer } from "@/types/Customer";
import type { PhotoItem } from "@/types/Photo";
import type { GaoPackageConfig, PackageAttachment, PackageConfigItem, PackagePurchaseItem } from "@/types/Package";
@@ -366,13 +409,56 @@ import type { ProductStockPreviewItem } from "@/utils/productStock";
import { uploadPhotoList } from "@/utils/photo";
import { getProductPhotoURL, getProductSkuSnapshotText } from "@/utils/product";
+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 { useSettingStore } from "@/store/settingStore";
+
defineOptions({
name: "PackagePurchase"
});
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "PackagePurchase":
+ return "购买套餐";
+ case "CustomerPackageCreate":
+ return "创建客户套餐";
+ default:
+ return "";
+ }
+});
const router = useRouter();
-const navBarStore = useNavBarStore();
const settingStore = useSettingStore();
const userStore = useUserStore();
@@ -938,9 +1024,9 @@ async function selectConfig(item: GaoPackageConfig): Promise {
}
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (userStore.hasPermissions(permissionCodes.customerPackage.create)) {
- navBarStore.setRightText("提交", "var(--td-brand-color)", submitRecord);
+ setPageNavBarRightText("提交", "var(--td-brand-color)", submitRecord);
}
try {
await loadPageData();
@@ -949,7 +1035,7 @@ onMounted(async () => {
}
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
watch(config, value => {
if (value) {
@@ -1199,4 +1285,45 @@ watch(config, value => {
}
}
}
+
+.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/permission/PermissionList.vue b/src/pages/permission/PermissionList.vue
index 2d800dd..b7385b0 100644
--- a/src/pages/permission/PermissionList.vue
+++ b/src/pages/permission/PermissionList.vue
@@ -1,33 +1,42 @@
-
-
-
-
diff --git a/src/pages/permission/PermissionSettings.vue b/src/pages/permission/PermissionSettings.vue
index 2c3f4bb..faad8c8 100644
--- a/src/pages/permission/PermissionSettings.vue
+++ b/src/pages/permission/PermissionSettings.vue
@@ -1,4 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
+
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 Role, usePermissionSettingsStore } from "@/store/permissionSettingsStore";
+
defineOptions({
name: "RoleDelegationPermissionAssign"
});
const permissionStore = usePermissionSettingsStore();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const route = useRoute();
@@ -146,15 +221,14 @@ async function savePermissionList(): Promise {
}
function updateNavBar(): void {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (canEditActiveRole.value && canUpdateRolePermission.value) {
- navBarStore.setRightText("保存", "var(--td-brand-color)", savePermissionList);
+ setPageNavBarRightText("保存", "var(--td-brand-color)", savePermissionList);
}
}
watch([canEditActiveRole, canUpdateRolePermission], updateNavBar, { immediate: true });
onMounted(updateNavBar);
-onUnmounted(navBarStore.clearRight);
// ---------- 权限勾选 ----------
@@ -258,4 +332,45 @@ onMounted(async () => {
}
}
}
+
+.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/permission/RoleEdit.vue b/src/pages/permission/RoleEdit.vue
index dcfe636..832604e 100644
--- a/src/pages/permission/RoleEdit.vue
+++ b/src/pages/permission/RoleEdit.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -102,7 +147,46 @@ import { BottomPopup } from "timi-tdesign-mobile";
import { Message } from "@/utils/message";
import { useUserStore } from "timi-web-api";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
-import { useNavBarStore } from "@/store/navBarStore";
+import { getErrorMessage } from "@/utils/error";
+import { corePermissionCodes, coreRoleCodes } from "@/utils/permission";
+import PermissionCell from "@/pages/permission/component/PermissionCell.vue";
+import PermissionLegend from "@/pages/permission/component/PermissionLegend.vue";
+
+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 setPageNavBarRightDisabled(value: boolean): void {
+ pageNavBarRight.disabled = value;
+}
+
+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 {
moduleCode,
type Permission,
@@ -110,18 +194,24 @@ import {
type RoleDraft,
usePermissionSettingsStore
} from "@/store/permissionSettingsStore";
-import { getErrorMessage } from "@/utils/error";
-import { corePermissionCodes, coreRoleCodes } from "@/utils/permission";
-import PermissionCell from "@/pages/permission/component/PermissionCell.vue";
-import PermissionLegend from "@/pages/permission/component/PermissionLegend.vue";
defineOptions({
name: "RoleEdit"
});
const route = useRoute();
+
+const routeNavBarTitle = computed(() => {
+ switch (route.name) {
+ case "RoleCreate":
+ return "新增角色";
+ case "RoleEdit":
+ return "编辑角色";
+ default:
+ return "";
+ }
+});
const router = useRouter();
-const navBarStore = useNavBarStore();
const permissionStore = usePermissionSettingsStore();
const currentStoreStore = useCurrentStoreStore();
const userStore = useUserStore();
@@ -467,13 +557,13 @@ async function getCurrentStoreId(): Promise {
}
function updateNavBar(): void {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (!hasSavePermission.value) {
return;
}
- navBarStore.setRightText("保存", "var(--td-brand-color)", saveBaseInfo);
- navBarStore.setRightDisabled(!canSaveBaseInfo.value);
+ setPageNavBarRightText("保存", "var(--td-brand-color)", saveBaseInfo);
+ setPageNavBarRightDisabled(!canSaveBaseInfo.value);
}
watch([hasSavePermission, canSaveBaseInfo], updateNavBar, { immediate: true });
@@ -483,7 +573,7 @@ onMounted(async () => {
updateNavBar();
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/permission/RoleList.vue b/src/pages/permission/RoleList.vue
index 605823f..3d34509 100644
--- a/src/pages/permission/RoleList.vue
+++ b/src/pages/permission/RoleList.vue
@@ -1,36 +1,83 @@
-
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ 删除
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
@@ -38,17 +85,47 @@
import { Message } from "@/utils/message";
import { useUserStore } from "timi-web-api";
import type { Role } from "@/store/permissionSettingsStore";
-import { useNavBarStore } from "@/store/navBarStore";
-import { usePermissionSettingsStore } from "@/store/permissionSettingsStore";
import { getErrorMessage } from "@/utils/error";
import { corePermissionCodes, coreRoleCodes } 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 { usePermissionSettingsStore } from "@/store/permissionSettingsStore";
+
defineOptions({
name: "RoleList"
});
const router = useRouter();
-const navBarStore = useNavBarStore();
const permissionStore = usePermissionSettingsStore();
const userStore = useUserStore();
const isRefreshing = ref(false);
@@ -113,9 +190,9 @@ async function refresh(): Promise {
}
onMounted(async () => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (canCreateRole.value) {
- navBarStore.setRightText("添加", "var(--td-brand-color)", toCreate);
+ setPageNavBarRightText("添加", "var(--td-brand-color)", toCreate);
}
await permissionStore.loadAll();
await refreshAuthorizationScope();
@@ -125,7 +202,7 @@ onMounted(async () => {
});
onUnmounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
function getDisplayRoleList(): Role[] {
@@ -188,4 +265,45 @@ async function refreshAuthorizationScope(): Promise {
}
}
+
+.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/permission/RolePermissionAssign.vue b/src/pages/permission/RolePermissionAssign.vue
index 45c95aa..4bfbc3c 100644
--- a/src/pages/permission/RolePermissionAssign.vue
+++ b/src/pages/permission/RolePermissionAssign.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
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 Role, usePermissionSettingsStore } from "@/store/permissionSettingsStore";
+
defineOptions({
name: "RolePermissionAssign"
});
const permissionStore = usePermissionSettingsStore();
-const navBarStore = useNavBarStore();
const userStore = useUserStore();
const route = useRoute();
@@ -165,9 +240,9 @@ async function savePermissionList(): Promise {
}
function updateNavBar(): void {
- navBarStore.clearRight();
+ clearPageNavBarRight();
if (canEditActiveRole.value && canUpdateRolePermission.value) {
- navBarStore.setRightText("保存", "var(--td-brand-color)", savePermissionList);
+ setPageNavBarRightText("保存", "var(--td-brand-color)", savePermissionList);
}
}
@@ -175,7 +250,7 @@ watch([canEditActiveRole, canUpdateRolePermission], updateNavBar, { immediate: t
onMounted(updateNavBar);
onUnmounted(() => {
- navBarStore.clearRight();
+ clearPageNavBarRight();
});
// ---------- 权限勾选 ----------
@@ -319,4 +394,45 @@ onMounted(async () => {
}
}
}
+
+.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/permission/component/PermissionLegend.vue b/src/pages/permission/component/PermissionLegend.vue
index 312e5f3..f8666cb 100644
--- a/src/pages/permission/component/PermissionLegend.vue
+++ b/src/pages/permission/component/PermissionLegend.vue
@@ -13,6 +13,7 @@
diff --git a/src/pages/point/PointRedeemSkuList.vue b/src/pages/point/PointRedeemSkuList.vue
index 7b92434..606578f 100644
--- a/src/pages/point/PointRedeemSkuList.vue
+++ b/src/pages/point/PointRedeemSkuList.vue
@@ -1,85 +1,151 @@
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -245,4 +310,46 @@ onUnmounted(() => {
}
}
}
+
+.nav-actions {
+ --td-popover-padding: 0 .5rem;
+
+ width: 6rem;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ :deep(.t-popover__content) { border-radius: .875rem; }
+
+ .trigger { padding: 0; }
+
+ .menu {
+ gap: .25rem;
+ display: grid;
+ padding: .5rem 0;
+ min-width: 9rem;
+
+ .menu-item {
+ --td-button-medium-height: 32px;
+ --td-button-medium-padding-horizontal: 10px;
+
+ gap: .25rem;
+ width: 100%;
+ font-weight: unset;
+ justify-content: flex-start;
+ }
+ }
+}
+
+:global(html.theme-dark) {
+ .nav-actions {
+ :deep(.t-popover__content) {
+ color: #e2e8f0;
+ background: rgba(30, 41, 59, .98);
+ }
+
+ .menu-item { color: #e2e8f0; }
+ }
+}
diff --git a/src/pages/point/PointRedemptionCreate.vue b/src/pages/point/PointRedemptionCreate.vue
index 7378495..7683e5d 100644
--- a/src/pages/point/PointRedemptionCreate.vue
+++ b/src/pages/point/PointRedemptionCreate.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -135,8 +180,6 @@ import CodeScanner from "@/components/CodeScanner.vue";
import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
import CustomerSelector from "@/components/CustomerSelector.vue";
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
-import { useNavBarStore } from "@/store/navBarStore";
-import { useSettingStore } from "@/store/settingStore";
import type { Customer } from "@/types/Customer";
import type { PhotoItem } from "@/types/Photo";
import type { PointAccount, PointRedeemSku } from "@/types/Point";
@@ -148,10 +191,42 @@ import { getProductPhotoURL, getProductQuantityStep } from "@/utils/product";
import { uploadPhotoList } from "@/utils/photo";
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 { useSettingStore } from "@/store/settingStore";
+
defineOptions({ name: "PointRedemptionCreate" });
const router = useRouter();
-const navBarStore = useNavBarStore();
const settingStore = useSettingStore();
const userStore = useUserStore();
const customerId = ref("");
@@ -332,7 +407,7 @@ function formatPoint(value?: number): string {
}
onMounted(async () => {
- navBarStore.setRightText("兑换", "var(--td-brand-color)", save);
+ setPageNavBarRightText("兑换", "var(--td-brand-color)", save);
try {
await loadSkuList();
} catch (error) {
@@ -340,7 +415,7 @@ onMounted(async () => {
}
});
-onUnmounted(() => navBarStore.clearRight());
+onUnmounted(() => clearPageNavBarRight());
diff --git a/src/pages/point/PointRedemptionDetail.vue b/src/pages/point/PointRedemptionDetail.vue
index 6e00c52..d26cbb0 100644
--- a/src/pages/point/PointRedemptionDetail.vue
+++ b/src/pages/point/PointRedemptionDetail.vue
@@ -1,4 +1,11 @@
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
@@ -502,4 +562,46 @@ onUnmounted(() => {
}
}
}
+
+.nav-actions {
+ --td-popover-padding: 0 .5rem;
+
+ width: 6rem;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ :deep(.t-popover__content) { border-radius: .875rem; }
+
+ .trigger { padding: 0; }
+
+ .menu {
+ gap: .25rem;
+ display: grid;
+ padding: .5rem 0;
+ min-width: 9rem;
+
+ .menu-item {
+ --td-button-medium-height: 32px;
+ --td-button-medium-padding-horizontal: 10px;
+
+ gap: .25rem;
+ width: 100%;
+ font-weight: unset;
+ justify-content: flex-start;
+ }
+ }
+}
+
+:global(html.theme-dark) {
+ .nav-actions {
+ :deep(.t-popover__content) {
+ color: #e2e8f0;
+ background: rgba(30, 41, 59, .98);
+ }
+
+ .menu-item { color: #e2e8f0; }
+ }
+}
diff --git a/src/pages/point/PointRuleDetail.vue b/src/pages/point/PointRuleDetail.vue
index d51a14c..4792157 100644
--- a/src/pages/point/PointRuleDetail.vue
+++ b/src/pages/point/PointRuleDetail.vue
@@ -1,4 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+