1 line
3.3 KiB
JavaScript
1 line
3.3 KiB
JavaScript
import{t as e}from"./tag-Bn-IyYw0.js";import{Ca as t,Ea as n,c as r,hn as i,rt as a,s as o,t as s}from"./index-DThTpSPU.js";import{t as c}from"./XinTable-D_6_7i3V.js";t();var l=n(i(),1),u=n(s(),1),d=o(),{Title:f,Text:p}=a;l.default.extend(u.default);var m=()=>{let{t}=r(),n={api:`/merchant-portal/product`,columns:[{title:t(`merchant.portal.product.id`),dataIndex:`id`,hideInForm:!0,sorter:!0,align:`center`,width:80},{title:t(`merchant.portal.product.name`),dataIndex:`name`,valueType:`text`,align:`center`,required:!0,rules:[{required:!0,message:t(`merchant.portal.product.name.required`)}]},{title:t(`merchant.portal.product.category_id`),dataIndex:`category_id`,valueType:`text`,align:`center`},{title:t(`merchant.portal.product.price`),dataIndex:`price`,valueType:`text`,align:`center`,render:e=>`¥${e||`0.00`}`},{title:t(`merchant.portal.product.original_price`),dataIndex:`original_price`,valueType:`text`,align:`center`,hideInSearch:!0,render:e=>e?`¥${e}`:`-`},{title:t(`merchant.portal.product.stock`),dataIndex:`stock`,valueType:`text`,align:`center`,hideInSearch:!0},{title:t(`merchant.portal.product.sales`),dataIndex:`sales`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:t(`merchant.portal.product.unit`),dataIndex:`unit`,valueType:`text`,align:`center`,hideInSearch:!0},{title:t(`merchant.portal.product.description`),dataIndex:`description`,valueType:`text`,hideInTable:!0,hideInSearch:!0},{title:t(`merchant.portal.product.status`),dataIndex:`status`,valueType:`radioButton`,fieldProps:{options:[{value:0,label:t(`merchant.portal.product.status.0`)},{value:1,label:t(`merchant.portal.product.status.1`)}]},render:n=>n===1?(0,d.jsx)(e,{color:`success`,children:t(`merchant.portal.product.status.1`)}):(0,d.jsx)(e,{color:`default`,children:t(`merchant.portal.product.status.0`)}),filters:[{text:t(`merchant.portal.product.status.0`),value:0},{text:t(`merchant.portal.product.status.1`),value:1}],align:`center`},{title:t(`merchant.portal.product.is_recommend`),dataIndex:`is_recommend`,valueType:`radioButton`,fieldProps:{options:[{value:0,label:t(`merchant.portal.product.is_recommend.0`)},{value:1,label:t(`merchant.portal.product.is_recommend.1`)}]},render:n=>n===1?(0,d.jsx)(e,{color:`orange`,children:t(`merchant.portal.product.is_recommend.1`)}):(0,d.jsx)(e,{children:t(`merchant.portal.product.is_recommend.0`)}),align:`center`},{title:t(`merchant.portal.product.sort`),dataIndex:`sort`,valueType:`text`,align:`center`,hideInSearch:!0},{title:t(`merchant.portal.product.created_at`),hideInForm:!0,hideInSearch:!0,dataIndex:`created_at`,align:`center`,render:e=>e?(0,l.default)(e).fromNow():`-`},{title:t(`merchant.portal.product.updated_at`),hideInForm:!0,hideInSearch:!0,dataIndex:`updated_at`,align:`center`,render:e=>e?(0,l.default)(e).fromNow():`-`}],rowKey:`id`,accessName:`merchant.portal.product`,scroll:{x:1400},formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:[30,0]},layout:`vertical`},modalProps:{width:800},cardProps:{variant:`borderless`},pagination:{size:`small`,style:{marginBottom:0}}};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`mb-5`,children:[(0,d.jsx)(f,{level:3,children:t(`merchant.portal.product.page.title`)}),(0,d.jsx)(p,{type:`secondary`,children:t(`merchant.portal.product.page.description`)})]}),(0,d.jsx)(c,{...n})]})};export{m as default}; |