Compare commits

...

2 Commits

Author SHA1 Message Date
xinadmin 2eb27127c9 打包前端 2026-08-15 00:58:18 +08:00
xinadmin 7517d4a023 首页分析页 2026-08-15 00:58:02 +08:00
60 changed files with 1662 additions and 573 deletions
File diff suppressed because one or more lines are too long
@@ -0,0 +1,433 @@
<?php
namespace App\Http\Controllers\Dashboard;
use App\Models\BillModel;
use App\Models\PaymentModel;
use App\Models\ProductCategoryModel;
use App\Models\ProductModel;
use App\Models\PurchaseOrderModel;
use App\Models\StoreModel;
use App\Models\StoreOrderItemModel;
use App\Models\StoreOrderModel;
use App\Models\SupplierModel;
use App\Models\UserModel;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;
use Modules\AnnoRoute\Attribute\GetRoute;
use Modules\AnnoRoute\Attribute\RequestAttribute;
use Modules\Common\Http\Controllers\BaseController;
/**
* 仪表盘统计(分析页 /dashboard/analysis 数据源)
*
* 口径约定:
* - 销售/订单/品类/热销等统计均排除「已取消」订单与软删除订单
* - 采购金额按实际采购价计(actual_amount 为 0 时退回预估价 estimate_amount
* - 应收余额 = 账单总额 - 已支付账单金额(审核中回款不计入已收)
*/
#[RequestAttribute('/dashboard', 'dashboard')]
class DashboardController extends BaseController
{
/** 销售趋势统计天数 */
private const int TREND_DAYS = 30;
/** 排行榜条数上限 */
private const int TOP_LIMIT = 10;
/** 最新订单条数 */
private const int LATEST_ORDER_LIMIT = 8;
/** 分析页聚合数据(单接口一次返回,减少首页请求数) */
#[GetRoute('/analysis', 'analysis')]
public function analysis(): JsonResponse
{
$today = now()->toDateString();
return $this->success([
'overview' => $this->overview(),
'trend' => $this->salesTrend($today),
'order_status' => $this->orderStatusDistribution(),
'category_sales' => $this->categorySales(),
'top_products' => $this->topProducts(),
'top_stores' => $this->topStores(),
'recon' => $this->reconSummary(),
'latest_orders' => $this->latestOrders(),
'archives' => $this->archives(),
]);
}
/**
* 核心指标卡:销售额 / 订单数 / 采购金额(累计、今日、近7天、环比、7日迷你趋势)+ 应收余额
*
* @return array{
* sales: array{total: float, today: float, week: float, growth: float|null, trend7: float[]},
* orders: array{total: int, today: int, week: int, growth: float|null, trend7: int[]},
* purchase: array{total: float, today: float, week: float, growth: float|null, trend7: float[]},
* receivable: array{bill_total: float, received: float, unreceived: float}
* }
*/
private function overview(): array
{
$today = now()->toDateString();
$weekStart = now()->subDays(6)->toDateString();
$lastWeekStart = now()->subDays(13)->toDateString();
$lastWeekEnd = now()->subDays(7)->toDateString();
// 近14天按日聚合(前7天用于环比,后7天用于迷你趋势图)
$daily = $this->validOrderQuery()
->whereBetween('order_date', [$lastWeekStart, $today])
->get(['order_date', 'total_amount'])
->groupBy(fn (StoreOrderModel $order) => $order->order_date->toDateString());
$salesByDay = [];
$ordersByDay = [];
foreach ($daily as $date => $orders) {
$salesByDay[$date] = (float) $orders->sum('total_amount');
$ordersByDay[$date] = $orders->count();
}
$salesWeek = $this->sumRange($salesByDay, $weekStart, $today);
$salesLastWeek = $this->sumRange($salesByDay, $lastWeekStart, $lastWeekEnd);
$ordersWeek = (int) $this->sumRange($ordersByDay, $weekStart, $today);
$ordersLastWeek = (int) $this->sumRange($ordersByDay, $lastWeekStart, $lastWeekEnd);
// 采购金额:实际价优先,无实际价用预估价
$purchaseDaily = PurchaseOrderModel::query()
->whereBetween('purchase_date', [$lastWeekStart, $today])
->get(['purchase_date', 'estimate_amount', 'actual_amount'])
->groupBy(fn (PurchaseOrderModel $purchase) => $purchase->purchase_date->toDateString())
->map(fn ($purchases) => (float) $purchases->sum(
fn (PurchaseOrderModel $purchase) => (float) $purchase->actual_amount > 0
? $purchase->actual_amount
: $purchase->estimate_amount
));
$purchaseWeek = $this->sumRange($purchaseDaily->all(), $weekStart, $today);
$purchaseLastWeek = $this->sumRange($purchaseDaily->all(), $lastWeekStart, $lastWeekEnd);
// 应收余额:账单总额 - 已支付账单金额
$billTotal = (float) BillModel::query()->sum('total_amount');
$received = (float) BillModel::query()->where('status', BillModel::STATUS_PAID)->sum('total_amount');
return [
'sales' => [
'total' => $this->money($this->validOrderQuery()->sum('total_amount')),
'today' => $this->money($salesByDay[$today] ?? 0),
'week' => $this->money($salesWeek),
'growth' => $this->growthRate($salesWeek, $salesLastWeek),
'trend7' => array_map(
fn ($day) => $this->money($salesByDay[$day] ?? 0),
$this->dateRange($weekStart, $today)
),
],
'orders' => [
'total' => (int) $this->validOrderQuery()->count(),
'today' => (int) ($ordersByDay[$today] ?? 0),
'week' => $ordersWeek,
'growth' => $this->growthRate((float) $ordersWeek, (float) $ordersLastWeek),
'trend7' => array_map(
static fn ($day) => (int) ($ordersByDay[$day] ?? 0),
$this->dateRange($weekStart, $today)
),
],
'purchase' => [
'total' => $this->money(PurchaseOrderModel::query()->sum(DB::raw(
'CASE WHEN actual_amount > 0 THEN actual_amount ELSE COALESCE(estimate_amount, 0) END'
))),
'today' => $this->money($purchaseDaily[$today] ?? 0),
'week' => $this->money($purchaseWeek),
'growth' => $this->growthRate($purchaseWeek, $purchaseLastWeek),
'trend7' => array_map(
fn ($day) => $this->money($purchaseDaily[$day] ?? 0),
$this->dateRange($weekStart, $today)
),
],
'receivable' => [
'bill_total' => $this->money($billTotal),
'received' => $this->money($received),
'unreceived' => $this->money($billTotal - $received),
],
];
}
/**
* 近30天销售趋势(缺日补0)
*
* @return array<int, array{date: string, amount: float, orders: int}>
*/
private function salesTrend(string $today): array
{
$start = now()->subDays(self::TREND_DAYS - 1)->toDateString();
$daily = $this->validOrderQuery()
->whereBetween('order_date', [$start, $today])
->get(['order_date', 'total_amount'])
->groupBy(fn (StoreOrderModel $order) => $order->order_date->toDateString());
return array_map(static function ($date) use ($daily) {
$orders = $daily->get($date);
return [
'date' => $date,
'amount' => round((float) ($orders?->sum('total_amount') ?? 0), 2),
'orders' => $orders?->count() ?? 0,
];
}, $this->dateRange($start, $today));
}
/**
* 订单状态分布(含已取消,全部状态固定输出,缺省补0)
*
* @return array<int, array{status: int, name: string, count: int}>
*/
private function orderStatusDistribution(): array
{
$counts = StoreOrderModel::query()
->selectRaw('status, COUNT(*) as cnt')
->groupBy('status')
->pluck('cnt', 'status');
$result = [];
foreach (StoreOrderModel::STATUS_NAMES as $status => $name) {
$result[] = [
'status' => $status,
'name' => $name,
'count' => (int) ($counts[$status] ?? 0),
];
}
return $result;
}
/**
* 品类销售占比(按明细金额汇总,金额降序)
*
* @return array<int, array{name: string, amount: float}>
*/
private function categorySales(): array
{
$rows = $this->validItemQuery()
->groupBy('i.category_id')
->selectRaw('i.category_id, SUM(i.amount) as amount')
->orderByDesc('amount')
->get();
$categoryNames = ProductCategoryModel::query()->pluck('name', 'id');
return $rows->map(static fn ($row) => [
'name' => $categoryNames[$row->category_id] ?? '未分类',
'amount' => round((float) $row->amount, 2),
])->all();
}
/**
* 热销商品 TOP10(按明细金额汇总;商品名/规格/单位取快照)
*
* @return array<int, array{product_id: int, product_name: string, product_spec: string, unit: string, quantity: float, amount: float}>
*/
private function topProducts(): array
{
return $this->validItemQuery()
->groupBy('i.product_id')
->selectRaw(implode(', ', [
'i.product_id',
'MAX(i.product_name) as product_name',
'MAX(i.product_spec) as product_spec',
'MAX(i.unit) as unit',
'SUM(i.quantity) as quantity',
'SUM(i.amount) as amount',
]))
->orderByDesc('amount')
->limit(self::TOP_LIMIT)
->get()
->map(static fn ($row) => [
'product_id' => (int) $row->product_id,
'product_name' => (string) $row->product_name,
'product_spec' => (string) $row->product_spec,
'unit' => (string) $row->unit,
'quantity' => round((float) $row->quantity, 2),
'amount' => round((float) $row->amount, 2),
])
->all();
}
/**
* 门店排行 TOP10(按订单金额汇总,含软删除门店名称回查)
*
* @return array<int, array{store_id: int, store_name: string, order_count: int, amount: float}>
*/
private function topStores(): array
{
$rows = $this->validOrderQuery()
->groupBy('store_id')
->selectRaw('store_id, COUNT(*) as order_count, SUM(total_amount) as amount')
->orderByDesc('amount')
->limit(self::TOP_LIMIT)
->get();
$storeNames = StoreModel::withTrashed()
->whereIn('id', $rows->pluck('store_id'))
->pluck('name', 'id');
return $rows->map(static fn ($row) => [
'store_id' => (int) $row->store_id,
'store_name' => $storeNames[$row->store_id] ?? '未知门店',
'order_count' => (int) $row->order_count,
'amount' => round((float) $row->amount, 2),
])->all();
}
/**
* 对账与回款概览:账单支付进度分布 + 待审核回款
*
* @return array{
* bills: array<int, array{pay_state: int, name: string, count: int, amount: float}>,
* pending_payment: array{count: int, amount: float}
* }
*/
private function reconSummary(): array
{
$states = [];
foreach (BillModel::PAY_STATE_NAMES as $state => $name) {
$states[$state] = ['pay_state' => $state, 'name' => $name, 'count' => 0, 'amount' => 0.0];
}
BillModel::query()
->get(['id', 'total_amount', 'status', 'payment_id'])
->each(static function (BillModel $bill) use (&$states) {
$state = $bill->payState();
$states[$state]['count']++;
$states[$state]['amount'] += (float) $bill->total_amount;
});
$bills = array_values(array_map(
fn ($state) => [
'pay_state' => $state['pay_state'],
'name' => $state['name'],
'count' => $state['count'],
'amount' => $this->money($state['amount']),
],
$states
));
$pendingPayment = PaymentModel::query()->where('status', PaymentModel::STATUS_PENDING);
return [
'bills' => $bills,
'pending_payment' => [
'count' => (int) $pendingPayment->count(),
'amount' => $this->money($pendingPayment->sum('amount')),
],
];
}
/**
* 最新订单(按下单日期倒序,含已取消,便于掌握最新动态)
*
* @return array<int, array{id: int, order_no: string, store_name: string, order_date: string, total_amount: float, status: int, status_name: string}>
*/
private function latestOrders(): array
{
return StoreOrderModel::query()
->with('store:id,name')
->orderByDesc('order_date')
->orderByDesc('id')
->limit(self::LATEST_ORDER_LIMIT)
->get()
->map(static fn (StoreOrderModel $order) => [
'id' => $order->id,
'order_no' => $order->order_no,
'store_name' => $order->store->name ?? '未知门店',
'order_date' => $order->order_date->toDateString(),
'total_amount' => round((float) $order->total_amount, 2),
'status' => $order->status,
'status_name' => StoreOrderModel::STATUS_NAMES[$order->status] ?? (string) $order->status,
])
->all();
}
/**
* 基础档案计数:在营门店 / 在售商品 / 合作供应商 / 小程序用户
*
* @return array{stores: int, products: int, suppliers: int, users: int}
*/
private function archives(): array
{
return [
'stores' => StoreModel::query()->where('status', StoreModel::STATUS_NORMAL)->count(),
'products' => ProductModel::query()->where('status', ProductModel::STATUS_ON)->count(),
'suppliers' => SupplierModel::query()->where('status', SupplierModel::STATUS_NORMAL)->count(),
'users' => UserModel::query()->where('status', UserModel::STATUS_NORMAL)->count(),
];
}
/** 有效订单查询(排除已取消;软删除由模型全局作用域排除) */
private function validOrderQuery(): Builder
{
return StoreOrderModel::query()->where('status', '<>', StoreOrderModel::STATUS_CANCELLED);
}
/**
* 有效订单明细查询(join 绕过模型全局作用域,需手动排除软删除订单与已取消订单)
*/
private function validItemQuery(): Builder
{
return StoreOrderItemModel::query()
->from('store_order_item as i')
->join('store_order as o', 'o.id', '=', 'i.order_id')
->whereNull('o.deleted_at')
->where('o.status', '<>', StoreOrderModel::STATUS_CANCELLED);
}
/**
* 按日期区间(含端点)汇总每日数据,缺日按0计
*
* @param array<string, float|int> $daily 日期 => 当日值
*/
private function sumRange(array $daily, string $start, string $end): float
{
$sum = 0.0;
foreach ($this->dateRange($start, $end) as $date) {
$sum += (float) ($daily[$date] ?? 0);
}
return $sum;
}
/**
* 生成连续日期列表(含端点)
*
* @return string[]
*/
private function dateRange(string $start, string $end): array
{
$dates = [];
$cursor = $start;
while ($cursor <= $end) {
$dates[] = $cursor;
$cursor = date('Y-m-d', strtotime($cursor . ' +1 day'));
}
return $dates;
}
/** 金额统一保留两位 */
private function money(float|string|null $value): float
{
return round((float) $value, 2);
}
/**
* 环比增长率(%):上期为0时无基准,返回 null
*/
private function growthRate(float $current, float $previous): ?float
{
if ($previous <= 0.0) {
return null;
}
return round(($current - $previous) / $previous * 100, 1);
}
}
@@ -52,16 +52,6 @@ return new class extends Migration
$table->comment('小程序首页促销推荐卡片');
});
}
// 文件分组:客户端配置图片(幂等,已有库补充分组记录)
DB::table('sys_file_group')->insertOrIgnore([
'id' => 12,
'name' => '客户端配置',
'sort' => 11,
'describe' => '小程序首页轮播图/宫格导航/促销卡片图片',
'created_at' => now(),
'updated_at' => now(),
]);
}
/**
-1
View File
@@ -1 +0,0 @@
import{i as e,t}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as n,Ft as r}from"./jsx-runtime-CRBytmvs.js";var i=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 00-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 00471 99.9c-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81zm636.4-353l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 016.9 27.3c0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5a44.1 44.1 0 0142.2-32.3c7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z`}}]},name:`like`,theme:`outlined`}})),a=e(n()),o=e(i());function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var c=a.forwardRef((e,t)=>a.createElement(r,s({},e,{ref:t,icon:o.default})));export{c as t};
+1
View File
@@ -0,0 +1 @@
import{i as e,t}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as n,Ft as r}from"./jsx-runtime-CRBytmvs.js";var i=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0014.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0015.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 01512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 01-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z`}}]},name:`shop`,theme:`outlined`}})),a=e(n()),o=e(i());function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var c=a.forwardRef((e,t)=>a.createElement(r,s({},e,{ref:t,icon:o.default})));export{c as t};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{i as e,t}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as n,Ft as r}from"./jsx-runtime-CRBytmvs.js";var i=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 00-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 100 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 00-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 00-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6z`}}]},name:`shopping-cart`,theme:`outlined`}})),a=e(n()),o=e(i());function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var c=a.forwardRef((e,t)=>a.createElement(r,s({},e,{ref:t,icon:o.default}))),l=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M608 192a32 32 0 0132 32v160h174.81a32 32 0 0126.68 14.33l113.19 170.84a32 32 0 015.32 17.68V672a32 32 0 01-32 32h-96c0 70.7-57.3 128-128 128s-128-57.3-128-128H384c0 70.7-57.3 128-128 128s-128-57.3-128-128H96a32 32 0 01-32-32V224a32 32 0 0132-32zM256 640a64 64 0 000 128h1.06A64 64 0 00256 640m448 0a64 64 0 000 128h1.06A64 64 0 00704 640M576 256H128v384h17.12c22.13-38.26 63.5-64 110.88-64 47.38 0 88.75 25.74 110.88 64H576zm221.63 192H640v145.12A127.43 127.43 0 01704 576c47.38 0 88.75 25.74 110.88 64H896v-43.52zM500 448a12 12 0 0112 12v40a12 12 0 01-12 12H332a12 12 0 01-12-12v-40a12 12 0 0112-12zM308 320a12 12 0 0112 12v40a12 12 0 01-12 12H204a12 12 0 01-12-12v-40a12 12 0 0112-12z`}}]},name:`truck`,theme:`outlined`}}))());function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}var d=a.forwardRef((e,t)=>a.createElement(r,u({},e,{ref:t,icon:l.default}))),f=e(t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 464H528V448h312v128zm0 264H184V184h656v200H496c-17.7 0-32 14.3-32 32v192c0 17.7 14.3 32 32 32h344v200zM580 512a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`wallet`,theme:`outlined`}}))());function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}var m=a.forwardRef((e,t)=>a.createElement(r,p({},e,{ref:t,icon:f.default})));export{d as n,c as r,m as t};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-bd65Ar6c.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-NSSoHqA_.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`首页轮播图`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页顶部轮播图;停用后不展示,排序越小越靠前;跳转链接为小程序页面路径,留空则点击不跳转。`})]}),(0,s.jsx)(a,{api:`/client/banner`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`标题`,dataIndex:`title`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入轮播图标题`}]},{title:`轮播图片`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传轮播图片`}],fieldProps:{action:`/client/banner/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:80,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/goods/detail?id=1`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.banner`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:640}})]});export{u as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-zUz1CRv3.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-BHebVDbz.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`首页轮播图`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页顶部轮播图;停用后不展示,排序越小越靠前;跳转链接为小程序页面路径,留空则点击不跳转。`})]}),(0,s.jsx)(a,{api:`/client/banner`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`标题`,dataIndex:`title`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入轮播图标题`}]},{title:`轮播图片`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传轮播图片`}],fieldProps:{action:`/client/banner/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:80,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/goods/detail?id=1`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.banner`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:640}})]});export{u as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{m as i}from"./lodash-VautP0iT.js";import{t as a}from"./button-BILozH6U.js";import{l as o}from"./XinForm-B2aqXwsp.js";import{t as s}from"./form-B3R3kIqp.js";import{t as c}from"./tag-DBV1bHre.js";import{t as l}from"./XinTable-NSSoHqA_.js";import{n as u,t as d}from"./category-MmrJkdbs.js";var f=e(t(),1),p={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},m=n(),{Title:h,Text:g}=r,_=({form:e,tree:t,value:n,onChange:r})=>{let i=s.useWatch(`id`,e),a=s.useWatch(`children`,e),c=Array.isArray(a)&&a.length>0;return(0,m.jsx)(o,{value:n,onChange:r,treeData:(0,f.useMemo)(()=>{let e=(t,n)=>t.map(t=>({...t,disabled:n>=2||t.id===i||c&&n>=1,children:t.children?.length?e(t.children,n+1):t.children}));return[{id:0,name:`顶级分类`,children:e(t,1)}]},[t,i,c]),fieldNames:{label:`name`,value:`id`,children:`children`},placeholder:`默认顶级分类`,treeDefaultExpandAll:!0})};function v(e){let t=[],n=e=>{e.forEach(e=>{e.id!==void 0&&t.push(e.id),e.children?.length&&n(e.children)})};return n(e),t}var y=()=>{let[e,t]=(0,f.useState)([]),[n,r]=(0,f.useState)([]),[o,s]=(0,f.useState)([]);return(0,f.useEffect)(()=>{u().then(e=>s(e.data.data??[]))},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`mb-5`,children:[(0,m.jsx)(h,{level:3,children:`商品分类`}),(0,m.jsx)(g,{type:`secondary`,children:`多级分类(如蔬菜/水果/其他),采购单导出与对账筛选按分类归组;有子分类或挂载商品时不可删除。`})]}),(0,m.jsx)(l,{api:`/product/category`,columns:[{title:`分类名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入分类名称`}]},{title:`上级分类`,dataIndex:`parent_id`,hideInTable:!0,hideInSearch:!0,initialValue:0,fieldRender:e=>(0,m.jsx)(_,{form:e,tree:o})},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0},align:`center`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,hideInSearch:!0,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=p[t.status??1];return(0,m.jsx)(c,{color:n?.color,children:n?.text})},align:`center`},{title:`创建时间`,dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`product.category`,handleRequest:async()=>{let e=(await d()).data.data??[];return r(v(e)),{data:e,total:e.length}},pagination:{pageSize:200},expandable:{expandedRowKeys:e,onExpandedRowsChange:e=>t([...e])},actionBarRender:r=>[r.add,(0,m.jsx)(a,{icon:(0,m.jsx)(i,{}),onClick:()=>t(e.length?[]:n),children:e.length?`全部收起`:`全部展开`}),r.keywordSearch],formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:640}})]})};export{y as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{m as i}from"./lodash-DNhu68T6.js";import{t as a}from"./button-BILozH6U.js";import{l as o}from"./XinForm-BWtl160T.js";import{t as s}from"./form-B3R3kIqp.js";import{t as c}from"./tag-DBV1bHre.js";import{t as l}from"./XinTable-BHebVDbz.js";import{n as u,t as d}from"./category-MmrJkdbs.js";var f=e(t(),1),p={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},m=n(),{Title:h,Text:g}=r,_=({form:e,tree:t,value:n,onChange:r})=>{let i=s.useWatch(`id`,e),a=s.useWatch(`children`,e),c=Array.isArray(a)&&a.length>0;return(0,m.jsx)(o,{value:n,onChange:r,treeData:(0,f.useMemo)(()=>{let e=(t,n)=>t.map(t=>({...t,disabled:n>=2||t.id===i||c&&n>=1,children:t.children?.length?e(t.children,n+1):t.children}));return[{id:0,name:`顶级分类`,children:e(t,1)}]},[t,i,c]),fieldNames:{label:`name`,value:`id`,children:`children`},placeholder:`默认顶级分类`,treeDefaultExpandAll:!0})};function v(e){let t=[],n=e=>{e.forEach(e=>{e.id!==void 0&&t.push(e.id),e.children?.length&&n(e.children)})};return n(e),t}var y=()=>{let[e,t]=(0,f.useState)([]),[n,r]=(0,f.useState)([]),[o,s]=(0,f.useState)([]);return(0,f.useEffect)(()=>{u().then(e=>s(e.data.data??[]))},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`mb-5`,children:[(0,m.jsx)(h,{level:3,children:`商品分类`}),(0,m.jsx)(g,{type:`secondary`,children:`多级分类(如蔬菜/水果/其他),采购单导出与对账筛选按分类归组;有子分类或挂载商品时不可删除。`})]}),(0,m.jsx)(l,{api:`/product/category`,columns:[{title:`分类名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入分类名称`}]},{title:`上级分类`,dataIndex:`parent_id`,hideInTable:!0,hideInSearch:!0,initialValue:0,fieldRender:e=>(0,m.jsx)(_,{form:e,tree:o})},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0},align:`center`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,hideInSearch:!0,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=p[t.status??1];return(0,m.jsx)(c,{color:n?.color,children:n?.text})},align:`center`},{title:`创建时间`,dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`product.category`,handleRequest:async()=>{let e=(await d()).data.data??[];return r(v(e)),{data:e,total:e.length}},pagination:{pageSize:200},expandable:{expandedRowKeys:e,onExpandedRowsChange:e=>t([...e])},actionBarRender:r=>[r.add,(0,m.jsx)(a,{icon:(0,m.jsx)(i,{}),onClick:()=>t(e.length?[]:n),children:e.length?`全部收起`:`全部展开`}),r.keywordSearch],formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:640}})]})};export{y as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./button-BILozH6U.js";import{r as a}from"./DoubleRightOutlined-Blfli1UU.js";import{n as o}from"./LockOutlined-B8eRH1x4.js";import{u as s}from"./XinForm-B2aqXwsp.js";import{t as c}from"./modal-g8Q5gNCx.js";import{t as l}from"./form-B3R3kIqp.js";import{t as u}from"./DownloadOutlined-DJY9Mu8c.js";import{t as d}from"./XinTable-NSSoHqA_.js";import{t as f}from"./AuthButton-DvrpreK4.js";import{t as p}from"./store-JDnJsv44.js";import{t as m}from"./download-DC9wDwqQ.js";var h=e(t(),1),g=e(o(),1);async function _(e,t,n){return m(`/recon/container-return/export`,{start_date:e,end_date:t,...n.length>0?{store_ids:n.join(`,`)}:{}},`回筐记录.xlsx`)}var v=n(),{Title:y,Text:b}=r,{RangePicker:x}=s,S=({value:e})=>{let t=Number(e??0);return t>0?(0,v.jsxs)(b,{strong:!0,type:`warning`,children:[`+`,t]}):t<0?(0,v.jsx)(b,{strong:!0,type:`success`,children:t}):(0,v.jsx)(b,{type:`secondary`,children:`0`})},C=({value:e})=>{let t=Number(e??0);return t>0?(0,v.jsxs)(b,{strong:!0,type:`warning`,children:[``,t.toFixed(2)]}):t<0?(0,v.jsxs)(b,{strong:!0,type:`success`,children:[``,Math.abs(t).toFixed(2)]}):(0,v.jsx)(b,{type:`secondary`,children:`¥0.00`})},w=()=>{let[e,t]=(0,h.useState)([]),[n,r]=(0,h.useState)(!1),[o,s]=(0,h.useState)(!1),[m]=l.useForm();(0,h.useEffect)(()=>{p().then(e=>t(e.data.data??[]))},[]);let w=async e=>{let[t,n]=e.date_range;s(!0);try{await _(t.format(`YYYY-MM-DD`),n.format(`YYYY-MM-DD`),e.store_ids??[]),r(!1)}finally{s(!1)}},T={api:`/recon/container-return`,columns:[{title:`门店`,dataIndex:`store_id`,valueType:`select`,hideInForm:!0,fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.store?.name??`门店#${t.store_id}`},{title:`关联账单`,dataIndex:`bill_id`,hideInForm:!0,hideInSearch:!0,render:(e,t)=>t.bill?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(b,{copyable:{text:t.bill.bill_no},children:t.bill.bill_no}),(0,v.jsx)(`div`,{className:`text-[12px] text-[#999]`,children:t.bill.bill_date})]}):`-`},{title:`压(回)筐数量`,dataIndex:`box_num`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(S,{value:t.box_num})},{title:`压(回)托盘数量`,dataIndex:`tray_num`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(S,{value:t.tray_num})},{title:`筐单价`,dataIndex:`box_price`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${Number(t.box_price??0).toFixed(2)}`},{title:`托盘单价`,dataIndex:`tray_price`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${Number(t.tray_price??0).toFixed(2)}`},{title:`抵扣(附加)金额`,dataIndex:`amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(C,{value:t.amount})},{title:`操作人`,dataIndex:`operator`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>t.operator?.nickname??`-`},{title:`记录时间`,dataIndex:`created_at`,valueType:`dateRange`,hideInForm:!0,hideInTable:!0,align:`center`},{title:`记录时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`recon.containerReturn`,addShow:!1,editShow:!1,deleteShow:!1,formProps:!1,toolBarRender:e=>[(0,v.jsx)(f,{auth:`recon.containerReturn.export`,children:(0,v.jsx)(i,{icon:(0,v.jsx)(u,{}),onClick:()=>r(!0),children:`导出`})},`export`),e.columnSetting,e.hideBorder,e.reload,e.columnHeight]};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`mb-5`,children:[(0,v.jsx)(y,{level:3,children:`回筐记录`}),(0,v.jsx)(b,{type:`secondary`,children:`周转筐/托盘跟账单走:生成账单时按填写数量自动写入;正数=压筐(附加金额),负数=回筐(抵扣金额),数量为 0 不生成记录; 可按日期区间与门店汇总导出(行=日期,列=门店,含行列合计)。`})]}),(0,v.jsx)(d,{...T}),(0,v.jsxs)(c,{title:`导出回筐记录`,open:n,onCancel:()=>r(!1),onOk:()=>m.submit(),confirmLoading:o,okText:`导出`,destroyOnHidden:!0,children:[(0,v.jsx)(`div`,{className:`py-2 text-gray-500`,children:`按日期区间与门店导出抵扣(附加)金额汇总表:行=日期(同日记录合并),列=门店, 当天门店无记录填 0,含行合计与列合计。门店不选默认导出全部门店。`}),(0,v.jsxs)(l,{form:m,layout:`vertical`,onFinish:w,initialValues:{date_range:[(0,g.default)().startOf(`month`),(0,g.default)()],store_ids:[]},children:[(0,v.jsx)(l.Item,{label:`日期区间`,name:`date_range`,rules:[{required:!0,message:`请选择日期区间`}],children:(0,v.jsx)(x,{className:`w-full`,allowClear:!1})}),(0,v.jsx)(l.Item,{label:`门店`,name:`store_ids`,children:(0,v.jsx)(a,{mode:`multiple`,allowClear:!0,maxTagCount:`responsive`,placeholder:`全部门店`,showSearch:!0,optionFilterProp:`label`,options:e.map(e=>({label:e.name,value:e.id}))})})]})]})]})};export{w as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./button-BILozH6U.js";import{r as a}from"./DoubleRightOutlined-Blfli1UU.js";import{n as o}from"./LockOutlined-B8eRH1x4.js";import{u as s}from"./XinForm-BWtl160T.js";import{t as c}from"./modal-g8Q5gNCx.js";import{t as l}from"./form-B3R3kIqp.js";import{t as u}from"./DownloadOutlined-DJY9Mu8c.js";import{t as d}from"./XinTable-BHebVDbz.js";import{t as f}from"./AuthButton-DvrpreK4.js";import{t as p}from"./store-JDnJsv44.js";import{t as m}from"./download-DC9wDwqQ.js";var h=e(t(),1),g=e(o(),1);async function _(e,t,n){return m(`/recon/container-return/export`,{start_date:e,end_date:t,...n.length>0?{store_ids:n.join(`,`)}:{}},`回筐记录.xlsx`)}var v=n(),{Title:y,Text:b}=r,{RangePicker:x}=s,S=({value:e})=>{let t=Number(e??0);return t>0?(0,v.jsxs)(b,{strong:!0,type:`warning`,children:[`+`,t]}):t<0?(0,v.jsx)(b,{strong:!0,type:`success`,children:t}):(0,v.jsx)(b,{type:`secondary`,children:`0`})},C=({value:e})=>{let t=Number(e??0);return t>0?(0,v.jsxs)(b,{strong:!0,type:`warning`,children:[``,t.toFixed(2)]}):t<0?(0,v.jsxs)(b,{strong:!0,type:`success`,children:[``,Math.abs(t).toFixed(2)]}):(0,v.jsx)(b,{type:`secondary`,children:`¥0.00`})},w=()=>{let[e,t]=(0,h.useState)([]),[n,r]=(0,h.useState)(!1),[o,s]=(0,h.useState)(!1),[m]=l.useForm();(0,h.useEffect)(()=>{p().then(e=>t(e.data.data??[]))},[]);let w=async e=>{let[t,n]=e.date_range;s(!0);try{await _(t.format(`YYYY-MM-DD`),n.format(`YYYY-MM-DD`),e.store_ids??[]),r(!1)}finally{s(!1)}},T={api:`/recon/container-return`,columns:[{title:`门店`,dataIndex:`store_id`,valueType:`select`,hideInForm:!0,fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.store?.name??`门店#${t.store_id}`},{title:`关联账单`,dataIndex:`bill_id`,hideInForm:!0,hideInSearch:!0,render:(e,t)=>t.bill?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(b,{copyable:{text:t.bill.bill_no},children:t.bill.bill_no}),(0,v.jsx)(`div`,{className:`text-[12px] text-[#999]`,children:t.bill.bill_date})]}):`-`},{title:`压(回)筐数量`,dataIndex:`box_num`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(S,{value:t.box_num})},{title:`压(回)托盘数量`,dataIndex:`tray_num`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(S,{value:t.tray_num})},{title:`筐单价`,dataIndex:`box_price`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${Number(t.box_price??0).toFixed(2)}`},{title:`托盘单价`,dataIndex:`tray_price`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${Number(t.tray_price??0).toFixed(2)}`},{title:`抵扣(附加)金额`,dataIndex:`amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,v.jsx)(C,{value:t.amount})},{title:`操作人`,dataIndex:`operator`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>t.operator?.nickname??`-`},{title:`记录时间`,dataIndex:`created_at`,valueType:`dateRange`,hideInForm:!0,hideInTable:!0,align:`center`},{title:`记录时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`recon.containerReturn`,addShow:!1,editShow:!1,deleteShow:!1,formProps:!1,toolBarRender:e=>[(0,v.jsx)(f,{auth:`recon.containerReturn.export`,children:(0,v.jsx)(i,{icon:(0,v.jsx)(u,{}),onClick:()=>r(!0),children:`导出`})},`export`),e.columnSetting,e.hideBorder,e.reload,e.columnHeight]};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`mb-5`,children:[(0,v.jsx)(y,{level:3,children:`回筐记录`}),(0,v.jsx)(b,{type:`secondary`,children:`周转筐/托盘跟账单走:生成账单时按填写数量自动写入;正数=压筐(附加金额),负数=回筐(抵扣金额),数量为 0 不生成记录; 可按日期区间与门店汇总导出(行=日期,列=门店,含行列合计)。`})]}),(0,v.jsx)(d,{...T}),(0,v.jsxs)(c,{title:`导出回筐记录`,open:n,onCancel:()=>r(!1),onOk:()=>m.submit(),confirmLoading:o,okText:`导出`,destroyOnHidden:!0,children:[(0,v.jsx)(`div`,{className:`py-2 text-gray-500`,children:`按日期区间与门店导出抵扣(附加)金额汇总表:行=日期(同日记录合并),列=门店, 当天门店无记录填 0,含行合计与列合计。门店不选默认导出全部门店。`}),(0,v.jsxs)(l,{form:m,layout:`vertical`,onFinish:w,initialValues:{date_range:[(0,g.default)().startOf(`month`),(0,g.default)()],store_ids:[]},children:[(0,v.jsx)(l.Item,{label:`日期区间`,name:`date_range`,rules:[{required:!0,message:`请选择日期区间`}],children:(0,v.jsx)(x,{className:`w-full`,allowClear:!1})}),(0,v.jsx)(l.Item,{label:`门店`,name:`store_ids`,children:(0,v.jsx)(a,{mode:`multiple`,allowClear:!0,maxTagCount:`responsive`,placeholder:`全部门店`,showSearch:!0,optionFilterProp:`label`,options:e.map(e=>({label:e.name,value:e.id}))})})]})]})]})};export{w as default};
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{I as a}from"./lodash-VautP0iT.js";import{t as o}from"./tooltip-SaeG1Uv7.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./button-BILozH6U.js";import{n as l}from"./LockOutlined-B8eRH1x4.js";import{t as u}from"./EyeOutlined-LSBUmW0e.js";import{t as d}from"./tag-DBV1bHre.js";import{t as f}from"./useTranslation-DBl6NYjI.js";import{t as p}from"./XinTable-NSSoHqA_.js";async function m(e,t){return r({url:`/ai/conversation/${e}/messages`,method:`get`,params:t})}var h=e(l(),1),g=e(t(),1),_=n(),{Title:v,Text:y}=i;function b(){let{t:e}=f(),[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(``),[l,b]=(0,g.useState)([]),[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(0),[T,E]=(0,g.useState)(1),[D,O]=(0,g.useState)(``),k=async(e,t)=>{S(!0);try{let n=(await m(e,{page:t,pageSize:20})).data.data;b(n.data),w(n.total)}finally{S(!1)}},A=async e=>{O(e.id),i(e.title||``),E(1),n(!0),await k(e.id,1)},j=e=>{E(e),k(D,e)},M=[{title:e(`ai.conversation.id`),dataIndex:`id`,hideInForm:!0,width:260,ellipsis:!0,align:`center`},{title:e(`ai.conversation.username`),dataIndex:`username`,hideInForm:!0,align:`center`,width:120,render:t=>t||e(`ai.conversation.noUser`)},{title:e(`ai.conversation.title`),dataIndex:`title`,valueType:`text`,ellipsis:!0},{title:e(`ai.conversation.messageCount`),dataIndex:`message_count`,hideInForm:!0,hideInSearch:!0,align:`center`,width:100},{title:e(`ai.conversation.createdAt`),dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`},{title:e(`ai.conversation.updatedAt`),dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`}],N=[{title:e(`ai.conversation.message.role`),dataIndex:`role`,width:100,render:t=>(0,_.jsx)(d,{color:{user:`blue`,assistant:`green`,system:`orange`}[t]||`default`,children:e(`ai.conversation.message.role.${t}`,t)})},{title:e(`ai.conversation.message.agent`),dataIndex:`agent`,width:150,ellipsis:!0},{title:e(`ai.conversation.message.content`),dataIndex:`content`,ellipsis:!0},{title:e(`ai.conversation.message.createdAt`),dataIndex:`created_at`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`}];return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`mb-5`,children:[(0,_.jsx)(v,{level:3,children:e(`ai.conversation.page.title`)}),(0,_.jsx)(y,{type:`secondary`,children:e(`ai.conversation.page.description`)})]}),(0,_.jsx)(p,{api:`/ai/conversation`,columns:M,rowKey:`id`,accessName:`ai.conversation`,addShow:!1,editShow:!1,formProps:!1,operateProps:{fixed:`right`,width:120},operateRender:(t,n)=>[(0,_.jsx)(o,{title:e(`ai.conversation.viewMessages`),children:(0,_.jsx)(c,{type:`primary`,icon:(0,_.jsx)(u,{}),size:`small`,onClick:()=>A(t)})},`view`),n.del],scroll:{x:1100},cardProps:{variant:`borderless`}}),(0,_.jsx)(a,{title:`${e(`ai.conversation.messageTitle`)} - ${r}`,open:t,onClose:()=>n(!1),width:900,children:(0,_.jsx)(s,{dataSource:l,columns:N,rowKey:`id`,loading:x,pagination:{current:T,total:C,pageSize:20,onChange:j,showSizeChanger:!1},scroll:{x:700},size:`small`})})]})}export{b as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{I as a}from"./lodash-DNhu68T6.js";import{t as o}from"./tooltip-SaeG1Uv7.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./button-BILozH6U.js";import{n as l}from"./LockOutlined-B8eRH1x4.js";import{t as u}from"./EyeOutlined-LSBUmW0e.js";import{t as d}from"./tag-DBV1bHre.js";import{t as f}from"./useTranslation-DBl6NYjI.js";import{t as p}from"./XinTable-BHebVDbz.js";async function m(e,t){return r({url:`/ai/conversation/${e}/messages`,method:`get`,params:t})}var h=e(l(),1),g=e(t(),1),_=n(),{Title:v,Text:y}=i;function b(){let{t:e}=f(),[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(``),[l,b]=(0,g.useState)([]),[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(0),[T,E]=(0,g.useState)(1),[D,O]=(0,g.useState)(``),k=async(e,t)=>{S(!0);try{let n=(await m(e,{page:t,pageSize:20})).data.data;b(n.data),w(n.total)}finally{S(!1)}},A=async e=>{O(e.id),i(e.title||``),E(1),n(!0),await k(e.id,1)},j=e=>{E(e),k(D,e)},M=[{title:e(`ai.conversation.id`),dataIndex:`id`,hideInForm:!0,width:260,ellipsis:!0,align:`center`},{title:e(`ai.conversation.username`),dataIndex:`username`,hideInForm:!0,align:`center`,width:120,render:t=>t||e(`ai.conversation.noUser`)},{title:e(`ai.conversation.title`),dataIndex:`title`,valueType:`text`,ellipsis:!0},{title:e(`ai.conversation.messageCount`),dataIndex:`message_count`,hideInForm:!0,hideInSearch:!0,align:`center`,width:100},{title:e(`ai.conversation.createdAt`),dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`},{title:e(`ai.conversation.updatedAt`),dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`}],N=[{title:e(`ai.conversation.message.role`),dataIndex:`role`,width:100,render:t=>(0,_.jsx)(d,{color:{user:`blue`,assistant:`green`,system:`orange`}[t]||`default`,children:e(`ai.conversation.message.role.${t}`,t)})},{title:e(`ai.conversation.message.agent`),dataIndex:`agent`,width:150,ellipsis:!0},{title:e(`ai.conversation.message.content`),dataIndex:`content`,ellipsis:!0},{title:e(`ai.conversation.message.createdAt`),dataIndex:`created_at`,width:180,render:e=>e?(0,h.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`}];return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`mb-5`,children:[(0,_.jsx)(v,{level:3,children:e(`ai.conversation.page.title`)}),(0,_.jsx)(y,{type:`secondary`,children:e(`ai.conversation.page.description`)})]}),(0,_.jsx)(p,{api:`/ai/conversation`,columns:M,rowKey:`id`,accessName:`ai.conversation`,addShow:!1,editShow:!1,formProps:!1,operateProps:{fixed:`right`,width:120},operateRender:(t,n)=>[(0,_.jsx)(o,{title:e(`ai.conversation.viewMessages`),children:(0,_.jsx)(c,{type:`primary`,icon:(0,_.jsx)(u,{}),size:`small`,onClick:()=>A(t)})},`view`),n.del],scroll:{x:1100},cardProps:{variant:`borderless`}}),(0,_.jsx)(a,{title:`${e(`ai.conversation.messageTitle`)} - ${r}`,open:t,onClose:()=>n(!1),width:900,children:(0,_.jsx)(s,{dataSource:l,columns:N,rowKey:`id`,loading:x,pagination:{current:T,total:C,pageSize:20,onChange:j,showSizeChanger:!1},scroll:{x:700},size:`small`})})]})}export{b as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{t}from"./jsx-runtime-CRBytmvs.js";import{o as n}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{t as r}from"./typography-DRFhazK9.js";import{a as i}from"./lodash-VautP0iT.js";import{t as a}from"./tooltip-SaeG1Uv7.js";import{t as o}from"./button-BILozH6U.js";import{t as s}from"./badge-__AeKia1.js";import{n as c}from"./LockOutlined-B8eRH1x4.js";import{t as l}from"./useTranslation-DBl6NYjI.js";import{t as u}from"./dict-CDRllPHM.js";import{t as d}from"./XinTable-NSSoHqA_.js";var f=t(),p=e(c(),1),{Title:m,Text:h}=r;function g(){let{t:e}=l(),t=n(),r=u(e=>e.initDict),c=[{title:e(`system.dict.id`),dataIndex:`id`,hideInForm:!0,width:80,sorter:!0,align:`center`},{title:e(`system.dict.name`),dataIndex:`name`,valueType:`text`,colProps:{span:12},rules:[{required:!0,message:e(`system.dict.name.required`)}]},{title:e(`system.dict.code`),dataIndex:`code`,valueType:`text`,colProps:{span:12},rules:[{required:!0,message:e(`system.dict.code.required`)}]},{title:e(`system.dict.status`),dataIndex:`status`,valueType:`select`,filters:[{text:e(`system.dict.status.normal`),value:0},{text:e(`system.dict.status.disabled`),value:1}],colProps:{span:12},rules:[{required:!0,message:e(`system.dict.status.required`)}],fieldProps:{options:[{label:e(`system.dict.status.normal`),value:0},{label:e(`system.dict.status.disabled`),value:1}]},render:t=>t===0?(0,f.jsx)(s,{status:`success`,text:e(`system.dict.status.normal`)}):(0,f.jsx)(s,{status:`error`,text:e(`system.dict.status.disabled`)})},{title:e(`system.dict.sort`),dataIndex:`sort`,valueType:`digit`,colProps:{span:12},hideInSearch:!0,fieldProps:{min:0,style:{width:`100%`}}},{title:e(`system.dict.describe`),dataIndex:`describe`,valueType:`textarea`,colProps:{span:24},hideInSearch:!0,ellipsis:!0},{title:e(`system.dict.createdAt`),dataIndex:`created_at`,render:e=>e?(0,p.default)(e).format(`YYYY-MM-DD HH:mm`):`-`,hideInForm:!0,hideInSearch:!0,width:160}],g=async()=>{await r(),window.$message?.success(e(`system.dict.refreshSuccess`))},_=e=>{t(`/system/dict/item?dictId=${e.id}&dictName=${encodeURIComponent(e.name||``)}&dictCode=${e.code}`)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`mb-5`,children:[(0,f.jsx)(m,{level:3,children:e(`system.dict.page.title`)}),(0,f.jsx)(h,{type:`secondary`,children:e(`system.dict.page.description`)})]}),(0,f.jsx)(d,{api:`/system/dict/list`,columns:c,rowKey:`id`,accessName:`system.dict.list`,searchProps:!1,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:[30,0]},layout:`vertical`},modalProps:{width:800},actionBarRender:t=>[t.add,(0,f.jsx)(o,{type:`primary`,onClick:g,children:e(`system.dict.refreshCache`)},`refresh`),t.keywordSearch],operateProps:{fixed:`right`,width:180},scroll:{x:1e3},operateRender:(t,n)=>[(0,f.jsx)(a,{title:e(`system.dict.manageItems`),children:(0,f.jsx)(o,{type:`default`,icon:(0,f.jsx)(i,{}),size:`small`,onClick:()=>_(t)})}),n.edit,n.del]})]})}export{g as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{t}from"./jsx-runtime-CRBytmvs.js";import{o as n}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{t as r}from"./typography-DRFhazK9.js";import{a as i}from"./lodash-DNhu68T6.js";import{t as a}from"./tooltip-SaeG1Uv7.js";import{t as o}from"./button-BILozH6U.js";import{t as s}from"./badge-__AeKia1.js";import{n as c}from"./LockOutlined-B8eRH1x4.js";import{t as l}from"./useTranslation-DBl6NYjI.js";import{t as u}from"./dict-CDRllPHM.js";import{t as d}from"./XinTable-BHebVDbz.js";var f=t(),p=e(c(),1),{Title:m,Text:h}=r;function g(){let{t:e}=l(),t=n(),r=u(e=>e.initDict),c=[{title:e(`system.dict.id`),dataIndex:`id`,hideInForm:!0,width:80,sorter:!0,align:`center`},{title:e(`system.dict.name`),dataIndex:`name`,valueType:`text`,colProps:{span:12},rules:[{required:!0,message:e(`system.dict.name.required`)}]},{title:e(`system.dict.code`),dataIndex:`code`,valueType:`text`,colProps:{span:12},rules:[{required:!0,message:e(`system.dict.code.required`)}]},{title:e(`system.dict.status`),dataIndex:`status`,valueType:`select`,filters:[{text:e(`system.dict.status.normal`),value:0},{text:e(`system.dict.status.disabled`),value:1}],colProps:{span:12},rules:[{required:!0,message:e(`system.dict.status.required`)}],fieldProps:{options:[{label:e(`system.dict.status.normal`),value:0},{label:e(`system.dict.status.disabled`),value:1}]},render:t=>t===0?(0,f.jsx)(s,{status:`success`,text:e(`system.dict.status.normal`)}):(0,f.jsx)(s,{status:`error`,text:e(`system.dict.status.disabled`)})},{title:e(`system.dict.sort`),dataIndex:`sort`,valueType:`digit`,colProps:{span:12},hideInSearch:!0,fieldProps:{min:0,style:{width:`100%`}}},{title:e(`system.dict.describe`),dataIndex:`describe`,valueType:`textarea`,colProps:{span:24},hideInSearch:!0,ellipsis:!0},{title:e(`system.dict.createdAt`),dataIndex:`created_at`,render:e=>e?(0,p.default)(e).format(`YYYY-MM-DD HH:mm`):`-`,hideInForm:!0,hideInSearch:!0,width:160}],g=async()=>{await r(),window.$message?.success(e(`system.dict.refreshSuccess`))},_=e=>{t(`/system/dict/item?dictId=${e.id}&dictName=${encodeURIComponent(e.name||``)}&dictCode=${e.code}`)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`mb-5`,children:[(0,f.jsx)(m,{level:3,children:e(`system.dict.page.title`)}),(0,f.jsx)(h,{type:`secondary`,children:e(`system.dict.page.description`)})]}),(0,f.jsx)(d,{api:`/system/dict/list`,columns:c,rowKey:`id`,accessName:`system.dict.list`,searchProps:!1,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:[30,0]},layout:`vertical`},modalProps:{width:800},actionBarRender:t=>[t.add,(0,f.jsx)(o,{type:`primary`,onClick:g,children:e(`system.dict.refreshCache`)},`refresh`),t.keywordSearch],operateProps:{fixed:`right`,width:180},scroll:{x:1e3},operateRender:(t,n)=>[(0,f.jsx)(a,{title:e(`system.dict.manageItems`),children:(0,f.jsx)(o,{type:`default`,icon:(0,f.jsx)(i,{}),size:`small`,onClick:()=>_(t)})}),n.edit,n.del]})]})}export{g as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./space-Cu4QVMgQ.js";import{c as a,t as o}from"./XinForm-B2aqXwsp.js";import{t as s}from"./card-DU2T2-YW.js";import{t as c}from"./divider-BWjoWWHX.js";import{r as l}from"./PictureOutlined-CB8Pr7jP.js";var u=e(t(),1),d=n(),{Title:f,Paragraph:p,Text:m}=r,h=()=>{let[e,t]=(0,u.useState)(``),n=(0,u.useRef)(void 0);return(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,d.jsx)(f,{level:2,children:`图标选择器组件示例`}),(0,d.jsx)(p,{children:`基于 Ant Design Select + Modal + Tabs 封装的图标选择器组件,支持多分类图标选择。`})]}),(0,d.jsxs)(i,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[(0,d.jsxs)(s,{title:`独立使用`,bordered:!0,children:[(0,d.jsx)(m,{children:`基础用法:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:e,onChange:e=>{t(e||``),e?l.success(`选中图标: ${e}`):l.info(`已清空图标`)},placeholder:`请选择图标`})}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`禁用状态:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:`HomeOutlined`,disabled:!0,placeholder:`禁用状态`})}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`只读状态:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:`SettingOutlined`,readonly:!0,placeholder:`只读状态`})}),(0,d.jsx)(m,{type:`secondary`,className:`mt-2 block text-sm`,children:`只读模式下不能打开选择弹窗,但可以清空`})]}),(0,d.jsx)(s,{title:`在 XinForm 中使用`,bordered:!0,children:(0,d.jsx)(o,{formRef:n,columns:[{dataIndex:`systemName`,title:`系统名称`,valueType:`text`,rules:[{required:!0,message:`请输入系统名称`}],fieldProps:{placeholder:`请输入系统名称`}},{dataIndex:`systemIcon`,title:`系统图标`,rules:[{required:!0,message:`请选择系统图标`}],fieldRender:()=>(0,d.jsx)(a,{placeholder:`请选择系统图标`})},{dataIndex:`description`,title:`系统描述`,valueType:`textarea`,fieldProps:{placeholder:`请输入系统描述`,rows:4}}],onFinish:async e=>(console.log(`XinForm 提交:`,e),l.success(`提交成功!`),l.info(`系统图标: ${e.systemIcon}`),!0),submitter:{submitText:`提交表单`,render:e=>e.submit}})})]})]})};export{h as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./space-Cu4QVMgQ.js";import{c as a,t as o}from"./XinForm-BWtl160T.js";import{t as s}from"./card-DU2T2-YW.js";import{t as c}from"./divider-BWjoWWHX.js";import{r as l}from"./PictureOutlined-CB8Pr7jP.js";var u=e(t(),1),d=n(),{Title:f,Paragraph:p,Text:m}=r,h=()=>{let[e,t]=(0,u.useState)(``),n=(0,u.useRef)(void 0);return(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,d.jsx)(f,{level:2,children:`图标选择器组件示例`}),(0,d.jsx)(p,{children:`基于 Ant Design Select + Modal + Tabs 封装的图标选择器组件,支持多分类图标选择。`})]}),(0,d.jsxs)(i,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[(0,d.jsxs)(s,{title:`独立使用`,bordered:!0,children:[(0,d.jsx)(m,{children:`基础用法:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:e,onChange:e=>{t(e||``),e?l.success(`选中图标: ${e}`):l.info(`已清空图标`)},placeholder:`请选择图标`})}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`禁用状态:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:`HomeOutlined`,disabled:!0,placeholder:`禁用状态`})}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`只读状态:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:`SettingOutlined`,readonly:!0,placeholder:`只读状态`})}),(0,d.jsx)(m,{type:`secondary`,className:`mt-2 block text-sm`,children:`只读模式下不能打开选择弹窗,但可以清空`})]}),(0,d.jsx)(s,{title:`在 XinForm 中使用`,bordered:!0,children:(0,d.jsx)(o,{formRef:n,columns:[{dataIndex:`systemName`,title:`系统名称`,valueType:`text`,rules:[{required:!0,message:`请输入系统名称`}],fieldProps:{placeholder:`请输入系统名称`}},{dataIndex:`systemIcon`,title:`系统图标`,rules:[{required:!0,message:`请选择系统图标`}],fieldRender:()=>(0,d.jsx)(a,{placeholder:`请选择系统图标`})},{dataIndex:`description`,title:`系统描述`,valueType:`textarea`,fieldProps:{placeholder:`请输入系统描述`,rows:4}}],onFinish:async e=>(console.log(`XinForm 提交:`,e),l.success(`提交成功!`),l.info(`系统图标: ${e.systemIcon}`),!0),submitter:{submitText:`提交表单`,render:e=>e.submit}})})]})]})};export{h as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{o as r,s as i}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{t as a}from"./typography-DRFhazK9.js";import{t as o}from"./space-Cu4QVMgQ.js";import{t as s}from"./button-BILozH6U.js";import{t as c}from"./LeftOutlined-8zj_FQJP.js";import{t as l}from"./badge-__AeKia1.js";import{n as u}from"./LockOutlined-B8eRH1x4.js";import{i as d,s as f}from"./XinForm-B2aqXwsp.js";import{t as p}from"./tag-DBV1bHre.js";import{t as m}from"./useTranslation-DBl6NYjI.js";import{t as h}from"./XinTable-NSSoHqA_.js";var g=[{label:`默认`,value:`default`},{label:`蓝色`,value:`blue`},{label:`绿色`,value:`green`},{label:`红色`,value:`red`},{label:`橙色`,value:`orange`},{label:`紫色`,value:`purple`},{label:`青色`,value:`cyan`},{label:`金色`,value:`gold`},{label:`绿黄色`,value:`lime`},{label:`极客蓝`,value:`geekblue`},{label:`品红`,value:`magenta`},{label:`火山红`,value:`volcano`}],_=e(t(),1),v=e(u(),1),y=n();function b(){let{t:e}=m(),t=r(),[n]=i(),u=n.get(`dictId`),b=n.get(`dictName`)||``,x=n.get(`dictCode`)||``,[S,C]=(0,_.useState)({id:u?parseInt(u):0,name:decodeURIComponent(b),code:x});(0,_.useEffect)(()=>{u&&C({id:parseInt(u),name:decodeURIComponent(b),code:x})},[u,b,x]);let w=[{title:e(`system.system.dict.item.id`),dataIndex:`id`,hideInForm:!0,width:80,align:`center`},{title:e(`system.system.dict.item.label`),dataIndex:`label`,valueType:`text`,rules:[{required:!0,message:e(`system.system.dict.item.label.required`)}]},{title:e(`system.system.dict.item.value`),dataIndex:`value`,valueType:`text`,rules:[{required:!0,message:e(`system.system.dict.item.value.required`)}]},{title:e(`system.system.dict.item.color`),dataIndex:`color`,valueType:`select`,colProps:{span:12},initialValue:`default`,fieldProps:{options:g.map(e=>({label:(0,y.jsx)(p,{color:e.value,children:e.label}),value:e.value}))},render:e=>(0,y.jsx)(p,{color:e,children:g.find(t=>t.value===e)?.label||e})},{title:e(`system.system.dict.item.isDefault`),dataIndex:`is_default`,valueType:`select`,colProps:{span:12},initialValue:0,rules:[{required:!0,message:e(`system.system.dict.item.isDefault.required`)}],fieldProps:{options:[{label:e(`system.system.dict.item.isDefault.yes`),value:1},{label:e(`system.system.dict.item.isDefault.no`),value:0}]},render:t=>t===1?(0,y.jsx)(p,{color:`blue`,children:e(`system.system.dict.item.isDefault.yes`)}):e(`system.system.dict.item.isDefault.no`)},{title:e(`system.system.dict.item.sort`),dataIndex:`sort`,valueType:`digit`,colProps:{span:12},hideInSearch:!0,initialValue:0,fieldProps:{min:0,style:{width:`100%`}}},{title:e(`system.system.dict.item.status`),dataIndex:`status`,valueType:`select`,colProps:{span:12},initialValue:0,rules:[{required:!0,message:e(`system.system.dict.item.status.required`)}],fieldProps:{options:[{label:e(`system.system.dict.item.status.normal`),value:0},{label:e(`system.system.dict.item.status.disabled`),value:1}]},render:t=>t===0?(0,y.jsx)(l,{status:`success`,text:e(`system.system.dict.item.status.normal`)}):(0,y.jsx)(l,{status:`error`,text:e(`system.system.dict.item.status.disabled`)})},{title:e(`system.system.dict.item.createTime`),dataIndex:`created_at`,render:e=>e?(0,v.default)(e).format(`YYYY-MM-DD HH:mm`):`-`,hideInForm:!0,hideInSearch:!0,width:160}];return S.id?(0,y.jsxs)(o,{orientation:`vertical`,style:{width:`100%`},children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(s,{type:`link`,onClick:()=>{t(`/system/dict`)},icon:(0,y.jsx)(c,{}),classNames:{root:`p-0 mb-2`},children:e(`system.dict.backToList`)}),(0,y.jsxs)(a.Title,{level:3,children:[(0,y.jsxs)(`span`,{className:`mr-2`,children:[e(`system.dict.itemManagement`),` - `,S.name]}),(0,y.jsx)(a.Text,{type:`secondary`,children:S.code})]})]}),(0,y.jsx)(h,{api:`/system/dict/item`,columns:w,rowKey:`id`,accessName:`system.dict.item`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:[30,0]}},modalProps:{width:600},requestParams:e=>({...e,dict_id:S.id}),searchShow:!1,handleFinish:async(t,n,r,i)=>(n===`create`?(await d(`/system/dict/item`,{...t,dict_id:S.id}),window.$message?.success(e(`system.dict.item.createSuccess`))):(await f(`/system/dict/item/`+i?.id,{...t,dict_id:S.id}),window.$message?.success(e(`system.dict.item.updateSuccess`))),!0)})]}):(0,y.jsx)(`div`,{style:{padding:50,textAlign:`center`},children:(0,y.jsx)(`div`,{style:{marginTop:50,color:`#999`},children:e(`system.dict.selectDictFirst`)})})}export{b as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{o as r,s as i}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{t as a}from"./typography-DRFhazK9.js";import{t as o}from"./space-Cu4QVMgQ.js";import{t as s}from"./button-BILozH6U.js";import{t as c}from"./LeftOutlined-8zj_FQJP.js";import{t as l}from"./badge-__AeKia1.js";import{n as u}from"./LockOutlined-B8eRH1x4.js";import{i as d,s as f}from"./XinForm-BWtl160T.js";import{t as p}from"./tag-DBV1bHre.js";import{t as m}from"./useTranslation-DBl6NYjI.js";import{t as h}from"./XinTable-BHebVDbz.js";var g=[{label:`默认`,value:`default`},{label:`蓝色`,value:`blue`},{label:`绿色`,value:`green`},{label:`红色`,value:`red`},{label:`橙色`,value:`orange`},{label:`紫色`,value:`purple`},{label:`青色`,value:`cyan`},{label:`金色`,value:`gold`},{label:`绿黄色`,value:`lime`},{label:`极客蓝`,value:`geekblue`},{label:`品红`,value:`magenta`},{label:`火山红`,value:`volcano`}],_=e(t(),1),v=e(u(),1),y=n();function b(){let{t:e}=m(),t=r(),[n]=i(),u=n.get(`dictId`),b=n.get(`dictName`)||``,x=n.get(`dictCode`)||``,[S,C]=(0,_.useState)({id:u?parseInt(u):0,name:decodeURIComponent(b),code:x});(0,_.useEffect)(()=>{u&&C({id:parseInt(u),name:decodeURIComponent(b),code:x})},[u,b,x]);let w=[{title:e(`system.system.dict.item.id`),dataIndex:`id`,hideInForm:!0,width:80,align:`center`},{title:e(`system.system.dict.item.label`),dataIndex:`label`,valueType:`text`,rules:[{required:!0,message:e(`system.system.dict.item.label.required`)}]},{title:e(`system.system.dict.item.value`),dataIndex:`value`,valueType:`text`,rules:[{required:!0,message:e(`system.system.dict.item.value.required`)}]},{title:e(`system.system.dict.item.color`),dataIndex:`color`,valueType:`select`,colProps:{span:12},initialValue:`default`,fieldProps:{options:g.map(e=>({label:(0,y.jsx)(p,{color:e.value,children:e.label}),value:e.value}))},render:e=>(0,y.jsx)(p,{color:e,children:g.find(t=>t.value===e)?.label||e})},{title:e(`system.system.dict.item.isDefault`),dataIndex:`is_default`,valueType:`select`,colProps:{span:12},initialValue:0,rules:[{required:!0,message:e(`system.system.dict.item.isDefault.required`)}],fieldProps:{options:[{label:e(`system.system.dict.item.isDefault.yes`),value:1},{label:e(`system.system.dict.item.isDefault.no`),value:0}]},render:t=>t===1?(0,y.jsx)(p,{color:`blue`,children:e(`system.system.dict.item.isDefault.yes`)}):e(`system.system.dict.item.isDefault.no`)},{title:e(`system.system.dict.item.sort`),dataIndex:`sort`,valueType:`digit`,colProps:{span:12},hideInSearch:!0,initialValue:0,fieldProps:{min:0,style:{width:`100%`}}},{title:e(`system.system.dict.item.status`),dataIndex:`status`,valueType:`select`,colProps:{span:12},initialValue:0,rules:[{required:!0,message:e(`system.system.dict.item.status.required`)}],fieldProps:{options:[{label:e(`system.system.dict.item.status.normal`),value:0},{label:e(`system.system.dict.item.status.disabled`),value:1}]},render:t=>t===0?(0,y.jsx)(l,{status:`success`,text:e(`system.system.dict.item.status.normal`)}):(0,y.jsx)(l,{status:`error`,text:e(`system.system.dict.item.status.disabled`)})},{title:e(`system.system.dict.item.createTime`),dataIndex:`created_at`,render:e=>e?(0,v.default)(e).format(`YYYY-MM-DD HH:mm`):`-`,hideInForm:!0,hideInSearch:!0,width:160}];return S.id?(0,y.jsxs)(o,{orientation:`vertical`,style:{width:`100%`},children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(s,{type:`link`,onClick:()=>{t(`/system/dict`)},icon:(0,y.jsx)(c,{}),classNames:{root:`p-0 mb-2`},children:e(`system.dict.backToList`)}),(0,y.jsxs)(a.Title,{level:3,children:[(0,y.jsxs)(`span`,{className:`mr-2`,children:[e(`system.dict.itemManagement`),` - `,S.name]}),(0,y.jsx)(a.Text,{type:`secondary`,children:S.code})]})]}),(0,y.jsx)(h,{api:`/system/dict/item`,columns:w,rowKey:`id`,accessName:`system.dict.item`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:[30,0]}},modalProps:{width:600},requestParams:e=>({...e,dict_id:S.id}),searchShow:!1,handleFinish:async(t,n,r,i)=>(n===`create`?(await d(`/system/dict/item`,{...t,dict_id:S.id}),window.$message?.success(e(`system.dict.item.createSuccess`))):(await f(`/system/dict/item/`+i?.id,{...t,dict_id:S.id}),window.$message?.success(e(`system.dict.item.updateSuccess`))),!0)})]}):(0,y.jsx)(`div`,{style:{padding:50,textAlign:`center`},children:(0,y.jsx)(`div`,{style:{marginTop:50,color:`#999`},children:e(`system.dict.selectDictFirst`)})})}export{b as default};
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-bd65Ar6c.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-NSSoHqA_.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`客户等级`}),(0,s.jsx)(l,{type:`secondary`,children:`同一商品按客户等级显示不同单价,门店绑定等级后小程序端按对应价格展示。`})]}),(0,s.jsx)(a,{api:`/customer/level`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`等级名称`,dataIndex:`name`,valueType:`text`,required:!0,align:`center`,rules:[{required:!0,message:`请输入等级名称`}]},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0}},{title:`图片等级`,dataIndex:`icon_id`,valueType:`image`,fieldProps:{action:`/customer/level/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.icon_url;return n?(0,s.jsx)(r,{src:n,width:30,height:30,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})}},{title:`创建时间`,dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.level`,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-zUz1CRv3.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-BHebVDbz.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`客户等级`}),(0,s.jsx)(l,{type:`secondary`,children:`同一商品按客户等级显示不同单价,门店绑定等级后小程序端按对应价格展示。`})]}),(0,s.jsx)(a,{api:`/customer/level`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`等级名称`,dataIndex:`name`,valueType:`text`,required:!0,align:`center`,rules:[{required:!0,message:`请输入等级名称`}]},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0}},{title:`图片等级`,dataIndex:`icon_id`,valueType:`image`,fieldProps:{action:`/customer/level/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.icon_url;return n?(0,s.jsx)(r,{src:n,width:30,height:30,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})}},{title:`创建时间`,dataIndex:`updated_at`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.level`,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{t as a}from"./space-Cu4QVMgQ.js";import{t as o}from"./button-BILozH6U.js";import{r as s}from"./DoubleRightOutlined-Blfli1UU.js";import{t as c}from"./modal-g8Q5gNCx.js";import{t as l}from"./form-B3R3kIqp.js";import{r as u}from"./PictureOutlined-CB8Pr7jP.js";import{t as d}from"./popconfirm-DyseZgpU.js";import{t as f}from"./tag-DBV1bHre.js";import{t as p}from"./XinTable-NSSoHqA_.js";import{t as m}from"./AuthButton-DvrpreK4.js";import{t as h}from"./store-JDnJsv44.js";var g=e(t(),1),_={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}};async function v(e,t){return r({url:`/customer/miniUser/${e}/bind`,method:`put`,data:t})}async function y(e,t){return r({url:`/customer/miniUser/${e}/status`,method:`put`,data:{status:t}})}var b=n(),{Title:x,Text:S}=i,C=()=>{let e=(0,g.useRef)(null),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(!1),[C,w]=(0,g.useState)(null),[T,E]=(0,g.useState)(!1),[D]=l.useForm();(0,g.useEffect)(()=>{h().then(e=>n(e.data.data??[]))},[]);let O=e=>{w(e),D.setFieldsValue({store_id:e.store_id||void 0}),i(!0)},k=async t=>{if(C?.id){E(!0);try{await v(C.id,{store_id:t.store_id}),u.success(`绑定成功`),i(!1),await e.current?.reload()}finally{E(!1)}}},A=async t=>{await y(t.id,t.status===1?0:1),u.success(t.status===1?`已停用`:`已启用`),await e.current?.reload()};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`mb-5`,children:[(0,b.jsx)(x,{level:3,children:`小程序用户`}),(0,b.jsx)(S,{type:`secondary`,children:`用户由微信小程序登录自动创建;`})]}),(0,b.jsx)(p,{api:`/customer/miniUser`,columns:[{title:`ID`,dataIndex:`id`,hideInSearch:!0,width:70,align:`center`},{title:`昵称`,dataIndex:`nickname`,valueType:`text`,hideInSearch:!0,render:(e,t)=>(0,b.jsxs)(a,{size:8,children:[t.avatar?(0,b.jsx)(`img`,{src:t.avatar,alt:``,className:`h-6 w-6 rounded-full`}):null,(0,b.jsx)(`span`,{children:t.nickname||`-`})]})},{title:`手机号`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0,render:(e,t)=>t.phone||(0,b.jsx)(S,{type:`secondary`,children:`未绑定`})},{title:`绑定门店`,dataIndex:`store_id`,hideInSearch:!0,render:(e,t)=>(0,b.jsx)(f,{color:`blue`,children:t.store?.name??`门店#${t.store_id}`})},{title:`状态`,dataIndex:`status`,valueType:`select`,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=_[t.status??1];return(0,b.jsx)(f,{color:n?.color,children:n?.text})},align:`center`},{title:`最后登录`,dataIndex:`last_login_at`,hideInSearch:!0,align:`center`,render:(e,t)=>t.last_login_at??(0,b.jsx)(S,{type:`secondary`,children:`从未登录`})},{title:`注册时间`,dataIndex:`created_at`,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.miniUser`,tableRef:e,operateRender:e=>[(0,b.jsx)(m,{auth:`customer.miniUser.bind`,children:(0,b.jsx)(o,{size:`small`,color:`blue`,variant:`outlined`,onClick:()=>O(e),children:`绑定`})},`bind`),(0,b.jsx)(m,{auth:`customer.miniUser.update`,children:(0,b.jsx)(d,{title:e.status===1?`确定停用该账号?`:`确定启用该账号?`,description:e.status===1?`停用后该用户将无法登录小程序`:void 0,onConfirm:()=>A(e),children:(0,b.jsx)(o,{size:`small`,danger:e.status===1,children:e.status===1?`停用`:`启用`})})},`status`)],formProps:!1}),(0,b.jsx)(c,{title:`绑定主体 · ${C?.nickname||``}`,open:r,onCancel:()=>i(!1),onOk:()=>D.submit(),confirmLoading:T,okText:`确认绑定`,destroyOnHidden:!0,children:(0,b.jsx)(l,{form:D,layout:`vertical`,onFinish:k,className:`mt-4`,children:(0,b.jsx)(l.Item,{label:`绑定门店`,name:`store_id`,rules:[{required:!0,message:`请选择门店`}],children:(0,b.jsx)(s,{showSearch:{optionFilterProp:`label`},placeholder:`选择门店`,options:t.map(e=>({label:`${e.name}${e.code}`,value:e.id}))})})})})]})};export{C as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{t as a}from"./space-Cu4QVMgQ.js";import{t as o}from"./button-BILozH6U.js";import{r as s}from"./DoubleRightOutlined-Blfli1UU.js";import{t as c}from"./modal-g8Q5gNCx.js";import{t as l}from"./form-B3R3kIqp.js";import{r as u}from"./PictureOutlined-CB8Pr7jP.js";import{t as d}from"./popconfirm-DyseZgpU.js";import{t as f}from"./tag-DBV1bHre.js";import{t as p}from"./XinTable-BHebVDbz.js";import{t as m}from"./AuthButton-DvrpreK4.js";import{t as h}from"./store-JDnJsv44.js";var g=e(t(),1),_={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}};async function v(e,t){return r({url:`/customer/miniUser/${e}/bind`,method:`put`,data:t})}async function y(e,t){return r({url:`/customer/miniUser/${e}/status`,method:`put`,data:{status:t}})}var b=n(),{Title:x,Text:S}=i,C=()=>{let e=(0,g.useRef)(null),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(!1),[C,w]=(0,g.useState)(null),[T,E]=(0,g.useState)(!1),[D]=l.useForm();(0,g.useEffect)(()=>{h().then(e=>n(e.data.data??[]))},[]);let O=e=>{w(e),D.setFieldsValue({store_id:e.store_id||void 0}),i(!0)},k=async t=>{if(C?.id){E(!0);try{await v(C.id,{store_id:t.store_id}),u.success(`绑定成功`),i(!1),await e.current?.reload()}finally{E(!1)}}},A=async t=>{await y(t.id,t.status===1?0:1),u.success(t.status===1?`已停用`:`已启用`),await e.current?.reload()};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`mb-5`,children:[(0,b.jsx)(x,{level:3,children:`小程序用户`}),(0,b.jsx)(S,{type:`secondary`,children:`用户由微信小程序登录自动创建;`})]}),(0,b.jsx)(p,{api:`/customer/miniUser`,columns:[{title:`ID`,dataIndex:`id`,hideInSearch:!0,width:70,align:`center`},{title:`昵称`,dataIndex:`nickname`,valueType:`text`,hideInSearch:!0,render:(e,t)=>(0,b.jsxs)(a,{size:8,children:[t.avatar?(0,b.jsx)(`img`,{src:t.avatar,alt:``,className:`h-6 w-6 rounded-full`}):null,(0,b.jsx)(`span`,{children:t.nickname||`-`})]})},{title:`手机号`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0,render:(e,t)=>t.phone||(0,b.jsx)(S,{type:`secondary`,children:`未绑定`})},{title:`绑定门店`,dataIndex:`store_id`,hideInSearch:!0,render:(e,t)=>(0,b.jsx)(f,{color:`blue`,children:t.store?.name??`门店#${t.store_id}`})},{title:`状态`,dataIndex:`status`,valueType:`select`,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=_[t.status??1];return(0,b.jsx)(f,{color:n?.color,children:n?.text})},align:`center`},{title:`最后登录`,dataIndex:`last_login_at`,hideInSearch:!0,align:`center`,render:(e,t)=>t.last_login_at??(0,b.jsx)(S,{type:`secondary`,children:`从未登录`})},{title:`注册时间`,dataIndex:`created_at`,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.miniUser`,tableRef:e,operateRender:e=>[(0,b.jsx)(m,{auth:`customer.miniUser.bind`,children:(0,b.jsx)(o,{size:`small`,color:`blue`,variant:`outlined`,onClick:()=>O(e),children:`绑定`})},`bind`),(0,b.jsx)(m,{auth:`customer.miniUser.update`,children:(0,b.jsx)(d,{title:e.status===1?`确定停用该账号?`:`确定启用该账号?`,description:e.status===1?`停用后该用户将无法登录小程序`:void 0,onConfirm:()=>A(e),children:(0,b.jsx)(o,{size:`small`,danger:e.status===1,children:e.status===1?`停用`:`启用`})})},`status`)],formProps:!1}),(0,b.jsx)(c,{title:`绑定主体 · ${C?.nickname||``}`,open:r,onCancel:()=>i(!1),onOk:()=>D.submit(),confirmLoading:T,okText:`确认绑定`,destroyOnHidden:!0,children:(0,b.jsx)(l,{form:D,layout:`vertical`,onFinish:k,className:`mt-4`,children:(0,b.jsx)(l.Item,{label:`绑定门店`,name:`store_id`,rules:[{required:!0,message:`请选择门店`}],children:(0,b.jsx)(s,{showSearch:{optionFilterProp:`label`},placeholder:`选择门店`,options:t.map(e=>({label:`${e.name}${e.code}`,value:e.id}))})})})})]})};export{C as default};
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-bd65Ar6c.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-NSSoHqA_.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`宫格导航`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页宫格入口(如商品分类、促销活动等);停用后不展示,排序越小越靠前。`})]}),(0,s.jsx)(a,{api:`/client/nav`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`导航名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入导航名称`}]},{title:`导航图标`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传导航图标`}],fieldProps:{action:`/client/nav/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:40,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/category/index`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.nav`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:640}})]});export{u as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-zUz1CRv3.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-BHebVDbz.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`宫格导航`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页宫格入口(如商品分类、促销活动等);停用后不展示,排序越小越靠前。`})]}),(0,s.jsx)(a,{api:`/client/nav`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`导航名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入导航名称`}]},{title:`导航图标`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传导航图标`}],fieldProps:{action:`/client/nav/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:40,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/category/index`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.nav`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:640}})]});export{u as default};
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./tag-DBV1bHre.js";import{t as i}from"./XinTable-NSSoHqA_.js";e();var a={order:{text:`订单`,color:`blue`},price:{text:`价格`,color:`gold`},system:{text:`系统`,color:`default`}},o={0:{text:`未读`,color:`warning`},1:{text:`已读`,color:`default`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`通知管理`}),(0,s.jsx)(l,{type:`secondary`,children:`向小程序用户发送消息;接收对象留空或填 0 为全员广播,价格调整通知由批量调价自动生成。`})]}),(0,s.jsx)(i,{api:`/customer/notice`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`标题`,dataIndex:`title`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入通知标题`}]},{title:`类型`,dataIndex:`type`,valueType:`select`,initialValue:`system`,required:!0,rules:[{required:!0,message:`请选择通知类型`}],fieldProps:{options:[{value:`system`,label:`系统`},{value:`order`,label:`订单`},{value:`price`,label:`价格`}]},render:(e,t)=>{let n=a[t.type??`system`];return(0,s.jsx)(r,{color:n?.color,children:n?.text})}},{title:`接收对象`,dataIndex:`user_id`,valueType:`digit`,hideInTable:!1,hideInSearch:!0,fieldProps:{min:0,precision:0,placeholder:`留空或 0 = 全员广播`},align:`center`,render:(e,t)=>t.user_id===0?(0,s.jsx)(r,{color:`gold`,children:`全员广播`}):(0,s.jsx)(r,{children:`用户 #${t.user_id}`})},{title:`内容`,dataIndex:`content`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:3}},{title:`阅读状态`,dataIndex:`is_read`,valueType:`select`,hideInForm:!0,fieldProps:{options:[{value:0,label:`未读`},{value:1,label:`已读`}]},render:(e,t)=>{let n=o[t.is_read??0];return(0,s.jsx)(r,{color:n?.color,children:n?.text})},align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.notice`,editShow:()=>!1,formProps:{grid:!0,colProps:{span:12},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./tag-DBV1bHre.js";import{t as i}from"./XinTable-BHebVDbz.js";e();var a={order:{text:`订单`,color:`blue`},price:{text:`价格`,color:`gold`},system:{text:`系统`,color:`default`}},o={0:{text:`未读`,color:`warning`},1:{text:`已读`,color:`default`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`通知管理`}),(0,s.jsx)(l,{type:`secondary`,children:`向小程序用户发送消息;接收对象留空或填 0 为全员广播,价格调整通知由批量调价自动生成。`})]}),(0,s.jsx)(i,{api:`/customer/notice`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`标题`,dataIndex:`title`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入通知标题`}]},{title:`类型`,dataIndex:`type`,valueType:`select`,initialValue:`system`,required:!0,rules:[{required:!0,message:`请选择通知类型`}],fieldProps:{options:[{value:`system`,label:`系统`},{value:`order`,label:`订单`},{value:`price`,label:`价格`}]},render:(e,t)=>{let n=a[t.type??`system`];return(0,s.jsx)(r,{color:n?.color,children:n?.text})}},{title:`接收对象`,dataIndex:`user_id`,valueType:`digit`,hideInTable:!1,hideInSearch:!0,fieldProps:{min:0,precision:0,placeholder:`留空或 0 = 全员广播`},align:`center`,render:(e,t)=>t.user_id===0?(0,s.jsx)(r,{color:`gold`,children:`全员广播`}):(0,s.jsx)(r,{children:`用户 #${t.user_id}`})},{title:`内容`,dataIndex:`content`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:3}},{title:`阅读状态`,dataIndex:`is_read`,valueType:`select`,hideInForm:!0,fieldProps:{options:[{value:0,label:`未读`},{value:1,label:`已读`}]},render:(e,t)=>{let n=o[t.is_read??0];return(0,s.jsx)(r,{color:n?.color,children:n?.text})},align:`center`},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`customer.notice`,editShow:()=>!1,formProps:{grid:!0,colProps:{span:12},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-bd65Ar6c.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-NSSoHqA_.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`促销推荐卡片`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页促销位卡片;副标题展示促销文案,停用后不展示,排序越小越靠前。`})]}),(0,s.jsx)(a,{api:`/client/promo`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`卡片标题`,dataIndex:`title`,valueType:`text`},{title:`副标题`,dataIndex:`sub_title`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`促销文案,如「限时特惠 8 折起」`},render:(e,t)=>t.sub_title||`-`},{title:`卡片图片`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传卡片图片`}],fieldProps:{action:`/client/promo/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:80,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/promo/detail?id=1`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.promo`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./image-zUz1CRv3.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-BHebVDbz.js";e();var o={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},s=t(),{Title:c,Text:l}=n,u=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`mb-5`,children:[(0,s.jsx)(c,{level:3,children:`促销推荐卡片`}),(0,s.jsx)(l,{type:`secondary`,children:`小程序首页促销位卡片;副标题展示促销文案,停用后不展示,排序越小越靠前。`})]}),(0,s.jsx)(a,{api:`/client/promo`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`卡片标题`,dataIndex:`title`,valueType:`text`},{title:`副标题`,dataIndex:`sub_title`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`促销文案,如「限时特惠 8 折起」`},render:(e,t)=>t.sub_title||`-`},{title:`卡片图片`,dataIndex:`image_id`,valueType:`image`,required:!0,rules:[{required:!0,message:`请上传卡片图片`}],fieldProps:{action:`/client/promo/upload`,mode:`single`,maxCount:1,changeType:`id`},render:(e,t)=>{let n=t.image_url;return n?(0,s.jsx)(r,{src:n,width:80,height:40,style:{objectFit:`cover`,borderRadius:4}}):`-`},align:`center`,hideInSearch:!0},{title:`跳转链接`,dataIndex:`link`,valueType:`text`,hideInSearch:!0,fieldProps:{placeholder:`小程序页面路径,如 /pages/promo/detail?id=1`},render:(e,t)=>t.link||`-`},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`,width:80},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=o[t.status??1];return(0,s.jsx)(i,{color:n?.color,children:n?.text})},align:`center`,width:90},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`client.promo`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`},modalProps:{width:640}})]});export{u as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Ct as t,Dr as n,St as r,Tt as i,Vn as a,Wt as o,Yn as s,Zt as c,st as l,wr as u,xn as d,xt as f,zn as p}from"./jsx-runtime-CRBytmvs.js";import{n as m}from"./PlusOutlined-B8K2rG8r.js";var h=e(n()),g=e=>{let{value:n,formatter:r,precision:a,decimalSeparator:o,groupSeparator:s=``,prefixCls:c,className:l,style:u}=e,d;if(t(r))d=r(n);else{let e=String(n),t=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(!t||e===`-`)d=e;else{let e=t[1],n=t[2]||`0`,r=t[4]||``;n=n.replace(/\B(?=(\d{3})+(?!\d))/g,s),i(a)&&(r=r.padEnd(a,`0`).slice(0,a>0?a:0)),r&&=`${o}${r}`,d=[h.createElement(`span`,{key:`int`,className:`${c}-content-value-int`},e,n),r&&h.createElement(`span`,{key:`decimal`,className:`${c}-content-value-decimal`},r)]}}return h.createElement(`span`,{className:l,style:u},d)},_=e=>{let{componentCls:t,marginXXS:n,padding:r,colorTextDescription:i,titleFontSize:a,colorTextHeading:o,contentFontSize:s,fontFamily:l}=e;return{[t]:{...c(e),[`${t}-header`]:{paddingBottom:n,[`${t}-title`]:{color:i,fontSize:a}},[`${t}-skeleton`]:{paddingTop:r},[`${t}-content`]:{color:o,fontSize:s,fontFamily:l,[`${t}-content-value`]:{display:`inline-block`,direction:`ltr`},[`${t}-content-prefix, ${t}-content-suffix`]:{display:`inline-block`},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}}}},v=o(`Statistic`,e=>_(d(e,{})),e=>{let{fontSizeHeading3:t,fontSize:n}=e;return{titleFontSize:n,contentFontSize:t}}),y=h.forwardRef((e,n)=>{let{prefixCls:i,className:o,rootClassName:c,style:l,valueStyle:u,value:d=0,title:_,valueRender:y,prefix:b,suffix:x,loading:S=!1,formatter:C,precision:w,decimalSeparator:T=`.`,groupSeparator:E=`,`,onMouseEnter:D,onMouseLeave:O,styles:k,classNames:A,...ee}=e,{getPrefixCls:j,direction:M,className:N,style:P,classNames:F,styles:I}=p(`statistic`),L=j(`statistic`,i),[R,z]=v(L),B={...e,decimalSeparator:T,groupSeparator:E,loading:S,value:d},V=r(P),H=r(l),[U,W]=f([F,A],[I,V,k,H],{props:B}),G=a(L,{[`${L}-rtl`]:M===`rtl`},N,o,c,U.root,R,z),K=a(`${L}-header`,U.header),q=a(`${L}-title`,U.title),J=a(`${L}-content`,U.content),Y=a(`${L}-content-value`,U.value),X=a(`${L}-content-prefix`,U.prefix),Z=a(`${L}-content-suffix`,U.suffix),Q=h.createElement(g,{decimalSeparator:T,groupSeparator:E,prefixCls:L,formatter:C,precision:w,value:d,className:Y,style:W.value}),$=h.useRef(null);h.useImperativeHandle(n,()=>({nativeElement:$.current}));let te=s(ee,{aria:!0,data:!0});return h.createElement(`div`,{...te,className:G,style:W.root,ref:$,onMouseEnter:D,onMouseLeave:O},_&&h.createElement(`div`,{className:K,style:W.header},h.createElement(`div`,{className:q,style:W.title},_)),h.createElement(m,{paragraph:!1,loading:S,className:`${L}-skeleton`,active:!0},h.createElement(`div`,{className:J,style:{...u,...W.content}},b&&h.createElement(`span`,{className:X,style:W.prefix},b),t(y)?y(Q):Q,x&&h.createElement(`span`,{className:Z,style:W.suffix},x))))}),b=[[`Y`,1e3*60*60*24*365],[`M`,1e3*60*60*24*30],[`D`,1e3*60*60*24],[`H`,1e3*60*60],[`m`,1e3*60],[`s`,1e3],[`S`,1]];function x(e,t){let n=e,r=/\[[^\]]*]/g,i=(t.match(r)||[]).map(e=>e.slice(1,-1)),a=t.replace(r,`[]`),o=b.reduce((e,[t,r])=>{if(e.includes(t)){let i=Math.floor(n/r);return n-=i*r,e.replace(RegExp(`${t}+`,`g`),e=>{let t=e.length;return i.toString().padStart(t,`0`)})}return e},a),s=0;return o.replace(r,()=>{let e=i[s];return s+=1,e})}function S(e,t,n){let{format:r=``}=t,i=new Date(e).getTime(),a=Date.now();return x(Math.max(n?i-a:a-i,0),r)}var C=1e3/60;function w(e){return new Date(e).getTime()}var T=e=>{let{value:t,format:n=`HH:mm:ss`,onChange:r,onFinish:i,type:a,...o}=e,s=a===`countdown`,[c,d]=h.useState(null),f=u(()=>{let e=Date.now(),n=w(t);d({});let a=s?n-e:e-n;return r?.(a),s&&n<e?(i?.(),!1):!0});h.useEffect(()=>{let e,t=()=>{f()||window.clearInterval(e)},n=()=>{e=window.setInterval(t,C)},r=()=>{window.clearInterval(e)};return n(),()=>{r()}},[t,s]),h.useEffect(()=>{d({})},[]);let p=(e,t)=>c?S(e,{...t,format:n},s):`-`,m=e=>l(e,{title:void 0});return h.createElement(y,{...o,value:t,valueRender:m,formatter:p})},E=h.memo(e=>h.createElement(T,{...e,type:`countdown`}));y.Timer=T,y.Countdown=E;var D=y;export{D as t};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-NSSoHqA_.js";import{t as o}from"./level-D21a7wOc.js";var s=e(t(),1),c={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},l=n(),{Title:u,Text:d}=r,f=()=>{let[e,t]=(0,s.useState)([]);(0,s.useEffect)(()=>{o().then(e=>t(e.data.data??[]))},[]);let n={api:`/customer/store`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`门店名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入门店名称`}]},{title:`门店编码`,dataIndex:`code`,valueType:`text`,hideInForm:!0},{title:`客户等级`,dataIndex:`level_id`,valueType:`select`,required:!0,rules:[{required:!0,message:`请选择客户等级`}],fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.level?(0,l.jsx)(i,{color:`blue`,children:t.level.name}):(0,l.jsx)(i,{children:`未设置`})},{title:`联系人`,dataIndex:`contact`,valueType:`text`,hideInSearch:!0},{title:`联系电话`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0},{title:`门店地址`,dataIndex:`address`,valueType:`textarea`,hideInSearch:!0,fieldProps:{rows:1},colProps:{span:24}},{title:`回款周期(天)`,dataIndex:`payment_cycle_days`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`},{title:`总采购金额`,dataIndex:`total_purchase_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,l.jsxs)(d,{strong:!0,className:`text-[red]`,children:[`¥`,t.total_purchase_amount??`0.00`]})},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=c[t.status??1];return(0,l.jsx)(i,{color:n?.color,children:n?.text})}},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2},colProps:{span:24}}],rowKey:`id`,accessName:`customer.store`,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:720}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`mb-5`,children:[(0,l.jsx)(u,{level:3,children:`门店管理`}),(0,l.jsx)(d,{type:`secondary`,children:`门店即客户,小程序下单主体;客户等级决定商品价格,回款周期影响对账单应结算日期。`})]}),(0,l.jsx)(a,{...n})]})};export{f as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./tag-DBV1bHre.js";import{t as a}from"./XinTable-BHebVDbz.js";import{t as o}from"./level-D21a7wOc.js";var s=e(t(),1),c={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},l=n(),{Title:u,Text:d}=r,f=()=>{let[e,t]=(0,s.useState)([]);(0,s.useEffect)(()=>{o().then(e=>t(e.data.data??[]))},[]);let n={api:`/customer/store`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`门店名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入门店名称`}]},{title:`门店编码`,dataIndex:`code`,valueType:`text`,hideInForm:!0},{title:`客户等级`,dataIndex:`level_id`,valueType:`select`,required:!0,rules:[{required:!0,message:`请选择客户等级`}],fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.level?(0,l.jsx)(i,{color:`blue`,children:t.level.name}):(0,l.jsx)(i,{children:`未设置`})},{title:`联系人`,dataIndex:`contact`,valueType:`text`,hideInSearch:!0},{title:`联系电话`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0},{title:`门店地址`,dataIndex:`address`,valueType:`textarea`,hideInSearch:!0,fieldProps:{rows:1},colProps:{span:24}},{title:`回款周期(天)`,dataIndex:`payment_cycle_days`,valueType:`digit`,hideInSearch:!0,initialValue:0,fieldProps:{min:0,precision:0},align:`center`},{title:`总采购金额`,dataIndex:`total_purchase_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,l.jsxs)(d,{strong:!0,className:`text-[red]`,children:[`¥`,t.total_purchase_amount??`0.00`]})},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=c[t.status??1];return(0,l.jsx)(i,{color:n?.color,children:n?.text})}},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2},colProps:{span:24}}],rowKey:`id`,accessName:`customer.store`,formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},modalProps:{width:720}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`mb-5`,children:[(0,l.jsx)(u,{level:3,children:`门店管理`}),(0,l.jsx)(d,{type:`secondary`,children:`门店即客户,小程序下单主体;客户等级决定商品价格,回款周期影响对账单应结算日期。`})]}),(0,l.jsx)(a,{...n})]})};export{f as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./tag-DBV1bHre.js";import{t as i}from"./XinTable-NSSoHqA_.js";e();var a={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},o=t(),{Title:s,Text:c}=n,l=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`mb-5`,children:[(0,o.jsx)(s,{level:3,children:`供应商管理`}),(0,o.jsx)(c,{type:`secondary`,children:`采购单接收方,供应商小程序端接收并确认采购单。`})]}),(0,o.jsx)(i,{api:`/customer/supplier`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`供应商名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入供应商名称`}]},{title:`联系人`,dataIndex:`contact`,valueType:`text`,hideInSearch:!0},{title:`联系电话`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0},{title:`主营品类`,dataIndex:`main_products`,valueType:`text`,hideInSearch:!0,render:(e,t)=>t.main_products?t.main_products.split(`/`).map(e=>(0,o.jsx)(r,{color:`green`,children:e},e)):`-`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=a[t.status??1];return(0,o.jsx)(r,{color:n?.color,children:n?.text})}},{title:`地址`,dataIndex:`address`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2}},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2}}],rowKey:`id`,accessName:`customer.supplier`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:720}})]});export{l as default};
import"./rolldown-runtime-BgaNhQyE.js";import{Dr as e,t}from"./jsx-runtime-CRBytmvs.js";import{t as n}from"./typography-DRFhazK9.js";import{t as r}from"./tag-DBV1bHre.js";import{t as i}from"./XinTable-BHebVDbz.js";e();var a={0:{text:`停用`,color:`error`},1:{text:`正常`,color:`success`}},o=t(),{Title:s,Text:c}=n,l=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`mb-5`,children:[(0,o.jsx)(s,{level:3,children:`供应商管理`}),(0,o.jsx)(c,{type:`secondary`,children:`采购单接收方,供应商小程序端接收并确认采购单。`})]}),(0,o.jsx)(i,{api:`/customer/supplier`,columns:[{title:`ID`,dataIndex:`id`,hideInForm:!0,hideInSearch:!0,width:70,align:`center`},{title:`供应商名称`,dataIndex:`name`,valueType:`text`,required:!0,rules:[{required:!0,message:`请输入供应商名称`}]},{title:`联系人`,dataIndex:`contact`,valueType:`text`,hideInSearch:!0},{title:`联系电话`,dataIndex:`phone`,valueType:`text`,hideInSearch:!0},{title:`主营品类`,dataIndex:`main_products`,valueType:`text`,hideInSearch:!0,render:(e,t)=>t.main_products?t.main_products.split(`/`).map(e=>(0,o.jsx)(r,{color:`green`,children:e},e)):`-`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`正常`},{value:0,label:`停用`}]},render:(e,t)=>{let n=a[t.status??1];return(0,o.jsx)(r,{color:n?.color,children:n?.text})}},{title:`地址`,dataIndex:`address`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2}},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInSearch:!0,hideInTable:!0,fieldProps:{rows:2}}],rowKey:`id`,accessName:`customer.supplier`,formProps:{grid:!0,colProps:{span:12},layout:`vertical`,rowProps:{gutter:24}},modalProps:{width:720}})]});export{l as default};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./space-Cu4QVMgQ.js";import{r as a,t as o}from"./XinForm-B2aqXwsp.js";import{t as s}from"./card-DU2T2-YW.js";import{t as c}from"./divider-BWjoWWHX.js";import{r as l}from"./PictureOutlined-CB8Pr7jP.js";var u=e(t(),1),d=n(),{Title:f,Paragraph:p,Text:m}=r,h=()=>{let[e,t]=(0,u.useState)(null),[n,h]=(0,u.useState)([]),g=(0,u.useRef)(void 0);return(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,d.jsx)(f,{level:2,children:`用户选择器组件示例`}),(0,d.jsx)(p,{children:`基于 AntDesign 封装的用户选择器表单组件,支持单选和多选模式。`})]}),(0,d.jsxs)(i,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[(0,d.jsxs)(s,{title:`独立使用`,bordered:!0,children:[(0,d.jsx)(m,{children:`单选模式:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:e,onChange:e=>{t(e),l.success(`选中用户ID: ${e}`)},placeholder:`请选择用户`})}),(0,d.jsxs)(m,{type:`secondary`,className:`mt-2 block`,children:[`当前选中: `,e||`未选择`]}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`多选模式:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{mode:`multiple`,value:n,onChange:e=>{h(e),l.success(`选中${e.length}个用户`)},placeholder:`请选择多个用户`,maxTagCount:3})}),(0,d.jsxs)(m,{type:`secondary`,className:`mt-2 block`,children:[`当前选中: `,n.length>0?n.join(`, `):`未选择`]})]}),(0,d.jsx)(s,{title:`在 XinForm 中使用`,bordered:!0,children:(0,d.jsx)(o,{formRef:g,columns:[{dataIndex:`taskName`,title:`任务名称`,valueType:`text`,rules:[{required:!0,message:`请输入任务名称`}],fieldProps:{placeholder:`请输入任务名称`}},{dataIndex:`owner_id`,title:`任务负责人`,rules:[{required:!0,message:`请选择负责人`}],fieldRender:()=>(0,d.jsx)(a,{placeholder:`请选择负责人`})},{dataIndex:`participant_ids`,title:`参与人员`,rules:[{required:!0,message:`请至少选择一个参与人员`},{validator:(e,t)=>t&&t.length>10?Promise.reject(`最多选择10个参与人员`):Promise.resolve()}],fieldRender:()=>(0,d.jsx)(a,{mode:`multiple`,maxTagCount:3,placeholder:`请选择参与人员`})},{dataIndex:`description`,title:`任务描述`,valueType:`textarea`,fieldProps:{placeholder:`请输入任务描述`}}],onFinish:async e=>(console.log(`表单提交:`,e),l.success(`提交成功!`),l.info(`负责人ID: ${e.owner_id}, 参与人IDs: ${e.participant_ids?.join(`, `)}`),!0),submitter:{submitText:`提交表单`,render:e=>e.submit}})})]})]})};export{h as default};
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./typography-DRFhazK9.js";import{t as i}from"./space-Cu4QVMgQ.js";import{r as a,t as o}from"./XinForm-BWtl160T.js";import{t as s}from"./card-DU2T2-YW.js";import{t as c}from"./divider-BWjoWWHX.js";import{r as l}from"./PictureOutlined-CB8Pr7jP.js";var u=e(t(),1),d=n(),{Title:f,Paragraph:p,Text:m}=r,h=()=>{let[e,t]=(0,u.useState)(null),[n,h]=(0,u.useState)([]),g=(0,u.useRef)(void 0);return(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,d.jsx)(f,{level:2,children:`用户选择器组件示例`}),(0,d.jsx)(p,{children:`基于 AntDesign 封装的用户选择器表单组件,支持单选和多选模式。`})]}),(0,d.jsxs)(i,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[(0,d.jsxs)(s,{title:`独立使用`,bordered:!0,children:[(0,d.jsx)(m,{children:`单选模式:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{value:e,onChange:e=>{t(e),l.success(`选中用户ID: ${e}`)},placeholder:`请选择用户`})}),(0,d.jsxs)(m,{type:`secondary`,className:`mt-2 block`,children:[`当前选中: `,e||`未选择`]}),(0,d.jsx)(c,{}),(0,d.jsx)(m,{children:`多选模式:`}),(0,d.jsx)(`div`,{className:`mt-2`,children:(0,d.jsx)(a,{mode:`multiple`,value:n,onChange:e=>{h(e),l.success(`选中${e.length}个用户`)},placeholder:`请选择多个用户`,maxTagCount:3})}),(0,d.jsxs)(m,{type:`secondary`,className:`mt-2 block`,children:[`当前选中: `,n.length>0?n.join(`, `):`未选择`]})]}),(0,d.jsx)(s,{title:`在 XinForm 中使用`,bordered:!0,children:(0,d.jsx)(o,{formRef:g,columns:[{dataIndex:`taskName`,title:`任务名称`,valueType:`text`,rules:[{required:!0,message:`请输入任务名称`}],fieldProps:{placeholder:`请输入任务名称`}},{dataIndex:`owner_id`,title:`任务负责人`,rules:[{required:!0,message:`请选择负责人`}],fieldRender:()=>(0,d.jsx)(a,{placeholder:`请选择负责人`})},{dataIndex:`participant_ids`,title:`参与人员`,rules:[{required:!0,message:`请至少选择一个参与人员`},{validator:(e,t)=>t&&t.length>10?Promise.reject(`最多选择10个参与人员`):Promise.resolve()}],fieldRender:()=>(0,d.jsx)(a,{mode:`multiple`,maxTagCount:3,placeholder:`请选择参与人员`})},{dataIndex:`description`,title:`任务描述`,valueType:`textarea`,fieldProps:{placeholder:`请输入任务描述`}}],onFinish:async e=>(console.log(`表单提交:`,e),l.success(`提交成功!`),l.info(`负责人ID: ${e.owner_id}, 参与人IDs: ${e.participant_ids?.join(`, `)}`),!0),submitter:{submitText:`提交表单`,render:e=>e.submit}})})]})]})};export{h as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{t as e}from"./jsx-runtime-CRBytmvs.js";import{t}from"./button-BILozH6U.js";import{t as n}from"./tag-DBV1bHre.js";import{n as r}from"./FileDoneOutlined-Bp46bcBB.js";import{t as i}from"./XinTable-NSSoHqA_.js";var a=e(),o=Array.from({length:50},(e,t)=>({id:t+1,name:`用户${t+1}`,email:`user${t+1}@example.com`,age:Math.floor(Math.random()*40)+20,status:+(Math.random()>.3),role:[`管理员`,`编辑`,`访客`][Math.floor(Math.random()*3)],department:[`技术部`,`产品部`,`运营部`,`市场部`][Math.floor(Math.random()*4)],createdAt:new Date(Date.now()-Math.random()*1e10).toLocaleDateString()})),s=()=>(0,a.jsx)(i,{columns:[{title:`序号`,width:60,valueType:`text`,dataIndex:`id`},{dataIndex:`name`,title:`用户名`,width:120,valueType:`text`,required:!0},{dataIndex:`email`,title:`邮箱`,valueType:`text`,width:200,ellipsis:!0},{dataIndex:`age`,title:`年龄`,width:80,valueType:`digit`,sorter:(e,t)=>e.age-t.age,hideInSearch:!0},{dataIndex:`status`,title:`状态`,width:100,valueType:`select`,render:e=>{let t={1:{text:`启用`,color:`green`},0:{text:`禁用`,color:`red`}}[e];return t?(0,a.jsx)(n,{color:t.color,children:t.text}):`-`},filters:[{text:`启用`,value:1},{text:`禁用`,value:0}]},{dataIndex:`role`,title:`角色`,width:100,valueType:`select`,fieldProps:{options:[{label:`管理员`,value:`管理员`},{label:`编辑`,value:`编辑`},{label:`访客`,value:`访客`}]}},{dataIndex:`department`,title:`部门`,width:120,valueType:`select`,fieldProps:{options:[{label:`技术部`,value:`技术部`},{label:`产品部`,value:`产品部`},{label:`运营部`,value:`运营部`},{label:`市场部`,value:`市场部`}]},hideInSearch:!0},{dataIndex:`createdAt`,title:`创建时间`,width:120,hideInForm:!0,hideInSearch:!0}],rowKey:`id`,dataSource:o,accessName:`system.user.list`,api:`/system-user/list`,toolBarRender:e=>[(0,a.jsx)(t,{icon:(0,a.jsx)(r,{}),children:`导出`},`export`),e.columnSetting,e.hideBorder,e.reload,e.columnHeight]});export{s as default};
import{t as e}from"./jsx-runtime-CRBytmvs.js";import{t}from"./button-BILozH6U.js";import{t as n}from"./tag-DBV1bHre.js";import{n as r}from"./FileDoneOutlined-Bp46bcBB.js";import{t as i}from"./XinTable-BHebVDbz.js";var a=e(),o=Array.from({length:50},(e,t)=>({id:t+1,name:`用户${t+1}`,email:`user${t+1}@example.com`,age:Math.floor(Math.random()*40)+20,status:+(Math.random()>.3),role:[`管理员`,`编辑`,`访客`][Math.floor(Math.random()*3)],department:[`技术部`,`产品部`,`运营部`,`市场部`][Math.floor(Math.random()*4)],createdAt:new Date(Date.now()-Math.random()*1e10).toLocaleDateString()})),s=()=>(0,a.jsx)(i,{columns:[{title:`序号`,width:60,valueType:`text`,dataIndex:`id`},{dataIndex:`name`,title:`用户名`,width:120,valueType:`text`,required:!0},{dataIndex:`email`,title:`邮箱`,valueType:`text`,width:200,ellipsis:!0},{dataIndex:`age`,title:`年龄`,width:80,valueType:`digit`,sorter:(e,t)=>e.age-t.age,hideInSearch:!0},{dataIndex:`status`,title:`状态`,width:100,valueType:`select`,render:e=>{let t={1:{text:`启用`,color:`green`},0:{text:`禁用`,color:`red`}}[e];return t?(0,a.jsx)(n,{color:t.color,children:t.text}):`-`},filters:[{text:`启用`,value:1},{text:`禁用`,value:0}]},{dataIndex:`role`,title:`角色`,width:100,valueType:`select`,fieldProps:{options:[{label:`管理员`,value:`管理员`},{label:`编辑`,value:`编辑`},{label:`访客`,value:`访客`}]}},{dataIndex:`department`,title:`部门`,width:120,valueType:`select`,fieldProps:{options:[{label:`技术部`,value:`技术部`},{label:`产品部`,value:`产品部`},{label:`运营部`,value:`运营部`},{label:`市场部`,value:`市场部`}]},hideInSearch:!0},{dataIndex:`createdAt`,title:`创建时间`,width:120,hideInForm:!0,hideInSearch:!0}],rowKey:`id`,dataSource:o,accessName:`system.user.list`,api:`/system-user/list`,toolBarRender:e=>[(0,a.jsx)(t,{icon:(0,a.jsx)(r,{}),children:`导出`},`export`),e.columnSetting,e.hideBorder,e.reload,e.columnHeight]});export{s as default};
+6 -5
View File
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/favicons.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XinAdmin</title>
<script type="module" crossorigin src="/assets/index-CKg_ws49.js"></script>
<script type="module" crossorigin src="/assets/index-CssQGeku.js"></script>
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-BgaNhQyE.js">
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CRBytmvs.js">
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-Zm15rq6F.js">
@@ -56,7 +56,7 @@
<link rel="modulepreload" crossorigin href="/assets/DeleteOutlined-DwOvobSM.js">
<link rel="modulepreload" crossorigin href="/assets/DownloadOutlined-DJY9Mu8c.js">
<link rel="modulepreload" crossorigin href="/assets/WeiboOutlined-Bp26feUj.js">
<link rel="modulepreload" crossorigin href="/assets/SmileOutlined-BWvCFgTD.js">
<link rel="modulepreload" crossorigin href="/assets/SmileOutlined-CxtYvF4K.js">
<link rel="modulepreload" crossorigin href="/assets/ArrowDownOutlined-hMgHFKfN.js">
<link rel="modulepreload" crossorigin href="/assets/ArrowUpOutlined-C-Hx3V4D.js">
<link rel="modulepreload" crossorigin href="/assets/ClearOutlined-D3ecEqjC.js">
@@ -66,14 +66,15 @@
<link rel="modulepreload" crossorigin href="/assets/EnvironmentOutlined-Be7mN2bK.js">
<link rel="modulepreload" crossorigin href="/assets/InfoCircleOutlined-ZdiYvwVM.js">
<link rel="modulepreload" crossorigin href="/assets/UploadOutlined-NadwXvrl.js">
<link rel="modulepreload" crossorigin href="/assets/LikeOutlined-DNN-Kbd9.js">
<link rel="modulepreload" crossorigin href="/assets/PrinterOutlined-V8ipM95d.js">
<link rel="modulepreload" crossorigin href="/assets/QqOutlined-DnUKpfIS.js">
<link rel="modulepreload" crossorigin href="/assets/RiseOutlined-gXjyF9G9.js">
<link rel="modulepreload" crossorigin href="/assets/ShopOutlined-CwwKSpcq.js">
<link rel="modulepreload" crossorigin href="/assets/WalletOutlined-Bjy-chtO.js">
<link rel="modulepreload" crossorigin href="/assets/ShoppingOutlined-CsazpDg7.js">
<link rel="modulepreload" crossorigin href="/assets/TeamOutlined-DAHp-vuL.js">
<link rel="modulepreload" crossorigin href="/assets/UserOutlined-D5Ziy0eL.js">
<link rel="modulepreload" crossorigin href="/assets/lodash-VautP0iT.js">
<link rel="modulepreload" crossorigin href="/assets/lodash-DNhu68T6.js">
<link rel="modulepreload" crossorigin href="/assets/app-Bntg8WFU.js">
<link rel="modulepreload" crossorigin href="/assets/avatar-DPxbCsa4.js">
<link rel="modulepreload" crossorigin href="/assets/breadcrumb-CSvdSHzR.js">
@@ -91,7 +92,7 @@
<link rel="modulepreload" crossorigin href="/assets/useMobile-Bcq0nkW4.js">
<link rel="modulepreload" crossorigin href="/assets/dict-CDRllPHM.js">
<link rel="modulepreload" crossorigin href="/assets/relativeTime-jamE_cdZ.js">
<link rel="stylesheet" crossorigin href="/assets/index-CnQ7W3uo.css">
<link rel="stylesheet" crossorigin href="/assets/index-DfLYhBZ1.css">
</head>
<body>
<div id="root"></div>
+325
View File
@@ -0,0 +1,325 @@
<?php
namespace Tests\Feature;
use App\Models\BillModel;
use App\Models\PaymentModel;
use App\Models\ProductCategoryModel;
use App\Models\ProductModel;
use App\Models\PurchaseOrderModel;
use App\Models\StoreModel;
use App\Models\StoreOrderItemModel;
use App\Models\StoreOrderModel;
use App\Models\SupplierModel;
use App\Models\UserModel;
/**
* 仪表盘分析页聚合接口:权限校验、指标口径(排除已取消)、趋势补日、排行与对账概览
*/
class DashboardTest extends ProcurementTestCase
{
private const string ROUTE = '/dashboard/analysis';
/** 造一张门店订单(默认已完成) */
private function makeOrder(StoreModel $store, string $amount, array $attributes = []): StoreOrderModel
{
return StoreOrderModel::factory()->create(array_merge([
'store_id' => $store->id,
'order_date' => now()->toDateString(),
'total_amount' => $amount,
'total_quantity' => 1,
'status' => StoreOrderModel::STATUS_COMPLETED,
], $attributes));
}
/** 造一条订单明细(显式指定数量与金额,避免工厂随机值干扰断言) */
private function makeItem(StoreOrderModel $order, array $attributes = []): StoreOrderItemModel
{
return StoreOrderItemModel::factory()->create(array_merge([
'order_id' => $order->id,
'store_id' => $order->store_id,
'product_id' => 1,
'product_name' => '测试商品',
'product_spec' => '500g/袋',
'unit' => '斤',
'price' => '10.00',
'quantity' => 1,
'amount' => '10.00',
], $attributes));
}
/** 造一张账单 */
private function makeBill(StoreModel $store, string $totalAmount, array $attributes = []): BillModel
{
return BillModel::create(array_merge([
'bill_no' => 'ZD' . random_int(100000000000, 999999999999),
// (purchase_id, store_id) 唯一约束:每张账单挂独立采购单
'purchase_id' => PurchaseOrderModel::factory()->create()->id,
'store_id' => $store->id,
'bill_date' => now()->toDateString(),
'product_amount' => $totalAmount,
'delivery_fee' => '0.00',
'box_num' => 0,
'tray_num' => 0,
'box_price' => '0.00',
'tray_price' => '0.00',
'added_amount' => '0.00',
'total_amount' => $totalAmount,
'status' => BillModel::STATUS_UNPAID,
], $attributes));
}
/** 未登录不可访问 */
public function test_guest_cannot_access_dashboard(): void
{
$this->getJson(self::ROUTE)->assertStatus(401);
}
/** 缺少 dashboard.analysis 权限点时拒绝访问 */
public function test_requires_dashboard_analysis_ability(): void
{
// SysUserModel 的 id 不可批量赋值:首个创建的用户自增为 id=1,
// SysAccessToken::can() 对 tokenable_id==1(超管)直接放行,故先建占位用户
$this->actingAsSysUser();
$this->actingAsSysUser(['system.user.query']);
// 应用约定:权限不足由 ExceptionsHandler 渲染为 HTTP 200 + success=false 警告通知
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('success', false)
->assertJsonPath('msg', 'No Permission');
}
/** 空库返回完整结构:指标为0、趋势补满30天、状态分布固定6项 */
public function test_empty_database_returns_zero_structure(): void
{
$this->actingAsSysUser(['dashboard.analysis']);
$response = $this->getJson(self::ROUTE)->assertOk()->assertJsonPath('success', true);
$response->assertJsonPath('data.overview.sales.total', 0)
->assertJsonPath('data.overview.orders.total', 0)
->assertJsonPath('data.overview.purchase.total', 0)
->assertJsonPath('data.overview.sales.growth', null)
->assertJsonPath('data.overview.receivable.bill_total', 0)
->assertJsonPath('data.archives.stores', 0);
$this->assertCount(30, $response->json('data.trend'), '趋势固定输出近30天');
$this->assertCount(6, $response->json('data.order_status'), '订单状态固定6项');
$this->assertCount(3, $response->json('data.recon.bills'), '账单支付进度固定3档');
$this->assertSame([], $response->json('data.category_sales'));
$this->assertSame([], $response->json('data.top_products'));
$this->assertSame([], $response->json('data.latest_orders'));
}
/** 销售额与订单数排除已取消订单 */
public function test_overview_excludes_cancelled_orders(): void
{
$store = StoreModel::factory()->create();
$this->makeOrder($store, '100.00');
$this->makeOrder($store, '50.00');
$this->makeOrder($store, '999.00', ['status' => StoreOrderModel::STATUS_CANCELLED]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.overview.sales.total', 150)
->assertJsonPath('data.overview.sales.today', 150)
->assertJsonPath('data.overview.orders.total', 2)
->assertJsonPath('data.overview.orders.today', 2);
}
/** 环比:近7天相对前7天的增长率;上期为0时为 null */
public function test_week_growth_rate(): void
{
$store = StoreModel::factory()->create();
// 近7天 100,前7天 50 → (100-50)/50 = 100%
$this->makeOrder($store, '100.00');
$this->makeOrder($store, '50.00', ['order_date' => now()->subDays(8)->toDateString()]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.overview.sales.growth', 100)
->assertJsonPath('data.overview.orders.growth', 0);
// 仅剩本期数据、上期为0 → growth 为 null
StoreOrderModel::query()->where('order_date', now()->subDays(8)->toDateString())->delete();
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.overview.sales.growth', null);
}
/** 趋势补日:30天全量输出,当日与历史日数据正确落位 */
public function test_trend_covers_30_days_with_zero_filling(): void
{
$store = StoreModel::factory()->create();
$this->makeOrder($store, '12.50', ['order_date' => now()->subDays(3)->toDateString()]);
$this->makeOrder($store, '20.00');
$this->makeOrder($store, '30.00');
$this->actingAsSysUser(['dashboard.analysis']);
$response = $this->getJson(self::ROUTE)->assertOk();
$trend = $response->json('data.trend');
$this->assertCount(30, $trend);
$this->assertSame(now()->toDateString(), $trend[29]['date'], '最后一天为今日');
$this->assertSame(50, $trend[29]['amount']);
$this->assertSame(2, $trend[29]['orders']);
$this->assertSame(12.5, $trend[26]['amount'], '3天前数据落位正确');
$this->assertSame(0, $trend[0]['amount'], '无数据日期补0');
$this->assertSame(0, $trend[0]['orders']);
}
/** 品类占比:按明细金额汇总、按分类名归类、排除已取消订单、金额降序 */
public function test_category_sales_grouped_by_category(): void
{
$vegetable = ProductCategoryModel::create(['parent_id' => 0, 'name' => '蔬菜', 'sort' => 0, 'status' => 1]);
$fruit = ProductCategoryModel::create(['parent_id' => 0, 'name' => '水果', 'sort' => 1, 'status' => 1]);
$store = StoreModel::factory()->create();
$order = $this->makeOrder($store, '60.00');
$this->makeItem($order, ['category_id' => $vegetable->id, 'amount' => '30.00']);
$this->makeItem($order, ['category_id' => $vegetable->id, 'amount' => '10.00']);
$this->makeItem($order, ['category_id' => $fruit->id, 'amount' => '20.00']);
// 已取消订单的明细不计入
$cancelled = $this->makeOrder($store, '999.00', ['status' => StoreOrderModel::STATUS_CANCELLED]);
$this->makeItem($cancelled, ['category_id' => $fruit->id, 'amount' => '999.00']);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.category_sales.0.name', '蔬菜')
->assertJsonPath('data.category_sales.0.amount', 40)
->assertJsonPath('data.category_sales.1.name', '水果')
->assertJsonPath('data.category_sales.1.amount', 20);
}
/** 热销商品:跨订单汇总数量与金额,按金额降序 */
public function test_top_products_aggregated_across_orders(): void
{
$store = StoreModel::factory()->create();
$orderA = $this->makeOrder($store, '50.00');
$orderB = $this->makeOrder($store, '80.00');
// 商品A:两单合计 数量5 金额50
$this->makeItem($orderA, ['product_id' => 11, 'product_name' => '大白菜', 'quantity' => 2, 'amount' => '20.00']);
$this->makeItem($orderB, ['product_id' => 11, 'product_name' => '大白菜', 'quantity' => 3, 'amount' => '30.00']);
// 商品B:数量1 金额60 → 金额更高排第一
$this->makeItem($orderB, ['product_id' => 12, 'product_name' => '车厘子', 'quantity' => 1, 'amount' => '60.00']);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.top_products.0.product_name', '车厘子')
->assertJsonPath('data.top_products.0.amount', 60)
->assertJsonPath('data.top_products.1.product_name', '大白菜')
->assertJsonPath('data.top_products.1.quantity', 5)
->assertJsonPath('data.top_products.1.amount', 50);
}
/** 门店排行:按订单金额降序,附带门店名与订单数 */
public function test_top_stores_ranked_by_amount(): void
{
$storeA = StoreModel::factory()->create(['name' => '一号店']);
$storeB = StoreModel::factory()->create(['name' => '二号店']);
$this->makeOrder($storeA, '100.00');
$this->makeOrder($storeA, '100.00');
$this->makeOrder($storeB, '300.00');
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.top_stores.0.store_name', '二号店')
->assertJsonPath('data.top_stores.0.amount', 300)
->assertJsonPath('data.top_stores.0.order_count', 1)
->assertJsonPath('data.top_stores.1.store_name', '一号店')
->assertJsonPath('data.top_stores.1.amount', 200)
->assertJsonPath('data.top_stores.1.order_count', 2);
}
/** 采购金额:实际价优先,无实际价退回预估价 */
public function test_purchase_amount_prefers_actual_over_estimate(): void
{
PurchaseOrderModel::factory()->create(['estimate_amount' => '100.00', 'actual_amount' => '80.00']);
PurchaseOrderModel::factory()->create(['estimate_amount' => '50.00', 'actual_amount' => 0]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.overview.purchase.total', 130, '80 实际价 + 50 预估价')
->assertJsonPath('data.overview.purchase.today', 130);
}
/** 对账概览:账单按支付进度分档统计,应收余额扣除已支付;待审核回款单独计 */
public function test_recon_summary_and_receivable(): void
{
$store = StoreModel::factory()->create();
$this->makeBill($store, '100.00'); // 待支付
$this->makeBill($store, '200.00', ['payment_id' => 5]); // 审核中
$this->makeBill($store, '300.00', ['status' => BillModel::STATUS_PAID]); // 已支付
PaymentModel::create([
'payment_no' => 'ZF' . random_int(100000000000, 999999999999),
'store_id' => $store->id,
'user_id' => 0,
'amount' => '88.00',
'pay_method' => PaymentModel::METHOD_WECHAT,
'status' => PaymentModel::STATUS_PENDING,
]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.recon.bills.0.count', 1)
->assertJsonPath('data.recon.bills.0.amount', 100)
->assertJsonPath('data.recon.bills.1.count', 1)
->assertJsonPath('data.recon.bills.1.amount', 200)
->assertJsonPath('data.recon.bills.2.count', 1)
->assertJsonPath('data.recon.bills.2.amount', 300)
->assertJsonPath('data.recon.pending_payment.count', 1)
->assertJsonPath('data.recon.pending_payment.amount', 88)
->assertJsonPath('data.overview.receivable.bill_total', 600)
->assertJsonPath('data.overview.receivable.received', 300)
->assertJsonPath('data.overview.receivable.unreceived', 300);
}
/** 最新订单:按日期倒序、最多8条、附带状态名与门店名 */
public function test_latest_orders_limited_and_ordered(): void
{
$store = StoreModel::factory()->create(['name' => '旗舰店']);
for ($i = 0; $i < 9; $i++) {
$this->makeOrder($store, '10.00', ['order_date' => now()->subDays($i)->toDateString()]);
}
$this->actingAsSysUser(['dashboard.analysis']);
$response = $this->getJson(self::ROUTE)->assertOk();
$latest = $response->json('data.latest_orders');
$this->assertCount(8, $latest, '最多返回8条');
$this->assertSame(now()->toDateString(), $latest[0]['order_date'], '最新订单在前');
$this->assertSame('旗舰店', $latest[0]['store_name']);
$this->assertSame('已完成', $latest[0]['status_name']);
}
/** 基础档案仅统计启用中的门店/商品/供应商/用户 */
public function test_archives_count_active_records_only(): void
{
StoreModel::factory()->count(2)->create(['status' => StoreModel::STATUS_NORMAL]);
StoreModel::factory()->create(['status' => StoreModel::STATUS_DISABLED]);
ProductModel::factory()->count(3)->create(['status' => ProductModel::STATUS_ON]);
ProductModel::factory()->create(['status' => ProductModel::STATUS_OFF]);
SupplierModel::factory()->create(['status' => SupplierModel::STATUS_NORMAL]);
SupplierModel::factory()->create(['status' => SupplierModel::STATUS_DISABLED]);
UserModel::factory()->count(2)->create(['status' => UserModel::STATUS_NORMAL]);
UserModel::factory()->create(['status' => UserModel::STATUS_DISABLED]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.archives.stores', 2)
->assertJsonPath('data.archives.products', 3)
->assertJsonPath('data.archives.suppliers', 1)
->assertJsonPath('data.archives.users', 2);
}
}
+10
View File
@@ -0,0 +1,10 @@
import createAxios from "@/utils/request";
import type IDashboardAnalysis from "@/domain/iDashboard";
/** 仪表盘分析页 - 聚合统计数据 */
export const getDashboardAnalysis = () => {
return createAxios<IDashboardAnalysis>({
url: "/dashboard/analysis",
method: "get",
});
};
+114
View File
@@ -0,0 +1,114 @@
/** 仪表盘 - 核心指标(销售额/订单数/采购金额) */
export interface IDashboardMetric {
/** 累计总量 */
total: number;
/** 今日值 */
today: number;
/** 近7天值 */
week: number;
/** 近7天环比增长率(%);上期为0时无基准,为 null */
growth: number | null;
/** 近7天每日值(迷你趋势图,旧到新) */
trend7: number[];
}
/** 仪表盘 - 应收余额 */
export interface IDashboardReceivable {
/** 账单总额 */
bill_total: number;
/** 已回款金额(已支付账单) */
received: number;
/** 应收余额(账单总额 - 已回款) */
unreceived: number;
}
/** 仪表盘 - 销售趋势点(近30天) */
export interface IDashboardTrendPoint {
date: string;
amount: number;
orders: number;
}
/** 仪表盘 - 订单状态分布 */
export interface IDashboardStatusCount {
status: number;
name: string;
count: number;
}
/** 仪表盘 - 品类销售占比 */
export interface IDashboardCategorySales {
name: string;
amount: number;
}
/** 仪表盘 - 热销商品 */
export interface IDashboardTopProduct {
product_id: number;
product_name: string;
product_spec: string;
unit: string;
quantity: number;
amount: number;
}
/** 仪表盘 - 门店排行 */
export interface IDashboardTopStore {
store_id: number;
store_name: string;
order_count: number;
amount: number;
}
/** 仪表盘 - 账单支付进度统计 */
export interface IDashboardReconStat {
/** 0待支付 1审核中 2已支付 */
pay_state: number;
name: string;
count: number;
amount: number;
}
/** 仪表盘 - 最新订单 */
export interface IDashboardLatestOrder {
id: number;
order_no: string;
store_name: string;
order_date: string;
total_amount: number;
status: number;
status_name: string;
}
/** 仪表盘 - 基础档案计数 */
export interface IDashboardArchives {
/** 在营门店 */
stores: number;
/** 在售商品 */
products: number;
/** 合作供应商 */
suppliers: number;
/** 小程序用户 */
users: number;
}
/** 仪表盘分析页聚合数据(GET /dashboard/analysis */
export default interface IDashboardAnalysis {
overview: {
sales: IDashboardMetric;
orders: IDashboardMetric;
purchase: IDashboardMetric;
receivable: IDashboardReceivable;
};
trend: IDashboardTrendPoint[];
order_status: IDashboardStatusCount[];
category_sales: IDashboardCategorySales[];
top_products: IDashboardTopProduct[];
top_stores: IDashboardTopStore[];
recon: {
bills: IDashboardReconStat[];
pending_payment: { count: number; amount: number };
};
latest_orders: IDashboardLatestOrder[];
archives: IDashboardArchives;
}
+53 -44
View File
@@ -1,48 +1,57 @@
export default {
// Common
"dashboard.since.lastWeek": "Since last week",
"dashboard.vs.lastWeek": "vs last week",
// Key metric cards
"dashboard.analysis.salesAmount": "Sales",
"dashboard.analysis.orderCount": "Orders",
"dashboard.analysis.purchaseAmount": "Purchases",
"dashboard.analysis.receivable": "Receivable",
"dashboard.analysis.today": "Today",
"dashboard.analysis.thisWeek": "Last 7 days",
"dashboard.analysis.vsLastWeek": "vs last week",
"dashboard.analysis.totalBillAmount": "Total billed",
"dashboard.analysis.receivedAmount": "Received",
// Analysis Page
"dashboard.analysis.totalRevenue": "Total Revenue",
"dashboard.analysis.totalExpenses": "Total Expenses",
"dashboard.analysis.visitors": "Visitors",
"dashboard.analysis.likes": "Likes",
"dashboard.analysis.annualSales": "Annual Sales",
"dashboard.analysis.grossProfit": "Gross Profit",
"dashboard.analysis.netProfit": "Net Profit",
"dashboard.analysis.totalExpense": "Total Expense",
"dashboard.analysis.accessFrom": "Access From",
"dashboard.analysis.searchEngine": "Search Engine",
"dashboard.analysis.direct": "Direct",
"dashboard.analysis.email": "Email",
"dashboard.analysis.unionAds": "Union Ads",
"dashboard.analysis.videoAds": "Video Ads",
"dashboard.analysis.salesRanking": "Sales Ranking",
"dashboard.analysis.month": "Month",
"dashboard.analysis.year": "Year",
"dashboard.analysis.day": "Day",
"dashboard.analysis.article": "Article",
"dashboard.analysis.age": "Age",
"dashboard.analysis.address": "Address",
"dashboard.analysis.tags": "Tags",
"dashboard.analysis.action": "Action",
"dashboard.analysis.invite": "Invite",
"dashboard.analysis.delete": "Delete",
"dashboard.analysis.userReviews": "User Reviews",
"dashboard.analysis.reviewDescription": "Ant Design, a design language for background applications, is refined by Ant UED Team",
// Sales trend
"dashboard.analysis.salesTrend": "Sales Trend (Last 30 Days)",
"dashboard.analysis.amountAxis": "Amount",
"dashboard.analysis.ordersAxis": "Orders",
"dashboard.analysis.emptyTrend": "No orders in the last 30 days",
// Months
"dashboard.analysis.january": "January",
"dashboard.analysis.february": "February",
"dashboard.analysis.march": "March",
"dashboard.analysis.april": "April",
"dashboard.analysis.may": "May",
"dashboard.analysis.june": "June",
"dashboard.analysis.july": "July",
"dashboard.analysis.august": "August",
"dashboard.analysis.september": "September",
"dashboard.analysis.october": "October",
"dashboard.analysis.november": "November",
"dashboard.analysis.december": "December",
// Order status
"dashboard.analysis.orderStatusDistribution": "Order Status",
"dashboard.analysis.orderUnit": "",
// Category share
"dashboard.analysis.categorySales": "Sales by Category",
"dashboard.analysis.emptyCategory": "No sales data",
// Top products
"dashboard.analysis.topProducts": "Top 10 Products",
"dashboard.analysis.rank": "Rank",
"dashboard.analysis.productName": "Product",
"dashboard.analysis.quantity": "Qty",
"dashboard.analysis.amount": "Amount",
// Store ranking
"dashboard.analysis.topStores": "Top 10 Stores",
"dashboard.analysis.storeName": "Store",
// Reconciliation & payment
"dashboard.analysis.reconOverview": "Reconciliation & Payment",
"dashboard.analysis.billProgress": "Bill Payment Progress",
"dashboard.analysis.pendingPaymentReview": "Payments to Review",
"dashboard.analysis.pendingPaymentTip": "Payment vouchers submitted by stores, pending review",
"dashboard.analysis.billUnit": "",
// Latest orders
"dashboard.analysis.latestOrders": "Latest Orders",
"dashboard.analysis.orderNo": "Order No.",
"dashboard.analysis.store": "Store",
"dashboard.analysis.orderDate": "Date",
"dashboard.analysis.status": "Status",
// Archives
"dashboard.analysis.archivesStores": "Active Stores",
"dashboard.analysis.archivesProducts": "On-sale Products",
"dashboard.analysis.archivesSuppliers": "Suppliers",
"dashboard.analysis.archivesUsers": "Mini-app Users",
};
+53 -44
View File
@@ -1,48 +1,57 @@
export default {
// 通用
"dashboard.since.lastWeek": "自上周以来",
"dashboard.vs.lastWeek": "较上周",
// 核心指标卡
"dashboard.analysis.salesAmount": "销售额",
"dashboard.analysis.orderCount": "订单数",
"dashboard.analysis.purchaseAmount": "采购金额",
"dashboard.analysis.receivable": "应收余额",
"dashboard.analysis.today": "今日",
"dashboard.analysis.thisWeek": "近7天",
"dashboard.analysis.vsLastWeek": "较上周",
"dashboard.analysis.totalBillAmount": "账单总额",
"dashboard.analysis.receivedAmount": "已回款",
// Analysis 分析页面
"dashboard.analysis.totalRevenue": "总收入",
"dashboard.analysis.totalExpenses": "总支出",
"dashboard.analysis.visitors": "访客量",
"dashboard.analysis.likes": "点赞量",
"dashboard.analysis.annualSales": "年度销售额",
"dashboard.analysis.grossProfit": "毛利润",
"dashboard.analysis.netProfit": "净利润",
"dashboard.analysis.totalExpense": "总支出",
"dashboard.analysis.accessFrom": "Access From",
"dashboard.analysis.searchEngine": "Search Engine",
"dashboard.analysis.direct": "Direct",
"dashboard.analysis.email": "Email",
"dashboard.analysis.unionAds": "Union Ads",
"dashboard.analysis.videoAds": "Video Ads",
"dashboard.analysis.salesRanking": "销售排名",
"dashboard.analysis.month": "月份",
"dashboard.analysis.year": "年份",
"dashboard.analysis.day": "天",
"dashboard.analysis.article": "Article",
"dashboard.analysis.age": "Age",
"dashboard.analysis.address": "Address",
"dashboard.analysis.tags": "Tags",
"dashboard.analysis.action": "Action",
"dashboard.analysis.invite": "Invite",
"dashboard.analysis.delete": "Delete",
"dashboard.analysis.userReviews": "用户评价",
"dashboard.analysis.reviewDescription": "Ant Design, a design language for background applications, is refined by Ant UED Team",
// 销售趋势
"dashboard.analysis.salesTrend": "销售趋势(近30天)",
"dashboard.analysis.amountAxis": "金额",
"dashboard.analysis.ordersAxis": "订单数",
"dashboard.analysis.emptyTrend": "近30天暂无订单数据",
// 月份
"dashboard.analysis.january": "January",
"dashboard.analysis.february": "February",
"dashboard.analysis.march": "March",
"dashboard.analysis.april": "April",
"dashboard.analysis.may": "May",
"dashboard.analysis.june": "June",
"dashboard.analysis.july": "July",
"dashboard.analysis.august": "August",
"dashboard.analysis.september": "September",
"dashboard.analysis.october": "October",
"dashboard.analysis.november": "November",
"dashboard.analysis.december": "December",
// 订单状态
"dashboard.analysis.orderStatusDistribution": "订单状态分布",
"dashboard.analysis.orderUnit": "单",
// 品类占比
"dashboard.analysis.categorySales": "品类销售占比",
"dashboard.analysis.emptyCategory": "暂无销售数据",
// 热销商品
"dashboard.analysis.topProducts": "热销商品 TOP10",
"dashboard.analysis.rank": "排名",
"dashboard.analysis.productName": "商品名称",
"dashboard.analysis.quantity": "销量",
"dashboard.analysis.amount": "金额",
// 门店排行
"dashboard.analysis.topStores": "门店排行 TOP10",
"dashboard.analysis.storeName": "门店名称",
// 对账与回款
"dashboard.analysis.reconOverview": "对账与回款",
"dashboard.analysis.billProgress": "账单支付进度",
"dashboard.analysis.pendingPaymentReview": "待审核回款",
"dashboard.analysis.pendingPaymentTip": "门店已提交支付凭证,等待审核",
"dashboard.analysis.billUnit": "张",
// 最新订单
"dashboard.analysis.latestOrders": "最新订单",
"dashboard.analysis.orderNo": "订单号",
"dashboard.analysis.store": "门店",
"dashboard.analysis.orderDate": "下单日期",
"dashboard.analysis.status": "状态",
// 基础档案
"dashboard.analysis.archivesStores": "在营门店",
"dashboard.analysis.archivesProducts": "在售商品",
"dashboard.analysis.archivesSuppliers": "合作供应商",
"dashboard.analysis.archivesUsers": "小程序用户",
};
File diff suppressed because it is too large Load Diff