账单导出

This commit is contained in:
2026-10-30 11:17:15 +08:00
parent 7366d88baf
commit f91939f1f0
137 changed files with 1227 additions and 74 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\WithMultipleSheets; use Maatwebsite\Excel\Concerns\WithMultipleSheets;
/** /**
* 门店账单批量导出:同一门店的账单合并在一张工作表,不同门店拆分为多个工作表 * 门店账单批量导出:同一门店的账单数据合并为一张表,不同门店拆分为多个工作表
*/ */
class BillBatchExport implements WithMultipleSheets class BillBatchExport implements WithMultipleSheets
{ {
+86 -49
View File
@@ -18,8 +18,8 @@ use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
/** /**
* 门店账单导出:单账单可直接下载;多账单在同一工作表依次展示(批量导出按门店分组), * 门店账单导出:单账单可直接下载;多账单按商品合并为一张汇总表(批量导出按门店分组),
* 账单内明细按商品合并(可按一级分类过滤),表尾汇总商品金额/配送费/附加金额/售后金额/总金额 * 明细可按一级分类过滤,表尾汇总商品金额/配送费/附加金额/售后金额/总金额
*/ */
class BillExport implements FromCollection, WithStyles, WithTitle class BillExport implements FromCollection, WithStyles, WithTitle
{ {
@@ -46,12 +46,6 @@ class BillExport implements FromCollection, WithStyles, WithTitle
/** 列头所在行索引 */ /** 列头所在行索引 */
private int $headerRow = 1; private int $headerRow = 1;
/** @var array<int, int> 各账单列头所在行索引 */
private array $headerRows = [];
/** @var array<int, array{header: int, last: int}> 各账单表格区域 */
private array $tableRanges = [];
/** 数据末行索引 */ /** 数据末行索引 */
private int $lastRow = 1; private int $lastRow = 1;
@@ -77,7 +71,7 @@ class BillExport implements FromCollection, WithStyles, WithTitle
} }
/** /**
* 导出行:每张账单保留独立的标题/范围/列头/明细/合计,多账单之间空一行 * 导出行:所选门店账单合并为一张表格,同商品及账单级费用分别汇总
*/ */
public function collection(): Collection public function collection(): Collection
{ {
@@ -87,25 +81,20 @@ class BillExport implements FromCollection, WithStyles, WithTitle
$rows = []; $rows = [];
$rowIndex = 0; $rowIndex = 0;
foreach ($this->bills as $index => $bill) { $this->appendBillRows($this->bills, $rows, $rowIndex);
if ($index > 0) {
$rows[] = [''];
$rowIndex++;
}
$this->appendBillRows($bill, $rows, $rowIndex);
}
return $this->rows = collect($rows); return $this->rows = collect($rows);
} }
/** /**
* 追加一张账单的完整表格 * 追加所选账单的合并表格
* *
* @param Collection<int, BillModel> $bills
* @param array<int, array<int, mixed>> $rows * @param array<int, array<int, mixed>> $rows
*/ */
private function appendBillRows(BillModel $bill, array &$rows, int &$rowIndex): void private function appendBillRows(Collection $bills, array &$rows, int &$rowIndex): void
{ {
$items = app(BillDetailService::class)->mergedItems($bill); $items = $this->mergedItems($bills);
// 商品 => 一级分类解析(明细行「一级分类」列与分类过滤共用同一份结果) // 商品 => 一级分类解析(明细行「一级分类」列与分类过滤共用同一份结果)
[$categories, $rootIds] = $this->resolveRootCategories($items); [$categories, $rootIds] = $this->resolveRootCategories($items);
@@ -115,15 +104,29 @@ class BillExport implements FromCollection, WithStyles, WithTitle
[$items, $categoryName] = $this->filterByRootCategory($items, $categories, $rootIds); [$items, $categoryName] = $this->filterByRootCategory($items, $categories, $rootIds);
} }
$bill = $bills->first();
$isMerged = $bills->count() > 1;
// 标题行 // 标题行
$rows[] = ['门店账单 ' . $bill->bill_no]; $rows[] = [$isMerged ? '门店账单 合并导出(' . $bills->count() . '张)' : '门店账单 ' . $bill->bill_no];
$this->specialRows[++$rowIndex] = 'title'; $this->specialRows[++$rowIndex] = 'title';
// 范围行:门店 / 账单日期 / 分类 / 导出时间 // 范围行:门店 / 账单日期(合并时取起止日期)/ 分类 / 导出时间
$billDate = $bill->bill_date?->toDateString();
if ($isMerged) {
$dates = $bills->map(static fn (BillModel $item): ?string => $item->bill_date?->toDateString())
->filter()
->sort()
->values();
$billDate = $dates->first() === $dates->last()
? $dates->first()
: $dates->first() . ' 至 ' . $dates->last();
}
$storeName = $bill->store->name ?? ('门店#' . $bill->store_id); $storeName = $bill->store->name ?? ('门店#' . $bill->store_id);
$rows[] = [ $rows[] = [
'门店:' . $storeName '门店:' . $storeName
. ' 账单日期:' . $bill->bill_date?->toDateString() . ' 账单日期:' . $billDate
. ($isMerged ? ' 账单数量:' . $bills->count() : '')
. ' 分类:' . $categoryName . ' 分类:' . $categoryName
. ' 导出时间:' . now('Asia/Shanghai')->format('Y-m-d H:i:s'), . ' 导出时间:' . now('Asia/Shanghai')->format('Y-m-d H:i:s'),
]; ];
@@ -136,13 +139,9 @@ class BillExport implements FromCollection, WithStyles, WithTitle
// 列头(包规=包规+单位合并;单价=每件零售价+单价单位;一级分类=商品根分类名) // 列头(包规=包规+单位合并;单价=每件零售价+单价单位;一级分类=商品根分类名)
$rows[] = ['序号', '品名', '一级分类', '包规', '单价', '数量', '重量(斤)', '金额']; $rows[] = ['序号', '品名', '一级分类', '包规', '单价', '数量', '重量(斤)', '金额'];
$this->specialRows[++$rowIndex] = 'header'; $this->specialRows[++$rowIndex] = 'header';
$currentHeaderRow = $rowIndex; $this->headerRow = $rowIndex;
$this->headerRows[] = $currentHeaderRow;
if (count($this->headerRows) === 1) {
$this->headerRow = $rowIndex;
}
// 明细行(账单内同商品已合并,单价为每件价折算的零售价) // 明细行(所选账单的同商品已合并,单价为合并后的每件价折算零售价)
$totalQuantity = 0; $totalQuantity = 0;
$totalWeight = '0'; $totalWeight = '0';
$totalAmount = '0'; $totalAmount = '0';
@@ -171,10 +170,19 @@ class BillExport implements FromCollection, WithStyles, WithTitle
$this->fillCells[] = ['row' => $rowIndex, 'column' => 'F', 'value' => (float) $totalQuantity]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'F', 'value' => (float) $totalQuantity];
$this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $totalAmount]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $totalAmount];
// 配送费/附加金额/售后金额/总金额(账单级费用全额计入,不受分类过滤影响) // 配送费/附加金额/售后金额按所选账单分别累加,不受分类过滤影响
$deliveryTotal = (string) $bill->delivery_fee; $deliveryTotal = '0';
$addedTotal = (string) $bill->added_amount; $addedTotal = '0';
$afterSaleTotal = (string) $bill->after_sale; $afterSaleTotal = '0';
$boxNum = 0;
$trayNum = 0;
foreach ($bills as $selectedBill) {
$deliveryTotal = bcadd($deliveryTotal, (string) $selectedBill->delivery_fee, 2);
$addedTotal = bcadd($addedTotal, (string) $selectedBill->added_amount, 2);
$afterSaleTotal = bcadd($afterSaleTotal, (string) $selectedBill->after_sale, 2);
$boxNum += (int) $selectedBill->box_num;
$trayNum += (int) $selectedBill->tray_num;
}
$grandTotal = bcadd(bcadd(bcadd($totalAmount, $deliveryTotal, 2), $addedTotal, 2), $afterSaleTotal, 2); $grandTotal = bcadd(bcadd(bcadd($totalAmount, $deliveryTotal, 2), $addedTotal, 2), $afterSaleTotal, 2);
$rows[] = ['配送费', '', '', '', '', '', '', (float) $deliveryTotal]; $rows[] = ['配送费', '', '', '', '', '', '', (float) $deliveryTotal];
@@ -182,7 +190,7 @@ class BillExport implements FromCollection, WithStyles, WithTitle
$this->mergeRows[] = $rowIndex; $this->mergeRows[] = $rowIndex;
$this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $deliveryTotal]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $deliveryTotal];
$rows[] = ['附加金额(周转筐 ' . (int) $bill->box_num . ' 个 / 周转托盘 ' . (int) $bill->tray_num . ' 个)', '', '', '', '', '', '', (float) $addedTotal]; $rows[] = ['附加金额(周转筐 ' . $boxNum . ' 个 / 周转托盘 ' . $trayNum . ' 个)', '', '', '', '', '', '', (float) $addedTotal];
$this->specialRows[++$rowIndex] = 'summary'; $this->specialRows[++$rowIndex] = 'summary';
$this->mergeRows[] = $rowIndex; $this->mergeRows[] = $rowIndex;
$this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $addedTotal]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $addedTotal];
@@ -197,7 +205,38 @@ class BillExport implements FromCollection, WithStyles, WithTitle
$this->mergeRows[] = $rowIndex; $this->mergeRows[] = $rowIndex;
$this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $grandTotal]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $grandTotal];
$this->lastRow = $rowIndex; $this->lastRow = $rowIndex;
$this->tableRanges[] = ['header' => $currentHeaderRow, 'last' => $rowIndex]; }
/**
* 合并所选账单商品:数量、重量、金额累加,单价按总金额 ÷ 总数量重新加权
*
* @param Collection<int, BillModel> $bills
* @return array<int, array{product_id: int, product_name: string, product_spec: string, unit: string, price: string, quantity: int, weight: string, amount: string, spec: string, price_unit: string, image: string}>
*/
private function mergedItems(Collection $bills): array
{
$merged = [];
$service = app(BillDetailService::class);
foreach ($bills as $bill) {
foreach ($service->mergedItems($bill) as $item) {
$productId = (int) $item['product_id'];
if (! isset($merged[$productId])) {
$merged[$productId] = $item;
continue;
}
$merged[$productId]['quantity'] += (int) $item['quantity'];
$merged[$productId]['weight'] = bcadd($merged[$productId]['weight'], $item['weight'], 3);
$merged[$productId]['amount'] = bcadd($merged[$productId]['amount'], $item['amount'], 2);
$merged[$productId]['price'] = bcdiv(
$merged[$productId]['amount'],
(string) $merged[$productId]['quantity'],
2
);
}
}
return array_values($merged);
} }
/** /**
@@ -231,22 +270,20 @@ class BillExport implements FromCollection, WithStyles, WithTitle
$sheet->getStyle('A' . $row)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT); $sheet->getStyle('A' . $row)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
} }
// 各账单表格区域(列头 → 末行)添加所有边框,金额列设置货币格式 // 表格区域(列头 → 末行)添加所有边框
foreach ($this->tableRanges as $range) { $sheet->getStyle('A' . $this->headerRow . ':H' . $this->lastRow)
$sheet->getStyle('A' . $range['header'] . ':H' . $range['last']) ->getBorders()
->getBorders() ->getAllBorders()
->getAllBorders() ->setBorderStyle(Border::BORDER_THIN);
->setBorderStyle(Border::BORDER_THIN);
$sheet->getStyle('H' . ($range['header'] + 1) . ':H' . $range['last']) // 金额列货币格式:¥ + 两位小数(单价列为文本,不设格式)
->getNumberFormat() $sheet->getStyle('H' . ($this->headerRow + 1) . ':H' . $this->lastRow)
->setFormatCode(self::CURRENCY_FORMAT); ->getNumberFormat()
} ->setFormatCode(self::CURRENCY_FORMAT);
// 列头固定填色:数量列(F)浅黄、金额列(H)浅红 // 列头固定填色:数量列(F)浅黄、金额列(H)浅红
foreach ($this->headerRows as $headerRow) { $this->fillCell($sheet, 'F' . $this->headerRow, self::QUANTITY_FILL);
$this->fillCell($sheet, 'F' . $headerRow, self::QUANTITY_FILL); $this->fillCell($sheet, 'H' . $this->headerRow, self::AMOUNT_FILL);
$this->fillCell($sheet, 'H' . $headerRow, self::AMOUNT_FILL);
}
// 数据区条件填色:非 0 填色,0 无背景(金额含负值) // 数据区条件填色:非 0 填色,0 无背景(金额含负值)
foreach ($this->fillCells as $cell) { foreach ($this->fillCells as $cell) {
@@ -322,7 +359,7 @@ class BillExport implements FromCollection, WithStyles, WithTitle
)); ));
if ($filtered === []) { if ($filtered === []) {
throw new RepositoryException('该账单在「' . $categoryName . '」分类下无商品明细'); throw new RepositoryException('所选账单在「' . $categoryName . '」分类下无商品明细');
} }
return [$filtered, $categoryName]; return [$filtered, $categoryName];
+1 -1
View File
@@ -88,7 +88,7 @@ class BillController extends BaseMiniController
} }
/** /**
* 批量导出账单:仅可导出本店账单,选中账单合并在同一工作表 * 批量导出账单:仅可导出本店账单,所选账单数据合并为一张表
*/ */
#[GetRoute('/bill/batch-export', authorize: true)] #[GetRoute('/bill/batch-export', authorize: true)]
public function batchExport(Request $request): Response public function batchExport(Request $request): Response
@@ -62,7 +62,7 @@ class BillController extends BaseController
} }
/** /**
* 批量导出账单:同一门店的账单合并在一张工作表,不同门店拆分为多个工作表 * 批量导出账单:同一门店的账单数据合并为一张表,不同门店拆分为多个工作表
*/ */
#[GetRoute(route: '/batch-export', authorize: 'export')] #[GetRoute(route: '/batch-export', authorize: 'export')]
public function batchExport(Request $request): Response public function batchExport(Request $request): Response
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-qtYAiD4_.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`403`,title:`403`,subTitle:`Sorry, you are not authorized to access this page.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-Cv0YlB7k.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`403`,title:`403`,subTitle:`Sorry, you are not authorized to access this page.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-qtYAiD4_.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`404`,title:`404`,subTitle:`Sorry, the page you visited does not exist.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-Cv0YlB7k.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`404`,title:`404`,subTitle:`Sorry, the page you visited does not exist.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-qtYAiD4_.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`500`,title:`500`,subTitle:`Sorry, something went wrong.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-Cv0YlB7k.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{status:`500`,title:`500`,subTitle:`Sorry, something went wrong.`,extra:(0,a.jsx)(n,{type:`primary`,children:`Back Home`})})});export{o 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
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{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{o as r}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as i}from"./typography-C81dpVAv.js";import{t as a}from"./tooltip-DI_m69zk.js";import{t as o}from"./space-JYtHxLjg.js";import{t as s}from"./button-DsOd0cni.js";import{t as c}from"./card-C-jMUkpS.js";import{t as l}from"./spin-CELNGCax.js";import{t as u}from"./tag-CY8tAhzO.js";import{t as d}from"./useTranslation-C4ZVtLa2.js";import{$t as f,Ht as p,bt as m,lt as h,rn as g}from"./index-Cf1llsZx.js";import{n as _,r as v}from"./agent-CGxkD5Jw.js";var y=e(t(),1),b=n(),{Title:x,Text:S,Paragraph:C}=i;function w(){let{t:e}=d(),{token:t}=h.useToken(),{message:n}=g.useApp(),i=r(),[w,T]=(0,y.useState)([]),[E,D]=(0,y.useState)(!1),O=(0,y.useCallback)(async()=>{D(!0);try{let e=await _();T(e.data.data??[])}finally{D(!1)}},[]);(0,y.useEffect)(()=>{O()},[O]);let k=async(t,r)=>{try{await v(t,{enabled:r}),T(e=>e.map(e=>e.id===t?{...e,enabled:r}:e)),n.success(e(`ai.agent.update.success`))}catch{n.error(e(`ai.agent.update.failed`))}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:t.marginLG},children:(0,b.jsxs)(`div`,{children:[(0,b.jsx)(x,{level:3,style:{marginBottom:t.marginXS},children:e(`ai.agent.page.title`)}),(0,b.jsx)(S,{type:`secondary`,children:e(`ai.agent.page.description`)})]})}),(0,b.jsx)(l,{spinning:E,children:w.length>0?(0,b.jsx)(`div`,{className:`flex flex-wrap gap-6`,children:w.map(n=>(0,b.jsx)(a,{title:n.description,children:(0,b.jsxs)(c,{hoverable:!0,variant:`borderless`,styles:{body:{width:300,padding:20,overflow:`hidden`}},children:[(0,b.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,b.jsxs)(o,{align:`center`,children:[(0,b.jsx)(p,{src:n.icon,size:32}),(0,b.jsx)(`span`,{style:{fontWeight:700,fontSize:18},children:n.name})]}),(0,b.jsx)(m,{checked:n.enabled,size:`small`,onChange:e=>k(n.id,e)})]}),(0,b.jsx)(C,{type:`secondary`,ellipsis:{rows:2},style:{marginBottom:t.marginSM},children:n.description}),(0,b.jsx)(o,{size:[4,4],wrap:!0,children:n.tags?.map(e=>(0,b.jsx)(u,{color:`blue`,children:e},e))}),(0,b.jsx)(`div`,{style:{marginTop:t.marginSM},children:(0,b.jsx)(s,{type:`primary`,size:`small`,block:!0,onClick:()=>i(`/ai/chat?agent_id=${n.id}`),children:e(`ai.agent.goChat`)})})]})}))}):(0,b.jsx)(f,{description:e(`ai.agent.empty`)})})]})}export{w as default};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{o as r}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as i}from"./typography-C81dpVAv.js";import{t as a}from"./tooltip-DI_m69zk.js";import{t as o}from"./space-JYtHxLjg.js";import{t as s}from"./button-DsOd0cni.js";import{t as c}from"./card-C-jMUkpS.js";import{t as l}from"./spin-CELNGCax.js";import{t as u}from"./tag-CY8tAhzO.js";import{t as d}from"./useTranslation-C4ZVtLa2.js";import{$t as f,Ht as p,bt as m,lt as h,rn as g}from"./index-DLqXr84t.js";import{n as _,r as v}from"./agent-CGxkD5Jw.js";var y=e(t(),1),b=n(),{Title:x,Text:S,Paragraph:C}=i;function w(){let{t:e}=d(),{token:t}=h.useToken(),{message:n}=g.useApp(),i=r(),[w,T]=(0,y.useState)([]),[E,D]=(0,y.useState)(!1),O=(0,y.useCallback)(async()=>{D(!0);try{let e=await _();T(e.data.data??[])}finally{D(!1)}},[]);(0,y.useEffect)(()=>{O()},[O]);let k=async(t,r)=>{try{await v(t,{enabled:r}),T(e=>e.map(e=>e.id===t?{...e,enabled:r}:e)),n.success(e(`ai.agent.update.success`))}catch{n.error(e(`ai.agent.update.failed`))}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:t.marginLG},children:(0,b.jsxs)(`div`,{children:[(0,b.jsx)(x,{level:3,style:{marginBottom:t.marginXS},children:e(`ai.agent.page.title`)}),(0,b.jsx)(S,{type:`secondary`,children:e(`ai.agent.page.description`)})]})}),(0,b.jsx)(l,{spinning:E,children:w.length>0?(0,b.jsx)(`div`,{className:`flex flex-wrap gap-6`,children:w.map(n=>(0,b.jsx)(a,{title:n.description,children:(0,b.jsxs)(c,{hoverable:!0,variant:`borderless`,styles:{body:{width:300,padding:20,overflow:`hidden`}},children:[(0,b.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,b.jsxs)(o,{align:`center`,children:[(0,b.jsx)(p,{src:n.icon,size:32}),(0,b.jsx)(`span`,{style:{fontWeight:700,fontSize:18},children:n.name})]}),(0,b.jsx)(m,{checked:n.enabled,size:`small`,onChange:e=>k(n.id,e)})]}),(0,b.jsx)(C,{type:`secondary`,ellipsis:{rows:2},style:{marginBottom:t.marginSM},children:n.description}),(0,b.jsx)(o,{size:[4,4],wrap:!0,children:n.tags?.map(e=>(0,b.jsx)(u,{color:`blue`,children:e},e))}),(0,b.jsx)(`div`,{style:{marginTop:t.marginSM},children:(0,b.jsx)(s,{type:`primary`,size:`small`,block:!0,onClick:()=>i(`/ai/chat?agent_id=${n.id}`),children:e(`ai.agent.goChat`)})})]})}))}):(0,b.jsx)(f,{description:e(`ai.agent.empty`)})})]})}export{w 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
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-D2CF6Ecw.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-1TzMt4Ci.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};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-B23_bhQM.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-B8iT02Iv.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
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./button-DsOd0cni.js";import{l as a}from"./XinForm-la76gZVt.js";import{t as o}from"./form-CDfHsmlW.js";import{t as s}from"./tag-CY8tAhzO.js";import{k as c}from"./index-Cf1llsZx.js";import{t as l}from"./XinTable-B8iT02Iv.js";import{n as u,t as d}from"./category-D44XYgt2.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=o.useWatch(`id`,e),s=o.useWatch(`children`,e),c=Array.isArray(s)&&s.length>0,l=(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]);return(0,m.jsx)(a,{value:n,onChange:r,treeData:l,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)([]),[a,o]=(0,f.useState)([]);return(0,f.useEffect)(()=>{u().then(e=>o(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:a})},{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)(s,{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)(i,{icon:(0,m.jsx)(c,{}),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};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./button-DsOd0cni.js";import{l as a}from"./XinForm-lkQQPJzP.js";import{t as o}from"./form-CDfHsmlW.js";import{t as s}from"./tag-CY8tAhzO.js";import{k as c}from"./index-DLqXr84t.js";import{t as l}from"./XinTable-1TzMt4Ci.js";import{n as u,t as d}from"./category-D44XYgt2.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=o.useWatch(`id`,e),s=o.useWatch(`children`,e),c=Array.isArray(s)&&s.length>0,l=(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]);return(0,m.jsx)(a,{value:n,onChange:r,treeData:l,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)([]),[a,o]=(0,f.useState)([]);return(0,f.useEffect)(()=>{u().then(e=>o(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:a})},{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)(s,{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)(i,{icon:(0,m.jsx)(c,{}),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
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
View File
@@ -0,0 +1 @@
import{o as e,t}from"./request-xrnk7ZJV.js";import{Pr as n,t as r}from"./jsx-runtime-OfKoVykY.js";import{t as i}from"./typography-C81dpVAv.js";import{t as a}from"./tooltip-DI_m69zk.js";import{t as o}from"./table-DgVv7_C-.js";import{t as s}from"./button-DsOd0cni.js";import{n as c}from"./LockOutlined-CM922FLC.js";import{t as l}from"./EyeOutlined-CdD0jpIv.js";import{t as u}from"./tag-CY8tAhzO.js";import{t as d}from"./useTranslation-C4ZVtLa2.js";import{Pt as f}from"./index-DLqXr84t.js";import{t as p}from"./XinTable-1TzMt4Ci.js";async function m(e,n){return t({url:`/ai/conversation/${e}/messages`,method:`get`,params:n})}var h=e(c(),1),g=e(n(),1),_=r(),{Title:v,Text:y}=i;function b(){let{t:e}=d(),[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(``),[c,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)(u,{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)(a,{title:e(`ai.conversation.viewMessages`),children:(0,_.jsx)(s,{type:`primary`,icon:(0,_.jsx)(l,{}),size:`small`,onClick:()=>A(t)})},`view`),n.del],scroll:{x:1100},cardProps:{variant:`borderless`}}),(0,_.jsx)(f,{title:`${e(`ai.conversation.messageTitle`)} - ${r}`,open:t,onClose:()=>n(!1),width:900,children:(0,_.jsx)(o,{dataSource:c,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};
+1
View File
@@ -0,0 +1 @@
import{o as e,t}from"./request-xrnk7ZJV.js";import{Pr as n,t as r}from"./jsx-runtime-OfKoVykY.js";import{t as i}from"./typography-C81dpVAv.js";import{t as a}from"./tooltip-DI_m69zk.js";import{t as o}from"./table-uS555MjK.js";import{t as s}from"./button-DsOd0cni.js";import{n as c}from"./LockOutlined-CM922FLC.js";import{t as l}from"./EyeOutlined-CdD0jpIv.js";import{t as u}from"./tag-CY8tAhzO.js";import{t as d}from"./useTranslation-C4ZVtLa2.js";import{Pt as f}from"./index-Cf1llsZx.js";import{t as p}from"./XinTable-B8iT02Iv.js";async function m(e,n){return t({url:`/ai/conversation/${e}/messages`,method:`get`,params:n})}var h=e(c(),1),g=e(n(),1),_=r(),{Title:v,Text:y}=i;function b(){let{t:e}=d(),[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(``),[c,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)(u,{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)(a,{title:e(`ai.conversation.viewMessages`),children:(0,_.jsx)(s,{type:`primary`,icon:(0,_.jsx)(l,{}),size:`small`,onClick:()=>A(t)})},`view`),n.del],scroll:{x:1100},cardProps:{variant:`borderless`}}),(0,_.jsx)(f,{title:`${e(`ai.conversation.messageTitle`)} - ${r}`,open:t,onClose:()=>n(!1),width:900,children:(0,_.jsx)(o,{dataSource:c,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
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
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{t}from"./jsx-runtime-OfKoVykY.js";import{o as n}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./tooltip-DI_m69zk.js";import{t as a}from"./button-DsOd0cni.js";import{t as o}from"./badge-CusEU3o_.js";import{n as s}from"./LockOutlined-CM922FLC.js";import{t as c}from"./useTranslation-C4ZVtLa2.js";import{l,n as u}from"./index-Cf1llsZx.js";import{t as d}from"./XinTable-B8iT02Iv.js";var f=t(),p=e(s(),1),{Title:m,Text:h}=r;function g(){let{t:e}=c(),t=n(),r=u(e=>e.initDict),s=[{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)(o,{status:`success`,text:e(`system.dict.status.normal`)}):(0,f.jsx)(o,{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:s,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)(a,{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)(i,{title:e(`system.dict.manageItems`),children:(0,f.jsx)(a,{type:`default`,icon:(0,f.jsx)(l,{}),size:`small`,onClick:()=>_(t)})}),n.edit,n.del]})]})}export{g as default};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{t}from"./jsx-runtime-OfKoVykY.js";import{o as n}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./tooltip-DI_m69zk.js";import{t as a}from"./button-DsOd0cni.js";import{t as o}from"./badge-CusEU3o_.js";import{n as s}from"./LockOutlined-CM922FLC.js";import{t as c}from"./useTranslation-C4ZVtLa2.js";import{l,n as u}from"./index-DLqXr84t.js";import{t as d}from"./XinTable-1TzMt4Ci.js";var f=t(),p=e(s(),1),{Title:m,Text:h}=r;function g(){let{t:e}=c(),t=n(),r=u(e=>e.initDict),s=[{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)(o,{status:`success`,text:e(`system.dict.status.normal`)}):(0,f.jsx)(o,{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:s,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)(a,{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)(i,{title:e(`system.dict.manageItems`),children:(0,f.jsx)(a,{type:`default`,icon:(0,f.jsx)(l,{}),size:`small`,onClick:()=>_(t)})}),n.edit,n.del]})]})}export{g as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./button-DsOd0cni.js";import{t as i}from"./card-C-jMUkpS.js";import{t as a}from"./result-Cv0YlB7k.js";import{G as o}from"./index-DLqXr84t.js";e();var s=t(),{Paragraph:c,Text:l}=n,u=()=>(0,s.jsx)(i,{variant:`borderless`,children:(0,s.jsx)(a,{status:`error`,title:`Submission Failed`,subTitle:`Please check and modify the following information before resubmitting.`,extra:[(0,s.jsx)(r,{type:`primary`,children:`Go Console`},`console`),(0,s.jsx)(r,{children:`Buy Again`},`buy`)],children:(0,s.jsxs)(`div`,{className:`desc`,children:[(0,s.jsx)(c,{children:(0,s.jsx)(l,{strong:!0,style:{fontSize:16},children:`The content you submitted has the following error:`})}),(0,s.jsxs)(c,{children:[(0,s.jsx)(o,{className:`site-result-demo-error-icon`}),` Your account has been frozen. `,(0,s.jsx)(`a`,{children:`Thaw immediately >`})]}),(0,s.jsxs)(c,{children:[(0,s.jsx)(o,{className:`site-result-demo-error-icon`}),` Your account is not yet eligible to apply. `,(0,s.jsx)(`a`,{children:`Apply Unlock >`})]})]})})});export{u as default};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./button-DsOd0cni.js";import{t as i}from"./card-C-jMUkpS.js";import{t as a}from"./result-qtYAiD4_.js";import{G as o}from"./index-Cf1llsZx.js";e();var s=t(),{Paragraph:c,Text:l}=n,u=()=>(0,s.jsx)(i,{variant:`borderless`,children:(0,s.jsx)(a,{status:`error`,title:`Submission Failed`,subTitle:`Please check and modify the following information before resubmitting.`,extra:[(0,s.jsx)(r,{type:`primary`,children:`Go Console`},`console`),(0,s.jsx)(r,{children:`Buy Again`},`buy`)],children:(0,s.jsxs)(`div`,{className:`desc`,children:[(0,s.jsx)(c,{children:(0,s.jsx)(l,{strong:!0,style:{fontSize:16},children:`The content you submitted has the following error:`})}),(0,s.jsxs)(c,{children:[(0,s.jsx)(o,{className:`site-result-demo-error-icon`}),` Your account has been frozen. `,(0,s.jsx)(`a`,{children:`Thaw immediately >`})]}),(0,s.jsxs)(c,{children:[(0,s.jsx)(o,{className:`site-result-demo-error-icon`}),` Your account is not yet eligible to apply. `,(0,s.jsx)(`a`,{children:`Apply Unlock >`})]})]})})});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{t as e}from"./jsx-runtime-OfKoVykY.js";import{t}from"./space-JYtHxLjg.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{n as i,t as a}from"./row-DM2jDy-f.js";import{Vt as o}from"./index-DLqXr84t.js";var s=e(),c=()=>(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(r,{style:{marginBottom:16},children:[(0,s.jsx)(o,{items:[{title:`多级菜单`},{title:`二级页面`}]}),(0,s.jsx)(`h2`,{style:{marginTop:16,marginBottom:0},children:`二级页面`})]}),(0,s.jsxs)(a,{gutter:[16,16],children:[(0,s.jsx)(i,{span:24,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:16,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:8,children:(0,s.jsx)(r,{style:{height:200}})})]}),(0,s.jsx)(r,{style:{marginTop:16},children:(0,s.jsxs)(t,{children:[(0,s.jsx)(n,{children:`重置`}),(0,s.jsx)(n,{type:`primary`,children:`提交`})]})})]});export{c as default};
+1
View File
@@ -0,0 +1 @@
import{t as e}from"./jsx-runtime-OfKoVykY.js";import{t}from"./space-JYtHxLjg.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{n as i,t as a}from"./row-DM2jDy-f.js";import{Vt as o}from"./index-Cf1llsZx.js";var s=e(),c=()=>(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(r,{style:{marginBottom:16},children:[(0,s.jsx)(o,{items:[{title:`多级菜单`},{title:`二级页面`}]}),(0,s.jsx)(`h2`,{style:{marginTop:16,marginBottom:0},children:`二级页面`})]}),(0,s.jsxs)(a,{gutter:[16,16],children:[(0,s.jsx)(i,{span:24,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:16,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:8,children:(0,s.jsx)(r,{style:{height:200}})})]}),(0,s.jsx)(r,{style:{marginTop:16},children:(0,s.jsxs)(t,{children:[(0,s.jsx)(n,{children:`重置`}),(0,s.jsx)(n,{type:`primary`,children:`提交`})]})})]});export{c 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
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./space-JYtHxLjg.js";import{c as a,t as o}from"./XinForm-la76gZVt.js";import{t as s}from"./card-C-jMUkpS.js";import{t as c}from"./divider-j0hopRxQ.js";import{Tt as l}from"./index-Cf1llsZx.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};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./space-JYtHxLjg.js";import{c as a,t as o}from"./XinForm-lkQQPJzP.js";import{t as s}from"./card-C-jMUkpS.js";import{t as c}from"./divider-j0hopRxQ.js";import{Tt as l}from"./index-DLqXr84t.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
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./space-JYtHxLjg.js";import{t as a}from"./button-DsOd0cni.js";import{t as o}from"./card-C-jMUkpS.js";import{t as s}from"./form-CDfHsmlW.js";import{t as c}from"./ImageUploader-B707lNe5.js";var l=e(t(),1),u=n(),{Title:d,Paragraph:f}=r,p=()=>{let[e]=s.useForm(),[t,n]=(0,l.useState)(null),[p,m]=(0,l.useState)([]);return(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,u.jsx)(d,{level:2,children:`图片上传组件示例`}),(0,u.jsx)(f,{children:`基于 Ant Design Upload 封装的图片上传组件,支持图片剪裁、多张图片上传、尺寸限制、禁用状态等。`})]}),(0,u.jsx)(o,{title:`基础用法`,style:{marginBottom:24},children:(0,u.jsxs)(s,{form:e,layout:`vertical`,children:[(0,u.jsx)(s.Item,{label:`单张图片上传`,name:`avatar`,extra:`支持单张图片上传,最大 5MB,尺寸不超过 1920x1080`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,value:t,onChange:e=>n(e)})}),(0,u.jsx)(s.Item,{label:`多张图片上传`,name:`gallery`,extra:`支持最多 5 张图片上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`multiple`,maxCount:5,value:p,onChange:e=>m(e)})}),(0,u.jsx)(s.Item,{children:(0,u.jsxs)(i,{children:[(0,u.jsx)(a,{type:`primary`,onClick:async()=>{try{let n=await e.validateFields();console.log(`Form values:`,n),console.log(`Single image:`,t),console.log(`Multiple images:`,p)}catch(e){console.error(`Validation failed:`,e)}},children:`提交`}),(0,u.jsx)(a,{onClick:()=>{e.resetFields(),n(null),m([])},children:`重置`})]})})]})}),(0,u.jsx)(o,{title:`高级配置`,style:{marginBottom:24},children:(0,u.jsxs)(s,{layout:`vertical`,children:[(0,u.jsx)(s.Item,{label:`自定义尺寸限制`,extra:`限制图片尺寸为 800x600,大小不超过 2MB`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,maxWidth:800,maxHeight:600,maxSize:2})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 自由裁剪`,extra:`启用裁剪功能,可自由调整裁剪区域`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 1:1 正方形`,extra:`固定 1:1 比例裁剪,适合头像上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{aspect:1}})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 圆形裁剪`,extra:`圆形裁剪模式,适合头像上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{cropShape:`round`,aspect:1}})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 16:9 宽屏`,extra:`固定 16:9 比例裁剪,适合横幅图片`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{aspect:16/9}})}),(0,u.jsx)(s.Item,{label:`禁用状态`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,disabled:!0})})]})})]})};export{p as default};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./space-JYtHxLjg.js";import{t as a}from"./button-DsOd0cni.js";import{t as o}from"./card-C-jMUkpS.js";import{t as s}from"./form-CDfHsmlW.js";import{t as c}from"./ImageUploader-Cr_U-9yy.js";var l=e(t(),1),u=n(),{Title:d,Paragraph:f}=r,p=()=>{let[e]=s.useForm(),[t,n]=(0,l.useState)(null),[p,m]=(0,l.useState)([]);return(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(r,{style:{margin:`12px 0 24px 0`},children:[(0,u.jsx)(d,{level:2,children:`图片上传组件示例`}),(0,u.jsx)(f,{children:`基于 Ant Design Upload 封装的图片上传组件,支持图片剪裁、多张图片上传、尺寸限制、禁用状态等。`})]}),(0,u.jsx)(o,{title:`基础用法`,style:{marginBottom:24},children:(0,u.jsxs)(s,{form:e,layout:`vertical`,children:[(0,u.jsx)(s.Item,{label:`单张图片上传`,name:`avatar`,extra:`支持单张图片上传,最大 5MB,尺寸不超过 1920x1080`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,value:t,onChange:e=>n(e)})}),(0,u.jsx)(s.Item,{label:`多张图片上传`,name:`gallery`,extra:`支持最多 5 张图片上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`multiple`,maxCount:5,value:p,onChange:e=>m(e)})}),(0,u.jsx)(s.Item,{children:(0,u.jsxs)(i,{children:[(0,u.jsx)(a,{type:`primary`,onClick:async()=>{try{let n=await e.validateFields();console.log(`Form values:`,n),console.log(`Single image:`,t),console.log(`Multiple images:`,p)}catch(e){console.error(`Validation failed:`,e)}},children:`提交`}),(0,u.jsx)(a,{onClick:()=>{e.resetFields(),n(null),m([])},children:`重置`})]})})]})}),(0,u.jsx)(o,{title:`高级配置`,style:{marginBottom:24},children:(0,u.jsxs)(s,{layout:`vertical`,children:[(0,u.jsx)(s.Item,{label:`自定义尺寸限制`,extra:`限制图片尺寸为 800x600,大小不超过 2MB`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,maxWidth:800,maxHeight:600,maxSize:2})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 自由裁剪`,extra:`启用裁剪功能,可自由调整裁剪区域`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 1:1 正方形`,extra:`固定 1:1 比例裁剪,适合头像上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{aspect:1}})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 圆形裁剪`,extra:`圆形裁剪模式,适合头像上传`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{cropShape:`round`,aspect:1}})}),(0,u.jsx)(s.Item,{label:`裁剪功能 - 16:9 宽屏`,extra:`固定 16:9 比例裁剪,适合横幅图片`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,croppable:!0,cropperOptions:{aspect:16/9}})}),(0,u.jsx)(s.Item,{label:`禁用状态`,children:(0,u.jsx)(c,{action:`/sys/file/list/upload/image`,mode:`single`,disabled:!0})})]})})]})};export{p 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
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-qtYAiD4_.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{title:`Your operation has been executed`,extra:(0,a.jsx)(n,{type:`primary`,children:`Go Console`},`console`)})});export{o as default};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{t as i}from"./result-Cv0YlB7k.js";e();var a=t(),o=()=>(0,a.jsx)(r,{variant:`borderless`,children:(0,a.jsx)(i,{title:`Your operation has been executed`,extra:(0,a.jsx)(n,{type:`primary`,children:`Go Console`},`console`)})});export{o as default};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{o as r,s as i}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as a}from"./typography-C81dpVAv.js";import{t as o}from"./space-JYtHxLjg.js";import{t as s}from"./button-DsOd0cni.js";import{t as c}from"./LeftOutlined-V7kBMNHZ.js";import{t as l}from"./badge-CusEU3o_.js";import{n as u}from"./LockOutlined-CM922FLC.js";import{i as d,s as f}from"./XinForm-lkQQPJzP.js";import{t as p}from"./tag-CY8tAhzO.js";import{t as m}from"./useTranslation-C4ZVtLa2.js";import{t as h}from"./XinTable-1TzMt4Ci.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=>{let t=g.find(t=>t.value===e);return(0,y.jsx)(p,{color:e,children:t?.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
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{o as r,s as i}from"./chunk-OB3PAWPO-D_lbwNck.js";import{t as a}from"./typography-C81dpVAv.js";import{t as o}from"./space-JYtHxLjg.js";import{t as s}from"./button-DsOd0cni.js";import{t as c}from"./LeftOutlined-V7kBMNHZ.js";import{t as l}from"./badge-CusEU3o_.js";import{n as u}from"./LockOutlined-CM922FLC.js";import{i as d,s as f}from"./XinForm-la76gZVt.js";import{t as p}from"./tag-CY8tAhzO.js";import{t as m}from"./useTranslation-C4ZVtLa2.js";import{t as h}from"./XinTable-B8iT02Iv.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=>{let t=g.find(t=>t.value===e);return(0,y.jsx)(p,{color:e,children:t?.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
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-D2CF6Ecw.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-1TzMt4Ci.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:`按等级配置价格上浮比例:售价 = 成本价 × (100 + 上浮比例) / 100,门店绑定等级后小程序端按对应价格展示。`})]}),(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:`percent`,valueType:`digit`,hideInSearch:!0,initialValue:0,tooltip:`该等级售价 = 成本价 × (100 + 上浮比例) / 100`,fieldProps:{min:0,max:999.99,precision:2,suffix:`%`,placeholder:`如 30 表示成本价上浮 30%`},align:`center`,render:(e,t)=>(0,s.jsxs)(i,{color:`blue`,children:[Number(t.percent??0),`%`]})},{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};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-B23_bhQM.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-B8iT02Iv.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:`按等级配置价格上浮比例:售价 = 成本价 × (100 + 上浮比例) / 100,门店绑定等级后小程序端按对应价格展示。`})]}),(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:`percent`,valueType:`digit`,hideInSearch:!0,initialValue:0,tooltip:`该等级售价 = 成本价 × (100 + 上浮比例) / 100`,fieldProps:{min:0,max:999.99,precision:2,suffix:`%`,placeholder:`如 30 表示成本价上浮 30%`},align:`center`,render:(e,t)=>(0,s.jsxs)(i,{color:`blue`,children:[Number(t.percent??0),`%`]})},{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
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
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-B23_bhQM.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-B8iT02Iv.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
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-D2CF6Ecw.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-1TzMt4Ci.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
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-B8iT02Iv.js";import{t as o}from"./store-BNgJbT1w.js";var s=e(t(),1),c={order:{text:`订单`,color:`blue`},price:{text:`价格`,color:`gold`},system:{text:`系统`,color:`default`}},l={0:{text:`未读`,color:`warning`},1:{text:`已读`,color:`default`}},u=n(),{Title:d,Text:f}=r,p=()=>{let[e,t]=(0,s.useState)([]);(0,s.useEffect)(()=>{o().then(e=>t(e.data.data??[]))},[]);let n=new Map(e.map(e=>[e.id,e.name])),r={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=c[t.type??`system`];return(0,u.jsx)(i,{color:n?.color,children:n?.text})}},{title:`接收对象`,dataIndex:`store_id`,valueType:`select`,hideInSearch:!0,initialValue:0,fieldProps:{options:[{label:`全员广播`,value:0},...e.map(e=>({label:e.name??``,value:e.id??0}))],showSearch:!0,optionFilterProp:`label`,placeholder:`默认全员广播`},align:`center`,render:(e,t)=>t.store_id===0?(0,u.jsx)(i,{color:`gold`,children:`全员广播`}):(0,u.jsx)(i,{children:n.get(t.store_id)??`门店 #${t.store_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=l[t.is_read??0];return(0,u.jsx)(i,{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}};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`mb-5`,children:[(0,u.jsx)(d,{level:3,children:`通知管理`}),(0,u.jsx)(f,{type:`secondary`,children:`向门店端小程序发送消息;接收对象默认全员广播,价格调整通知由批量调价自动生成。`})]}),(0,u.jsx)(a,{...r})]})};export{p as default};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{Pr as t,t as n}from"./jsx-runtime-OfKoVykY.js";import{t as r}from"./typography-C81dpVAv.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-1TzMt4Ci.js";import{t as o}from"./store-BNgJbT1w.js";var s=e(t(),1),c={order:{text:`订单`,color:`blue`},price:{text:`价格`,color:`gold`},system:{text:`系统`,color:`default`}},l={0:{text:`未读`,color:`warning`},1:{text:`已读`,color:`default`}},u=n(),{Title:d,Text:f}=r,p=()=>{let[e,t]=(0,s.useState)([]);(0,s.useEffect)(()=>{o().then(e=>t(e.data.data??[]))},[]);let n=new Map(e.map(e=>[e.id,e.name])),r={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=c[t.type??`system`];return(0,u.jsx)(i,{color:n?.color,children:n?.text})}},{title:`接收对象`,dataIndex:`store_id`,valueType:`select`,hideInSearch:!0,initialValue:0,fieldProps:{options:[{label:`全员广播`,value:0},...e.map(e=>({label:e.name??``,value:e.id??0}))],showSearch:!0,optionFilterProp:`label`,placeholder:`默认全员广播`},align:`center`,render:(e,t)=>t.store_id===0?(0,u.jsx)(i,{color:`gold`,children:`全员广播`}):(0,u.jsx)(i,{children:n.get(t.store_id)??`门店 #${t.store_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=l[t.is_read??0];return(0,u.jsx)(i,{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}};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`mb-5`,children:[(0,u.jsx)(d,{level:3,children:`通知管理`}),(0,u.jsx)(f,{type:`secondary`,children:`向门店端小程序发送消息;接收对象默认全员广播,价格调整通知由批量调价自动生成。`})]}),(0,u.jsx)(a,{...r})]})};export{p 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
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{o as e}from"./request-xrnk7ZJV.js";import{$n as t,Bn as n,Ct as r,Er as i,Hn as a,Pr as o,Wn as s,ht as c,pt as l,qt as u,rr as d,wt as f}from"./jsx-runtime-OfKoVykY.js";import{i as p}from"./tooltip-DI_m69zk.js";import{t as m}from"./ExclamationCircleFilled-Cqa4L7Rp.js";import{v as h}from"./useModal-Df03h-2u.js";import{a as g,n as _}from"./button-DsOd0cni.js";import{Gt as v,Ut as y,Wt as b}from"./index-DLqXr84t.js";var x=e(o()),S=u(`Popconfirm`,e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:a,colorWarning:o,marginXXS:s,marginXS:c,fontSize:l,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:l},[`${t}-message`]:{marginBottom:c,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon`]:{color:o},[`> ${t}-message-icon ${n}`]:{fontSize:l,lineHeight:1,marginInlineEnd:c},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:400}},[`${t}-description`]:{marginTop:s,color:a}},[`${t}-buttons`]:{textAlign:`end`,whiteSpace:`nowrap`,button:{marginInlineStart:c}}}}},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),C=e=>{let{prefixCls:t,okButtonProps:r,cancelButtonProps:i,title:a,description:o,cancelText:u,okText:f,okType:p=`primary`,icon:y=x.createElement(m,null),showCancel:b=!0,close:S,onConfirm:C,onCancel:w,onPopupClick:T,classNames:E,styles:D}=e,{getPrefixCls:O}=x.useContext(n),[k]=l(`Popconfirm`,c.Popconfirm),A=v(a),j=v(o),M=e=>{w?.(e),i?.onClick?.(e)};return x.createElement(`div`,{className:`${t}-inner-content`,onClick:T},x.createElement(`div`,{className:`${t}-message`},y&&x.createElement(`span`,{className:s(`${t}-message-icon`,E?.icon),style:D?.icon},y),x.createElement(`div`,{className:`${t}-message-text`},d(A)&&x.createElement(`div`,{className:s(`${t}-title`,E?.title),style:D?.title},A),d(j)&&x.createElement(`div`,{className:s(`${t}-description`,E?.content),style:D?.content},j))),x.createElement(`div`,{className:`${t}-buttons`},b&&x.createElement(_,{size:`small`,...i,onClick:M},u||k?.cancelText),x.createElement(h,{buttonProps:{size:`small`,...g(p),...r},actionFn:C,close:S,prefixCls:O(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},f||k?.okText)))},w=e=>{let{prefixCls:t,placement:r,className:i,style:a,...o}=e,{getPrefixCls:c}=x.useContext(n),l=c(`popconfirm`,t);return S(l),x.createElement(b,{placement:r,className:s(l,i),style:a,content:x.createElement(C,{prefixCls:l,...o})})},T=x.forwardRef((e,n)=>{let{prefixCls:o,placement:c=`top`,trigger:l,okType:u=`primary`,icon:d=x.createElement(m,null),children:h,overlayClassName:g,onOpenChange:_,overlayStyle:v,styles:b,arrow:w,classNames:T,disabled:E=!1,mouseEnterDelay:D,mouseLeaveDelay:O,...k}=e,{getPrefixCls:A,className:j,style:M,classNames:N,styles:P,arrow:F,trigger:I,mouseEnterDelay:L,mouseLeaveDelay:R}=a(`popconfirm`),[z,B]=i(e.defaultOpen??!1,e.open),V=p(w,F),H=l||I||`click`,U=D??L??.1,W=O??R??.1,G=e=>{B(e),_?.(e)},K=()=>{G(!1)},q=t=>e.onConfirm?.call(void 0,t),J=t=>{G(!1),e.onCancel?.call(void 0,t)},Y=e=>{E||G(e)},X=A(`popconfirm`,o),Z={...e,placement:c,trigger:H,okType:u,overlayStyle:v,styles:b,classNames:T,mouseEnterDelay:U,mouseLeaveDelay:W},ee=f(M),te=f(v),[Q,$]=r([N,T],[P,ee,b,te],{props:Z}),ne=s(X,j,g,Q.root);return S(X),x.createElement(y,{arrow:V,...t(k,[`title`]),trigger:H,placement:c,onOpenChange:Y,open:z,ref:n,mouseEnterDelay:U,mouseLeaveDelay:W,classNames:{root:ne,container:Q.container,arrow:Q.arrow},styles:{root:$.root,container:$.container,arrow:$.arrow},content:x.createElement(C,{okType:u,icon:d,...e,onPopupClick:void 0,prefixCls:X,close:K,onConfirm:q,onCancel:J,classNames:Q,styles:$}),"data-popover-inject":!0},h)});T._InternalPanelDoNotUseOrYouWillBeFired=w;export{T as t};
+1
View File
@@ -0,0 +1 @@
import{o as e}from"./request-xrnk7ZJV.js";import{$n as t,Bn as n,Ct as r,Er as i,Hn as a,Pr as o,Wn as s,ht as c,pt as l,qt as u,rr as d,wt as f}from"./jsx-runtime-OfKoVykY.js";import{i as p}from"./tooltip-DI_m69zk.js";import{t as m}from"./ExclamationCircleFilled-Cqa4L7Rp.js";import{v as h}from"./useModal-Df03h-2u.js";import{a as g,n as _}from"./button-DsOd0cni.js";import{Gt as v,Ut as y,Wt as b}from"./index-Cf1llsZx.js";var x=e(o()),S=u(`Popconfirm`,e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:a,colorWarning:o,marginXXS:s,marginXS:c,fontSize:l,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:l},[`${t}-message`]:{marginBottom:c,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon`]:{color:o},[`> ${t}-message-icon ${n}`]:{fontSize:l,lineHeight:1,marginInlineEnd:c},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:400}},[`${t}-description`]:{marginTop:s,color:a}},[`${t}-buttons`]:{textAlign:`end`,whiteSpace:`nowrap`,button:{marginInlineStart:c}}}}},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),C=e=>{let{prefixCls:t,okButtonProps:r,cancelButtonProps:i,title:a,description:o,cancelText:u,okText:f,okType:p=`primary`,icon:y=x.createElement(m,null),showCancel:b=!0,close:S,onConfirm:C,onCancel:w,onPopupClick:T,classNames:E,styles:D}=e,{getPrefixCls:O}=x.useContext(n),[k]=l(`Popconfirm`,c.Popconfirm),A=v(a),j=v(o),M=e=>{w?.(e),i?.onClick?.(e)};return x.createElement(`div`,{className:`${t}-inner-content`,onClick:T},x.createElement(`div`,{className:`${t}-message`},y&&x.createElement(`span`,{className:s(`${t}-message-icon`,E?.icon),style:D?.icon},y),x.createElement(`div`,{className:`${t}-message-text`},d(A)&&x.createElement(`div`,{className:s(`${t}-title`,E?.title),style:D?.title},A),d(j)&&x.createElement(`div`,{className:s(`${t}-description`,E?.content),style:D?.content},j))),x.createElement(`div`,{className:`${t}-buttons`},b&&x.createElement(_,{size:`small`,...i,onClick:M},u||k?.cancelText),x.createElement(h,{buttonProps:{size:`small`,...g(p),...r},actionFn:C,close:S,prefixCls:O(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},f||k?.okText)))},w=e=>{let{prefixCls:t,placement:r,className:i,style:a,...o}=e,{getPrefixCls:c}=x.useContext(n),l=c(`popconfirm`,t);return S(l),x.createElement(b,{placement:r,className:s(l,i),style:a,content:x.createElement(C,{prefixCls:l,...o})})},T=x.forwardRef((e,n)=>{let{prefixCls:o,placement:c=`top`,trigger:l,okType:u=`primary`,icon:d=x.createElement(m,null),children:h,overlayClassName:g,onOpenChange:_,overlayStyle:v,styles:b,arrow:w,classNames:T,disabled:E=!1,mouseEnterDelay:D,mouseLeaveDelay:O,...k}=e,{getPrefixCls:A,className:j,style:M,classNames:N,styles:P,arrow:F,trigger:I,mouseEnterDelay:L,mouseLeaveDelay:R}=a(`popconfirm`),[z,B]=i(e.defaultOpen??!1,e.open),V=p(w,F),H=l||I||`click`,U=D??L??.1,W=O??R??.1,G=e=>{B(e),_?.(e)},K=()=>{G(!1)},q=t=>e.onConfirm?.call(void 0,t),J=t=>{G(!1),e.onCancel?.call(void 0,t)},Y=e=>{E||G(e)},X=A(`popconfirm`,o),Z={...e,placement:c,trigger:H,okType:u,overlayStyle:v,styles:b,classNames:T,mouseEnterDelay:U,mouseLeaveDelay:W},ee=f(M),te=f(v),[Q,$]=r([N,T],[P,ee,b,te],{props:Z}),ne=s(X,j,g,Q.root);return S(X),x.createElement(y,{arrow:V,...t(k,[`title`]),trigger:H,placement:c,onOpenChange:Y,open:z,ref:n,mouseEnterDelay:U,mouseLeaveDelay:W,classNames:{root:ne,container:Q.container,arrow:Q.arrow},styles:{root:$.root,container:$.container,arrow:$.arrow},content:x.createElement(C,{okType:u,icon:d,...e,onPopupClick:void 0,prefixCls:X,close:K,onConfirm:q,onCancel:J,classNames:Q,styles:$}),"data-popover-inject":!0},h)});T._InternalPanelDoNotUseOrYouWillBeFired=w;export{T as t};
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"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-B23_bhQM.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-B8iT02Iv.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};
+1
View File
@@ -0,0 +1 @@
import"./request-xrnk7ZJV.js";import{Pr as e,t}from"./jsx-runtime-OfKoVykY.js";import{t as n}from"./typography-C81dpVAv.js";import{t as r}from"./image-D2CF6Ecw.js";import{t as i}from"./tag-CY8tAhzO.js";import{t as a}from"./XinTable-1TzMt4Ci.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
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
View File
@@ -0,0 +1 @@
import{t as e}from"./jsx-runtime-OfKoVykY.js";import{t}from"./space-JYtHxLjg.js";import{t as n}from"./button-DsOd0cni.js";import{t as r}from"./card-C-jMUkpS.js";import{n as i,t as a}from"./row-DM2jDy-f.js";import{Vt as o}from"./index-DLqXr84t.js";var s=e(),c=()=>(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(r,{style:{marginBottom:16},children:[(0,s.jsx)(o,{items:[{title:`多级菜单`},{title:`二级菜单`},{title:`三级页面`}]}),(0,s.jsx)(`h2`,{style:{marginTop:16,marginBottom:0},children:`三级页面`})]}),(0,s.jsxs)(a,{gutter:[16,16],children:[(0,s.jsx)(i,{span:24,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:16,children:(0,s.jsx)(r,{style:{height:200}})}),(0,s.jsx)(i,{span:8,children:(0,s.jsx)(r,{style:{height:200}})})]}),(0,s.jsx)(r,{style:{marginTop:16},children:(0,s.jsxs)(t,{children:[(0,s.jsx)(n,{children:`重置`}),(0,s.jsx)(n,{type:`primary`,children:`提交`})]})})]});export{c as default};

Some files were not shown because too many files have changed in this diff Show More