各角色工作台支持批量保存常用入口和业务员看板;AI 简报改成单行横幅避免锁死滑动;仓库/提现/对账等列表统一下拉刷新,并补代付码弹窗。 Co-authored-by: Cursor <cursoragent@cursor.com>
80 lines
3.0 KiB
JavaScript
80 lines
3.0 KiB
JavaScript
import { req } from '@/common/js/index.js';
|
||
import { platformAdminApi } from '@/api/businessApi.js';
|
||
import { unwrapClinicRes } from '@/api/clinicAdmin.js';
|
||
|
||
export { platformAdminApi };
|
||
export const getPlatformAdminMyInfo = () => platformAdminApi.getMyInfo();
|
||
|
||
/**
|
||
* 平台工作台专属请求助手(带 _platformAdmin 头 + 统一 { res, data, ok } 返回)
|
||
* 单独封装(不进 createBusinessApi):dashboard 系列接口仅平台端有,业务员端无此路由
|
||
*/
|
||
function platformDashboardRequest(options) {
|
||
return req.request({
|
||
...options,
|
||
header: { ...(options.header || {}), _platformAdmin: '1' },
|
||
}).then((res) => {
|
||
const data = unwrapClinicRes(res);
|
||
const ok = !!(res && Number(res.code) === 0);
|
||
return { res, data, ok };
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 平台工作台看板统计(待审核门店/医生/提现数 + 今日订单概览)
|
||
* xk-api GET /platform-admin-dashboard/stats
|
||
*/
|
||
export function getPlatformAdminDashboardStats() {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/stats', method: 'GET' });
|
||
}
|
||
|
||
/**
|
||
* 未来7天预约明细(工作台预约卡片点击弹层,平台全量维度)
|
||
* xk-api GET /platform-admin-dashboard/appointment-upcoming-list
|
||
*/
|
||
export function getPlatformAdminAppointmentUpcomingList(data) {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/appointment-upcoming-list', method: 'GET', data });
|
||
}
|
||
|
||
/**
|
||
* 平台工作台功能入口下发(后台按角色分配的宫格入口,替代前端硬编码)
|
||
* xk-api GET /platform-admin-dashboard/entries
|
||
*/
|
||
export function getPlatformAdminWorkbenchEntries() {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/entries', method: 'GET' });
|
||
}
|
||
|
||
/**
|
||
* 功能页用户数据:我的常用 + 最近使用
|
||
* xk-api GET /platform-admin-dashboard/entry-user-data
|
||
*/
|
||
export function getPlatformAdminEntryUserData() {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/entry-user-data', method: 'GET' });
|
||
}
|
||
|
||
/**
|
||
* 收藏/取消收藏功能入口(功能页长按触发),返回 { is_favorite }
|
||
* xk-api POST /platform-admin-dashboard/toggle-favorite-entry
|
||
*/
|
||
export function togglePlatformAdminFavoriteEntry(code) {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/toggle-favorite-entry', method: 'POST', data: { code } });
|
||
}
|
||
|
||
/**
|
||
* 批量保存我的常用(功能页悬浮编辑 / 首页快捷添加)
|
||
* xk-api POST /platform-admin-dashboard/batch-save-favorite-entry
|
||
*/
|
||
export function batchSavePlatformAdminFavoriteEntry(codes) {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/batch-save-favorite-entry', method: 'POST', data: { codes } });
|
||
}
|
||
|
||
/**
|
||
* 上报功能入口使用(点击跳转时静默调用,调用方无需处理失败)
|
||
* xk-api POST /platform-admin-dashboard/report-entry-usage
|
||
*/
|
||
export function reportPlatformAdminEntryUsage(code) {
|
||
return platformDashboardRequest({ url: '/newApi/platform-admin-dashboard/report-entry-usage', method: 'POST', data: { code } });
|
||
}
|
||
|
||
export default platformAdminApi;
|