feat: expand inquiry fields and list
This commit is contained in:
1 parent
4d1aba4888
commit
3fdec5a549
18 files changed
+87
-52
No files matched your search
+6
-25
@@ -49,6 +49,9 @@ type Item = {
|
||||
customerName?: string;
|
||||
customerEmail?: string;
|
||||
companyName?: string;
|
||||
countryCode?: string;
|
||||
clientIp?: string;
|
||||
sourceType?: string;
|
||||
statusLabel?: string;
|
||||
createTime?: string;
|
||||
};
|
||||
@@ -344,13 +347,9 @@ function App() {
|
||||
{error}。请先启动 Admin 后端,并初始化本地站点数据。
|
||||
</div>
|
||||
)}
|
||||
<section className="table">
|
||||
<section className={`table ${section === "inquiries" ? "inquiry-table" : ""}`}>
|
||||
<div className="thead">
|
||||
<span>{section === "inquiries" ? "客户" : "名称"}</span>
|
||||
<span>{section === "inquiries" ? "公司 / 来源" : "英文路径"}</span>
|
||||
<span>状态</span>
|
||||
<span>{section === "inquiries" ? "提交时间" : "发布时间"}</span>
|
||||
<span>操作</span>
|
||||
{section === "inquiries" ? <><span>公司名称</span><span>电子邮箱</span><span>国家 / IP地址</span><span>询盘时间</span><span>询盘来源</span><span>状态</span><span>操作</span></> : <><span>名称</span><span>英文路径</span><span>状态</span><span>发布时间</span><span>操作</span></>}
|
||||
</div>
|
||||
{filtered.length === 0 && !error ? (
|
||||
<div className="empty">
|
||||
@@ -365,25 +364,7 @@ function App() {
|
||||
item.productCode || item.contentCode || item.pageCode || item.inquiryCode || index
|
||||
}
|
||||
>
|
||||
<span>
|
||||
<strong>
|
||||
{item.productName || item.title || item.pageName || item.customerName}
|
||||
</strong>
|
||||
<small>
|
||||
{item.model ||
|
||||
item.productCode ||
|
||||
item.contentCode ||
|
||||
item.pageCode || item.customerEmail}
|
||||
</small>
|
||||
</span>
|
||||
<code>{section === "inquiries" ? (item.companyName || "Direct inquiry") : `/${item.slug}`}</code>
|
||||
<span className={`status ${item.status.toLowerCase()}`}>
|
||||
{item.statusLabel || statusLabels[item.status] || item.status}
|
||||
</span>
|
||||
<span>
|
||||
{(item.publishTime || item.createTime)?.replace("T", " ").slice(0, 16) || "--"}
|
||||
</span>
|
||||
<div className="row-actions">{["products", "NEWS", "CASE", "HELP"].includes(section) && item.slug && <a className="link" href={`${SITE_WEB}/${section === "products" ? "products" : section === "CASE" ? "cases" : section === "NEWS" ? "news" : "help"}/${encodeURIComponent(item.slug)}`} target="_blank" rel="noreferrer">查看前台</a>}<button className="link" onClick={() => section === "products" && item.productCode ? openProductEditor(item.productCode) : ["NEWS", "CASE", "HELP"].includes(section) && item.contentCode ? openContentEditor(section as EditorialSection, item.contentCode) : section === "pages" && item.pageCode ? openPageEditor(item.pageCode) : undefined}>{section === "inquiries" ? "查看" : "编辑"}</button>{["products", "NEWS", "CASE", "HELP"].includes(section) && <><button className="link" onClick={() => void changeItemStatus(item)}>{item.status === "PUBLISHED" ? "下架" : "上架"}</button><button className="link danger" onClick={() => void deleteItem(item)}>删除</button></>}</div>
|
||||
{section === "inquiries" ? <><span><strong>{item.companyName || item.customerName || "--"}</strong><small>{item.customerName || "--"}</small></span><span>{item.customerEmail || "--"}</span><span>{item.countryCode || "未知"}({item.clientIp || "--"})</span><span>{item.createTime?.replace("T", " ").slice(0, 16) || "--"}</span><span>{item.productName || item.sourceType || "网站询盘"}</span><span className={`status ${item.status.toLowerCase()}`}>{item.statusLabel || item.status}</span><div className="row-actions"><button className="link">查看</button></div></> : <><span><strong>{item.productName || item.title || item.pageName}</strong><small>{item.model || item.productCode || item.contentCode || item.pageCode}</small></span><code>/{item.slug}</code><span className={`status ${item.status.toLowerCase()}`}>{statusLabels[item.status] || item.status}</span><span>{item.publishTime?.replace("T", " ").slice(0, 16) || "--"}</span><div className="row-actions">{["products", "NEWS", "CASE", "HELP"].includes(section) && item.slug && <a className="link" href={`${SITE_WEB}/${section === "products" ? "products" : section === "CASE" ? "cases" : section === "NEWS" ? "news" : "help"}/${encodeURIComponent(item.slug)}`} target="_blank" rel="noreferrer">查看前台</a>}<button className="link" onClick={() => section === "products" && item.productCode ? openProductEditor(item.productCode) : ["NEWS", "CASE", "HELP"].includes(section) && item.contentCode ? openContentEditor(section as EditorialSection, item.contentCode) : section === "pages" && item.pageCode ? openPageEditor(item.pageCode) : undefined}>编辑</button>{["products", "NEWS", "CASE", "HELP"].includes(section) && <><button className="link" onClick={() => void changeItemStatus(item)}>{item.status === "PUBLISHED" ? "下架" : "上架"}</button><button className="link danger" onClick={() => void deleteItem(item)}>删除</button></>}</div></>}
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user