feat: recycle system
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
@left-click="goBack"
|
||||
/>
|
||||
<main v-can="permissionCodes.stat.read" class="tui-page-content scroll column">
|
||||
<div class="filters glass">
|
||||
@@ -88,6 +88,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Time } from "timi-web";
|
||||
import { usePane } from "timi-tdesign-mobile";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
import CustomerSelector from "@/components/CustomerSelector.vue";
|
||||
import type { EventRecordCalendarListPayload } from "@/components/EventRecordCalendar.vue";
|
||||
@@ -104,8 +105,11 @@ defineOptions({
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const props = withDefaults(defineProps<{ customerId?: string }>(), { customerId: "" });
|
||||
const pane = usePane();
|
||||
|
||||
const routeNavBarTitle = computed(() => {
|
||||
if (props.customerId) return "客户数据图表";
|
||||
switch (route.name) {
|
||||
case "CustomerDataCharts":
|
||||
return "客户数据";
|
||||
@@ -119,11 +123,16 @@ const router = useRouter();
|
||||
|
||||
// ---------- 路由 ----------
|
||||
|
||||
const routeCustomerId = computed(() => String(route.params.id || ""));
|
||||
const routeCustomerId = computed(() => props.customerId || String(route.params.id || ""));
|
||||
const routeCustomerCode = computed(() => String(route.query.customerCode || ""));
|
||||
const customerCode = ref(routeCustomerCode.value);
|
||||
const selectedCustomerId = ref(routeCustomerId.value);
|
||||
|
||||
function goBack(): void {
|
||||
if (pane) pane.close();
|
||||
else void router.back();
|
||||
}
|
||||
|
||||
watch(routeCustomerCode, async (value) => {
|
||||
customerCode.value = value;
|
||||
await loadCustomer(value);
|
||||
|
||||
Reference in New Issue
Block a user