按陆运线路叶子收窄工单和看板,避免中港权限看到全部陆运;产品/航线排名只留智能体团队。空运核对卡不再列出空的非必填,报价合计标明约数。中港口语里的车型吨位和按运费比例不再算进金额。报价单上传人显示机器人名,进后台拉标题不再误报没有权限。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-11-08 11:44:31 +08:00
co-authored by Cursor
parent 246ae4607c
commit b878a094b5
24 changed files with 1125 additions and 78 deletions
@@ -33,6 +33,8 @@ const routeFilterOpen = ref(false);
const selectedRoutes = ref<string[]>([]);
const rankingRole = ref<"all" | "sales" | "route" | "product">("all");
const rankingDept = ref("");
/** 主账 rankingScope:agent_team=产品/航线账号,只看智能体团队,隐藏「销售」筛选项 */
const rankingScope = ref<"all" | "agent_team">("all");
const chartReady = ref(false);
const loading = ref(false);
const chartTip = ref({
@@ -110,6 +112,11 @@ async function loadMetrics() {
dept: String(p.dept || "-"),
volumeNum: Number(p.volumeNum || 0),
}));
rankingScope.value = data.rankingScope === "agent_team" ? "agent_team" : "all";
// 产品/航线账号不允许停留在「销售」筛选项
if (rankingScope.value === "agent_team" && rankingRole.value === "sales") {
rankingRole.value = "all";
}
rankingDepts.value = Array.from(
new Set(rankingPeople.value.map((p) => p.dept).filter((d) => d && d !== "-")),
);
@@ -605,7 +612,14 @@ onUnmounted(() => document.removeEventListener("click", onDocClick));
</select>
<div class="tabs-pill" role="tablist" aria-label="人员角色">
<button type="button" :class="{ 'is-active': rankingRole === 'all' }" @click="rankingRole = 'all'">全部</button>
<button type="button" :class="{ 'is-active': rankingRole === 'sales' }" @click="rankingRole = 'sales'">销售</button>
<button
v-if="rankingScope !== 'agent_team'"
type="button"
:class="{ 'is-active': rankingRole === 'sales' }"
@click="rankingRole = 'sales'"
>
销售
</button>
<button type="button" :class="{ 'is-active': rankingRole === 'route' }" @click="rankingRole = 'route'">航线</button>
<button type="button" :class="{ 'is-active': rankingRole === 'product' }" @click="rankingRole = 'product'">产品</button>
</div>
@@ -2,9 +2,12 @@
* 管理后台品牌标题:默认文案 + 可配置项(落 inq_bot_reply)。
* 登录前用默认;登录后 refresh 一次,侧栏/浏览器标签同步。
* 配置页:系统配置 → 后台名称。
* <p>
* 读标题走专用 systemText 接口(登录即可),禁止再调 listAll:
* 中港等无 inquiry:reply:list 的角色进看板会被拦截弹出「没有权限」。
*/
import { ref } from 'vue';
import { getReplyListAll } from '/@/views/inquiry/botReply/botReply.api';
import { defHttp } from '/@/utils/http/axios';
/** 产品默认名;库中无配置时全站用此文案 */
export const DEFAULT_ADMIN_SITE_TITLE = '友通达智价通AIQ管理后台';
@@ -17,22 +20,29 @@ export const adminSiteTitle = ref(DEFAULT_ADMIN_SITE_TITLE);
/**
* 从主账拉取已保存的后台名称。
* 失败或未配置时保持默认,不抛错打断布局。
* 失败或未配置时保持默认;errorMessageMode=none,避免无回复语权限时弹「没有权限」。
*/
export async function refreshAdminSiteTitle(): Promise<string> {
try {
const res: any = await getReplyListAll();
const list = Array.isArray(res)
? res
: Array.isArray(res?.result)
? res.result
: Array.isArray(res?.records)
? res.records
: [];
const hit = list.find((r: any) => String(r.replyCode || '') === ADMIN_SITE_TITLE_REPLY_CODE);
const enabled = !hit || hit.enabled === 1 || hit.enabled === true;
const name = enabled ? String(hit?.replyText || '').trim() : '';
adminSiteTitle.value = name || DEFAULT_ADMIN_SITE_TITLE;
// defHttp 已解包 result:成功时就是 InquiryBotReply,未配置则为 null/空
const res: any = await defHttp.get(
{
url: '/inquiry/botReply/systemText',
params: { replyCode: ADMIN_SITE_TITLE_REPLY_CODE },
},
{ errorMessageMode: 'none' },
);
if (!res) {
adminSiteTitle.value = DEFAULT_ADMIN_SITE_TITLE;
return adminSiteTitle.value;
}
const text = String(res.replyText || '').trim();
const enabledRaw = res.enabled;
const enabled = enabledRaw === undefined || enabledRaw === null
|| enabledRaw === 1
|| enabledRaw === true
|| enabledRaw === '1';
adminSiteTitle.value = enabled && text ? text : DEFAULT_ADMIN_SITE_TITLE;
} catch {
adminSiteTitle.value = DEFAULT_ADMIN_SITE_TITLE;
}