功能迭代
This commit is contained in:
1 parent
617371be3e
commit
8e03c99cab
16 files changed
+1245
-21
No files matched your search
@@ -25,7 +25,8 @@ public class AdminContentFacade {
|
|||||||
return service.detail(request.siteCode(), request.contentCode(), request.contentType().name());
|
return service.detail(request.siteCode(), request.contentCode(), request.contentType().name());
|
||||||
}
|
}
|
||||||
/** 查询内容列表。 */ public ContentListAdminRes list(ContentListAdminReq request) {
|
/** 查询内容列表。 */ public ContentListAdminRes list(ContentListAdminReq request) {
|
||||||
return new ContentListAdminRes(service.list(request.siteCode(), request.contentType().name()));
|
return new ContentListAdminRes(service.list(request.siteCode(), request.contentType().name(),
|
||||||
|
request.primaryCategoryCode(), request.status()));
|
||||||
}
|
}
|
||||||
/** 删除内容。 */ public CommonAdminRes delete(ContentOperationAdminReq request) { service.delete(request.siteCode(), request.contentCode(), request.contentType().name()); return CommonAdminRes.success(); }
|
/** 删除内容。 */ public CommonAdminRes delete(ContentOperationAdminReq request) { service.delete(request.siteCode(), request.contentCode(), request.contentType().name()); return CommonAdminRes.success(); }
|
||||||
/** 变更内容发布状态。 */ public CommonAdminRes changeStatus(ContentStatusAdminReq request) { service.changeStatus(request); return CommonAdminRes.success(); }
|
/** 变更内容发布状态。 */ public CommonAdminRes changeStatus(ContentStatusAdminReq request) { service.changeStatus(request); return CommonAdminRes.success(); }
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ public class AdminProductFacade {
|
|||||||
/** 注入产品业务。 */ public AdminProductFacade(AdminProductService service) { this.service = service; }
|
/** 注入产品业务。 */ public AdminProductFacade(AdminProductService service) { this.service = service; }
|
||||||
/** 保存产品。 */ public ProductSaveAdminRes save(SaveProductAdminReq request) { return new ProductSaveAdminRes(service.save(request), "SUCCESS", "操作成功"); }
|
/** 保存产品。 */ public ProductSaveAdminRes save(SaveProductAdminReq request) { return new ProductSaveAdminRes(service.save(request), "SUCCESS", "操作成功"); }
|
||||||
/** 查询产品编辑详情。 */ public ProductDetailAdminRes detail(ProductDetailAdminReq request) { return service.detail(request.siteCode(), request.productCode()); }
|
/** 查询产品编辑详情。 */ public ProductDetailAdminRes detail(ProductDetailAdminReq request) { return service.detail(request.siteCode(), request.productCode()); }
|
||||||
/** 查询产品列表。 */ public ProductListAdminRes list(ProductListAdminReq request) { return new ProductListAdminRes(service.list(request.siteCode())); }
|
/** 查询产品列表。 */ public ProductListAdminRes list(ProductListAdminReq request) {
|
||||||
|
return new ProductListAdminRes(service.list(request.siteCode(), request.primaryCategoryCode(), request.status()));
|
||||||
|
}
|
||||||
/** 删除产品。 */ public CommonAdminRes delete(ProductOperationAdminReq request) { service.delete(request.siteCode(), request.productCode()); return CommonAdminRes.success(); }
|
/** 删除产品。 */ public CommonAdminRes delete(ProductOperationAdminReq request) { service.delete(request.siteCode(), request.productCode()); return CommonAdminRes.success(); }
|
||||||
/** 变更产品发布状态。 */ public CommonAdminRes changeStatus(ProductStatusAdminReq request) { service.changeStatus(request); return CommonAdminRes.success(); }
|
/** 变更产品发布状态。 */ public CommonAdminRes changeStatus(ProductStatusAdminReq request) { service.changeStatus(request); return CommonAdminRes.success(); }
|
||||||
/** 保存产品分类。 */ public CommonAdminRes saveCategory(SaveProductCategoryAdminReq request) { service.saveCategory(request); return CommonAdminRes.success(); }
|
/** 保存产品分类。 */ public CommonAdminRes saveCategory(SaveProductCategoryAdminReq request) { service.saveCategory(request); return CommonAdminRes.success(); }
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
package com.shoplix.admin.modules.content.req;
|
package com.shoplix.admin.modules.content.req;
|
||||||
|
|
||||||
import com.shoplix.modules.content.enums.ContentTypeEnum;
|
import com.shoplix.modules.content.enums.ContentTypeEnum;
|
||||||
|
import com.shoplix.modules.common.enums.PublishStatusEnum;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
|
||||||
/** 运营后台内容列表请求。 */
|
/** 运营后台内容列表请求。 */
|
||||||
public record ContentListAdminReq(@NotBlank String siteCode, @NotNull ContentTypeEnum contentType) {
|
public record ContentListAdminReq(
|
||||||
|
/** 所属站点业务编号。 */ @NotBlank String siteCode,
|
||||||
|
/** 内容类型。 */ @NotNull ContentTypeEnum contentType,
|
||||||
|
/** 内容分类业务编号,为空时查询全部分类。 */ @Size(max = 16) String primaryCategoryCode,
|
||||||
|
/** 发布状态,为空时查询全部状态。 */ PublishStatusEnum status) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,8 +2,16 @@ package com.shoplix.admin.modules.content.res;
|
|||||||
|
|
||||||
|
|
||||||
/** 运营后台内容列表项响应。 */
|
/** 运营后台内容列表项响应。 */
|
||||||
public record ContentItemAdminRes(String contentCode, String contentType, String title, String slug,
|
public record ContentItemAdminRes(
|
||||||
String primaryCategoryCode, String status, Boolean featured,
|
/** 内容业务编号。 */ String contentCode,
|
||||||
Long publishTime) {
|
/** 内容类型。 */ String contentType,
|
||||||
|
/** 内容英文标题。 */ String title,
|
||||||
|
/** 内容英文路径。 */ String slug,
|
||||||
|
/** 主分类业务编号。 */ String primaryCategoryCode,
|
||||||
|
/** 主分类英文名称。 */ String primaryCategoryName,
|
||||||
|
/** 封面图片访问地址。 */ String coverMediaUrl,
|
||||||
|
/** 发布状态。 */ String status,
|
||||||
|
/** 是否推荐。 */ Boolean featured,
|
||||||
|
/** 发布时间戳。 */ Long publishTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.shoplix.admin.modules.product.req;
|
package com.shoplix.admin.modules.product.req;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
|
||||||
/** 运营后台产品列表请求。 */
|
/** 运营后台产品列表请求。 */
|
||||||
public record ProductListAdminReq(@NotBlank String siteCode) {
|
public record ProductListAdminReq(
|
||||||
|
/** 所属站点业务编号。 */ @NotBlank String siteCode,
|
||||||
|
/** 产品分类业务编号,为空时查询全部分类。 */ @Size(max = 16) String primaryCategoryCode,
|
||||||
|
/** 发布状态,为空时查询全部状态。 */ com.shoplix.modules.common.enums.PublishStatusEnum status) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,8 +2,17 @@ package com.shoplix.admin.modules.product.res;
|
|||||||
|
|
||||||
|
|
||||||
/** 运营后台产品列表项响应。 */
|
/** 运营后台产品列表项响应。 */
|
||||||
public record ProductItemAdminRes(String productCode, String productName, String slug, String model,
|
public record ProductItemAdminRes(
|
||||||
String primaryCategoryCode, String status, Boolean featured,
|
/** 产品业务编号。 */ String productCode,
|
||||||
Boolean inquiryEnabled, Long publishTime) {
|
/** 产品英文名称。 */ String productName,
|
||||||
|
/** 产品英文路径。 */ String slug,
|
||||||
|
/** 产品型号。 */ String model,
|
||||||
|
/** 主分类业务编号。 */ String primaryCategoryCode,
|
||||||
|
/** 主分类英文名称。 */ String primaryCategoryName,
|
||||||
|
/** 封面图片访问地址。 */ String coverMediaUrl,
|
||||||
|
/** 发布状态。 */ String status,
|
||||||
|
/** 是否推荐。 */ Boolean featured,
|
||||||
|
/** 是否启用询盘。 */ Boolean inquiryEnabled,
|
||||||
|
/** 发布时间戳。 */ Long publishTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,10 +14,14 @@ import com.shoplix.modules.content.repository.entity.ContentCategoryEntity;
|
|||||||
import com.shoplix.modules.content.repository.service.ContentRepositoryService;
|
import com.shoplix.modules.content.repository.service.ContentRepositoryService;
|
||||||
import com.shoplix.modules.content.repository.service.ContentCategoryRepositoryService;
|
import com.shoplix.modules.content.repository.service.ContentCategoryRepositoryService;
|
||||||
import com.shoplix.modules.media.repository.service.MediaAssetRepositoryService;
|
import com.shoplix.modules.media.repository.service.MediaAssetRepositoryService;
|
||||||
|
import com.shoplix.modules.common.enums.PublishStatusEnum;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/** 运营后台新闻、案例和帮助业务。 */
|
/** 运营后台新闻、案例和帮助业务。 */
|
||||||
@Service
|
@Service
|
||||||
@@ -68,10 +72,25 @@ public class AdminContentService {
|
|||||||
entity.getSortNo(), entity.getStatus(), entity.getPublishTime());
|
entity.getSortNo(), entity.getStatus(), entity.getPublishTime());
|
||||||
}
|
}
|
||||||
/** 查询指定类型内容。 */
|
/** 查询指定类型内容。 */
|
||||||
public List<ContentItemAdminRes> list(String siteCode, String type) {
|
public List<ContentItemAdminRes> list(String siteCode, String type, String primaryCategoryCode,
|
||||||
return repository.list(siteCode, type).stream().map(item -> new ContentItemAdminRes(item.getContentCode(),
|
PublishStatusEnum status) {
|
||||||
item.getContentType(), item.getTitle(), item.getSlug(), item.getPrimaryCategoryCode(), item.getStatus(),
|
Map<String, ContentCategoryEntity> categoryMap = categoryRepository.list(siteCode, type, false).stream()
|
||||||
item.getFeaturedFlag() != null && item.getFeaturedFlag() == 1, item.getPublishTime())).toList();
|
.collect(Collectors.toMap(ContentCategoryEntity::getCategoryCode, Function.identity()));
|
||||||
|
Map<String, String> mediaUrlMap = mediaRepository.list(siteCode, null).stream()
|
||||||
|
.collect(Collectors.toMap(media -> media.getMediaCode(), media -> media.getRelativeUrl(),
|
||||||
|
(first, ignored) -> first));
|
||||||
|
return repository.list(siteCode, type).stream()
|
||||||
|
.filter(item -> primaryCategoryCode == null || primaryCategoryCode.isBlank()
|
||||||
|
|| primaryCategoryCode.equals(item.getPrimaryCategoryCode()))
|
||||||
|
.filter(item -> status == null || status.name().equals(item.getStatus()))
|
||||||
|
.map(item -> new ContentItemAdminRes(item.getContentCode(), item.getContentType(), item.getTitle(),
|
||||||
|
item.getSlug(), item.getPrimaryCategoryCode(), item.getPrimaryCategoryCode() == null
|
||||||
|
|| item.getPrimaryCategoryCode().isBlank() ? null
|
||||||
|
: java.util.Optional.ofNullable(categoryMap.get(item.getPrimaryCategoryCode()))
|
||||||
|
.map(ContentCategoryEntity::getCategoryName).orElse(null),
|
||||||
|
mediaUrlMap.get(item.getCoverMediaCode()),
|
||||||
|
item.getStatus(), item.getFeaturedFlag() != null && item.getFeaturedFlag() == 1,
|
||||||
|
item.getPublishTime())).toList();
|
||||||
}
|
}
|
||||||
/** 逻辑删除指定类型内容。 */
|
/** 逻辑删除指定类型内容。 */
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.shoplix.modules.product.repository.entity.ProductAttributeValueEntity
|
|||||||
import com.shoplix.modules.product.repository.entity.ProductMediaRelationEntity;
|
import com.shoplix.modules.product.repository.entity.ProductMediaRelationEntity;
|
||||||
import com.shoplix.modules.product.repository.entity.ProductContentTemplateEntity;
|
import com.shoplix.modules.product.repository.entity.ProductContentTemplateEntity;
|
||||||
import com.shoplix.modules.product.enums.ProductTemplatePositionEnum;
|
import com.shoplix.modules.product.enums.ProductTemplatePositionEnum;
|
||||||
|
import com.shoplix.modules.common.enums.PublishStatusEnum;
|
||||||
import com.shoplix.modules.media.repository.service.MediaAssetRepositoryService;
|
import com.shoplix.modules.media.repository.service.MediaAssetRepositoryService;
|
||||||
import com.shoplix.modules.product.repository.service.ProductRepositoryService;
|
import com.shoplix.modules.product.repository.service.ProductRepositoryService;
|
||||||
import com.shoplix.modules.product.repository.service.ProductCategoryRepositoryService;
|
import com.shoplix.modules.product.repository.service.ProductCategoryRepositoryService;
|
||||||
@@ -36,6 +37,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/** 运营后台 B2B 产品业务。 */
|
/** 运营后台 B2B 产品业务。 */
|
||||||
@Service
|
@Service
|
||||||
@@ -148,10 +152,24 @@ public class AdminProductService {
|
|||||||
return new ProductDetailAdminRes(item.getProductCode(), item.getPrimaryCategoryCode(), item.getProductName(), item.getSlug(), item.getModel(), item.getSummary(), item.getProductContent(), item.getContentTemplateCode(), item.getTemplatePosition(), item.getCoverMediaCode(), mediaUrl, images, item.getFeaturedFlag() == 1, item.getInquiryEnabled() == 1, item.getSortNo(), item.getStatus(), attributes, specifications);
|
return new ProductDetailAdminRes(item.getProductCode(), item.getPrimaryCategoryCode(), item.getProductName(), item.getSlug(), item.getModel(), item.getSummary(), item.getProductContent(), item.getContentTemplateCode(), item.getTemplatePosition(), item.getCoverMediaCode(), mediaUrl, images, item.getFeaturedFlag() == 1, item.getInquiryEnabled() == 1, item.getSortNo(), item.getStatus(), attributes, specifications);
|
||||||
}
|
}
|
||||||
/** 查询后台产品列表。 */
|
/** 查询后台产品列表。 */
|
||||||
public List<ProductItemAdminRes> list(String siteCode) {
|
public List<ProductItemAdminRes> list(String siteCode, String primaryCategoryCode, PublishStatusEnum status) {
|
||||||
return repository.list(siteCode).stream().map(item -> new ProductItemAdminRes(item.getProductCode(), item.getProductName(),
|
Map<String, ProductCategoryEntity> categoryMap = categoryRepository.list(siteCode, false).stream()
|
||||||
item.getSlug(), item.getModel(), item.getPrimaryCategoryCode(), item.getStatus(), item.getFeaturedFlag() == 1,
|
.collect(Collectors.toMap(ProductCategoryEntity::getCategoryCode, Function.identity()));
|
||||||
item.getInquiryEnabled() == 1, item.getPublishTime())).toList();
|
Map<String, String> mediaUrlMap = mediaRepository.list(siteCode, null).stream()
|
||||||
|
.collect(Collectors.toMap(media -> media.getMediaCode(), media -> media.getRelativeUrl(),
|
||||||
|
(first, ignored) -> first));
|
||||||
|
return repository.list(siteCode).stream()
|
||||||
|
.filter(item -> primaryCategoryCode == null || primaryCategoryCode.isBlank()
|
||||||
|
|| primaryCategoryCode.equals(item.getPrimaryCategoryCode()))
|
||||||
|
.filter(item -> status == null || status.name().equals(item.getStatus()))
|
||||||
|
.map(item -> new ProductItemAdminRes(item.getProductCode(), item.getProductName(), item.getSlug(),
|
||||||
|
item.getModel(), item.getPrimaryCategoryCode(), item.getPrimaryCategoryCode() == null
|
||||||
|
|| item.getPrimaryCategoryCode().isBlank() ? null
|
||||||
|
: java.util.Optional.ofNullable(categoryMap.get(item.getPrimaryCategoryCode()))
|
||||||
|
.map(ProductCategoryEntity::getCategoryName).orElse(null),
|
||||||
|
mediaUrlMap.get(item.getCoverMediaCode()),
|
||||||
|
item.getStatus(), item.getFeaturedFlag() == 1, item.getInquiryEnabled() == 1,
|
||||||
|
item.getPublishTime())).toList();
|
||||||
}
|
}
|
||||||
/** 逻辑删除产品。 */
|
/** 逻辑删除产品。 */
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
@@ -0,0 +1,295 @@
|
|||||||
|
{
|
||||||
|
"uploaded": 58,
|
||||||
|
"replaced": [
|
||||||
|
{
|
||||||
|
"model": "HY-001",
|
||||||
|
"oldProductCode": "PRD0089C84IX6CXS",
|
||||||
|
"newProductCode": "PRD0089DZPF218N4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-002",
|
||||||
|
"oldProductCode": "PRD0089C859N7R40",
|
||||||
|
"newProductCode": "PRD0089DZQELU7SW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-003",
|
||||||
|
"oldProductCode": "PRD0089C85XVCSU8",
|
||||||
|
"newProductCode": "PRD0089DZRFPTWQO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-004",
|
||||||
|
"oldProductCode": "PRD0089C86LSVS3K",
|
||||||
|
"newProductCode": "PRD0089DZSI4N75S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-005",
|
||||||
|
"oldProductCode": "PRD0089C87AJ4LC0",
|
||||||
|
"newProductCode": "PRD0089DZTMI04CG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-006",
|
||||||
|
"oldProductCode": "PRD0089C880VFJLS",
|
||||||
|
"newProductCode": "PRD0089DZURUY3GG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-007",
|
||||||
|
"oldProductCode": "PRD0089C88YYSNI8",
|
||||||
|
"newProductCode": "PRD0089DZVW3B7Y8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-008",
|
||||||
|
"oldProductCode": "PRD0089C89MJU51C",
|
||||||
|
"newProductCode": "PRD0089DZX0J61HC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-009",
|
||||||
|
"oldProductCode": "PRD0089C8AAKHHQ8",
|
||||||
|
"newProductCode": "PRD0089DZY4GX3I8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-010",
|
||||||
|
"oldProductCode": "PRD0089C8AZGZ1TS",
|
||||||
|
"newProductCode": "PRD0089DZZ5KABCW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-011",
|
||||||
|
"oldProductCode": "PRD0089C8BL27YF4",
|
||||||
|
"newProductCode": "PRD0089E006D1GQO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-012",
|
||||||
|
"oldProductCode": "PRD0089C8C9PYVB4",
|
||||||
|
"newProductCode": "PRD0089E0167GIDC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-013",
|
||||||
|
"oldProductCode": "PRD0089C8CWW0YRK",
|
||||||
|
"newProductCode": "PRD0089E024W1R7K"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-014",
|
||||||
|
"oldProductCode": "PRD0089C8DJWGSG0",
|
||||||
|
"newProductCode": "PRD0089E034XC0SG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-015",
|
||||||
|
"oldProductCode": "PRD0089C8E6HAQYO",
|
||||||
|
"newProductCode": "PRD0089E0452D4W0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-016",
|
||||||
|
"oldProductCode": "PRD0089C8ETKUY2O",
|
||||||
|
"newProductCode": "PRD0089E055Q4HKW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-017",
|
||||||
|
"oldProductCode": "PRD0089C8FG52FI8",
|
||||||
|
"newProductCode": "PRD0089E066NVFNK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-018",
|
||||||
|
"oldProductCode": "PRD0089C8G7RKI68",
|
||||||
|
"newProductCode": "PRD0089E076P5P8G"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-019",
|
||||||
|
"oldProductCode": "PRD0089C8GXME60W",
|
||||||
|
"newProductCode": "PRD0089E088N46BK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-020",
|
||||||
|
"oldProductCode": "PRD0089C8HIZIWHS",
|
||||||
|
"newProductCode": "PRD0089E09FXCU0W"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-021",
|
||||||
|
"oldProductCode": "PRD0089C8I5TPZB4",
|
||||||
|
"newProductCode": "PRD0089E0AHK2RK0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-022",
|
||||||
|
"oldProductCode": "PRD0089C8ISLF5S0",
|
||||||
|
"newProductCode": "PRD0089E0BHXUIV4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-023",
|
||||||
|
"oldProductCode": "PRD0089C8JH1ODMO",
|
||||||
|
"newProductCode": "PRD0089E0CK7O0LC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-024",
|
||||||
|
"oldProductCode": "PRD0089C8K59TFCW",
|
||||||
|
"newProductCode": "PRD0089E0DMXPUKG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-025",
|
||||||
|
"oldProductCode": "PRD0089C8KR86ARK",
|
||||||
|
"newProductCode": "PRD0089E0EYNS0E8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-026",
|
||||||
|
"oldProductCode": "PRD0089C8LEFHCE8",
|
||||||
|
"newProductCode": "PRD0089E0FX14POG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-027",
|
||||||
|
"oldProductCode": "PRD0089C8M21RS3K",
|
||||||
|
"newProductCode": "PRD0089E0GXY96O0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-028",
|
||||||
|
"oldProductCode": "PRD0089C8MOXUA68",
|
||||||
|
"newProductCode": "PRD0089E0HZ1MEIO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-029",
|
||||||
|
"oldProductCode": "PRD0089C8NC05J40",
|
||||||
|
"newProductCode": "PRD0089E0J13Y77K"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-030",
|
||||||
|
"oldProductCode": "PRD0089C8NZTB6RK",
|
||||||
|
"newProductCode": "PRD0089E0K61AB5S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-031",
|
||||||
|
"oldProductCode": "PRD0089C8ONZKT8G",
|
||||||
|
"newProductCode": "PRD0089E0L8Q36YO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-032",
|
||||||
|
"oldProductCode": "PRD0089C8PBQ8KJK",
|
||||||
|
"newProductCode": "PRD0089E0M8VQS5C"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-033",
|
||||||
|
"oldProductCode": "PRD0089C8PXFUSQO",
|
||||||
|
"newProductCode": "PRD0089E0N9ARHMO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-034",
|
||||||
|
"oldProductCode": "PRD0089C8QJAGTMO",
|
||||||
|
"newProductCode": "PRD0089E0O9MNTOG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-035",
|
||||||
|
"oldProductCode": "PRD0089C8R5OFK74",
|
||||||
|
"newProductCode": "PRD0089E0PO240ZK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-036",
|
||||||
|
"oldProductCode": "PRD0089C8RW38ETC",
|
||||||
|
"newProductCode": "PRD0089E0QPY72TC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-037",
|
||||||
|
"oldProductCode": "PRD0089C8SUNGC1S",
|
||||||
|
"newProductCode": "PRD0089E0RR2T8U8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-038",
|
||||||
|
"oldProductCode": "PRD0089C8TGEBIF4",
|
||||||
|
"newProductCode": "PRD0089E0SSEX3WG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-039",
|
||||||
|
"oldProductCode": "PRD0089C8U2A6HHC",
|
||||||
|
"newProductCode": "PRD0089E0TSWFPQ8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-040",
|
||||||
|
"oldProductCode": "PRD0089C8UPKLWJK",
|
||||||
|
"newProductCode": "PRD0089E0UVOZG1S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-041",
|
||||||
|
"oldProductCode": "PRD0089C8VDVVBPC",
|
||||||
|
"newProductCode": "PRD0089E0W1A1LA8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-042",
|
||||||
|
"oldProductCode": "PRD0089C8W1RIVPC",
|
||||||
|
"newProductCode": "PRD0089E0X3RCS1S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-043",
|
||||||
|
"oldProductCode": "PRD0089C8WQMRHMO",
|
||||||
|
"newProductCode": "PRD0089E0Y4XUDC0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-044",
|
||||||
|
"oldProductCode": "PRD0089C8XE5XJWG",
|
||||||
|
"newProductCode": "PRD0089E0Z5RUGW0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-045",
|
||||||
|
"oldProductCode": "PRD0089C8Y0QRIF4",
|
||||||
|
"newProductCode": "PRD0089E1080F0G0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-046",
|
||||||
|
"oldProductCode": "PRD0089C8YOOAHOG",
|
||||||
|
"newProductCode": "PRD0089E11AP7W8W"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-047",
|
||||||
|
"oldProductCode": "PRD0089C8ZB4R4LC",
|
||||||
|
"newProductCode": "PRD0089E12MHRYF4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-048",
|
||||||
|
"oldProductCode": "PRD0089C8ZXALP1C",
|
||||||
|
"newProductCode": "PRD0089E13JUANLS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-049",
|
||||||
|
"oldProductCode": "PRD0089C90L00I68",
|
||||||
|
"newProductCode": "PRD0089E14JAZ9C0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-050",
|
||||||
|
"oldProductCode": "PRD0089C916XQWHS",
|
||||||
|
"newProductCode": "PRD0089E15K83QBK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-051",
|
||||||
|
"oldProductCode": "PRD0089C91UDSLC0",
|
||||||
|
"newProductCode": "PRD0089E16MHX81S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-052",
|
||||||
|
"oldProductCode": "PRD0089C92FS69Z4",
|
||||||
|
"newProductCode": "PRD0089E17MKGFSW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-053",
|
||||||
|
"oldProductCode": "PRD0089C931RS3K0",
|
||||||
|
"newProductCode": "PRD0089E18N03MDC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-054",
|
||||||
|
"oldProductCode": "PRD0089C93NZI39C",
|
||||||
|
"newProductCode": "PRD0089E19MVRM68"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-055",
|
||||||
|
"oldProductCode": "PRD0089C94AMTY4G",
|
||||||
|
"newProductCode": "PRD0089E1AQN9XC0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-056",
|
||||||
|
"oldProductCode": "PRD0089C957WUQYO",
|
||||||
|
"newProductCode": "PRD0089E1BV3R7Y8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-057",
|
||||||
|
"oldProductCode": "PRD0089C95UC2FPC",
|
||||||
|
"newProductCode": "PRD0089E1DAU10QO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-058",
|
||||||
|
"oldProductCode": "PRD0089C96HSQLMO",
|
||||||
|
"newProductCode": "PRD0089E1ED4GZK0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
{
|
||||||
|
"created": [
|
||||||
|
{
|
||||||
|
"model": "HY-001",
|
||||||
|
"productCode": "PRD0089C84IX6CXS",
|
||||||
|
"mediaCode": "MED0089C84DON0U8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-002",
|
||||||
|
"productCode": "PRD0089C859N7R40",
|
||||||
|
"mediaCode": "MED0089C857TNX1C"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-003",
|
||||||
|
"productCode": "PRD0089C85XVCSU8",
|
||||||
|
"mediaCode": "MED0089C85VAC2YO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-004",
|
||||||
|
"productCode": "PRD0089C86LSVS3K",
|
||||||
|
"mediaCode": "MED0089C86JZYF40"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-005",
|
||||||
|
"productCode": "PRD0089C87AJ4LC0",
|
||||||
|
"mediaCode": "MED0089C878NPC00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-006",
|
||||||
|
"productCode": "PRD0089C880VFJLS",
|
||||||
|
"mediaCode": "MED0089C87ZB8TTS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-007",
|
||||||
|
"productCode": "PRD0089C88YYSNI8",
|
||||||
|
"mediaCode": "MED0089C88X3ZV9C"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-008",
|
||||||
|
"productCode": "PRD0089C89MJU51C",
|
||||||
|
"mediaCode": "MED0089C89KRJ94W"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-009",
|
||||||
|
"productCode": "PRD0089C8AAKHHQ8",
|
||||||
|
"mediaCode": "MED0089C8A8VAZ9C"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-010",
|
||||||
|
"productCode": "PRD0089C8AZGZ1TS",
|
||||||
|
"mediaCode": "MED0089C8AX42I2O"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-011",
|
||||||
|
"productCode": "PRD0089C8BL27YF4",
|
||||||
|
"mediaCode": "MED0089C8BIZXH4W"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-012",
|
||||||
|
"productCode": "PRD0089C8C9PYVB4",
|
||||||
|
"mediaCode": "MED0089C8C80SCU8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-013",
|
||||||
|
"productCode": "PRD0089C8CWW0YRK",
|
||||||
|
"mediaCode": "MED0089C8CV7GXDS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-014",
|
||||||
|
"productCode": "PRD0089C8DJWGSG0",
|
||||||
|
"mediaCode": "MED0089C8DHW1QF4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-015",
|
||||||
|
"productCode": "PRD0089C8E6HAQYO",
|
||||||
|
"mediaCode": "MED0089C8E4ODDZ4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-016",
|
||||||
|
"productCode": "PRD0089C8ETKUY2O",
|
||||||
|
"mediaCode": "MED0089C8ERHXZPC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-017",
|
||||||
|
"productCode": "PRD0089C8FG52FI8",
|
||||||
|
"mediaCode": "MED0089C8FEF9FY8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-018",
|
||||||
|
"productCode": "PRD0089C8G7RKI68",
|
||||||
|
"mediaCode": "MED0089C8G0PHC00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-019",
|
||||||
|
"productCode": "PRD0089C8GXME60W",
|
||||||
|
"mediaCode": "MED0089C8GW1KZ5S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-020",
|
||||||
|
"productCode": "PRD0089C8HIZIWHS",
|
||||||
|
"mediaCode": "MED0089C8HHHU328"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-021",
|
||||||
|
"productCode": "PRD0089C8I5TPZB4",
|
||||||
|
"mediaCode": "MED0089C8I3X1RSW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-022",
|
||||||
|
"productCode": "PRD0089C8ISLF5S0",
|
||||||
|
"mediaCode": "MED0089C8IQCVXMO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-023",
|
||||||
|
"productCode": "PRD0089C8JH1ODMO",
|
||||||
|
"mediaCode": "MED0089C8JE4660W"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-024",
|
||||||
|
"productCode": "PRD0089C8K59TFCW",
|
||||||
|
"mediaCode": "MED0089C8K3K0FSW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-025",
|
||||||
|
"productCode": "PRD0089C8KR86ARK",
|
||||||
|
"mediaCode": "MED0089C8KPIDB7K"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-026",
|
||||||
|
"productCode": "PRD0089C8LEFHCE8",
|
||||||
|
"mediaCode": "MED0089C8LCMJZEO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-027",
|
||||||
|
"productCode": "PRD0089C8M21RS3K",
|
||||||
|
"mediaCode": "MED0089C8M0GC45C"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-028",
|
||||||
|
"productCode": "PRD0089C8MOXUA68",
|
||||||
|
"mediaCode": "MED0089C8MN8NRPC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-029",
|
||||||
|
"productCode": "PRD0089C8NC05J40",
|
||||||
|
"mediaCode": "MED0089C8NACUFWG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-030",
|
||||||
|
"productCode": "PRD0089C8NZTB6RK",
|
||||||
|
"mediaCode": "MED0089C8NY5DMGW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-031",
|
||||||
|
"productCode": "PRD0089C8ONZKT8G",
|
||||||
|
"mediaCode": "MED0089C8OM95CLC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-032",
|
||||||
|
"productCode": "PRD0089C8PBQ8KJK",
|
||||||
|
"mediaCode": "MED0089C8PA46FI8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-033",
|
||||||
|
"productCode": "PRD0089C8PXFUSQO",
|
||||||
|
"mediaCode": "MED0089C8PVSJPJ4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-034",
|
||||||
|
"productCode": "PRD0089C8QJAGTMO",
|
||||||
|
"mediaCode": "MED0089C8QHGWZK0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-035",
|
||||||
|
"productCode": "PRD0089C8R5OFK74",
|
||||||
|
"mediaCode": "MED0089C8R3Z91Q8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-036",
|
||||||
|
"productCode": "PRD0089C8RW38ETC",
|
||||||
|
"mediaCode": "MED0089C8RUFAUIO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-037",
|
||||||
|
"productCode": "PRD0089C8SUNGC1S",
|
||||||
|
"mediaCode": "MED0089C8SOXFPJ4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-038",
|
||||||
|
"productCode": "PRD0089C8TGEBIF4",
|
||||||
|
"mediaCode": "MED0089C8TETIBK0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-039",
|
||||||
|
"productCode": "PRD0089C8U2A6HHC",
|
||||||
|
"mediaCode": "MED0089C8U0MVE9S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-040",
|
||||||
|
"productCode": "PRD0089C8UPKLWJK",
|
||||||
|
"mediaCode": "MED0089C8UNZSPOG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-041",
|
||||||
|
"productCode": "PRD0089C8VDVVBPC",
|
||||||
|
"mediaCode": "MED0089C8VBWP7UO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-042",
|
||||||
|
"productCode": "PRD0089C8W1RIVPC",
|
||||||
|
"mediaCode": "MED0089C8W05GQO0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-043",
|
||||||
|
"productCode": "PRD0089C8WQMRHMO",
|
||||||
|
"mediaCode": "MED0089C8WOUGLQ8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-044",
|
||||||
|
"productCode": "PRD0089C8XE5XJWG",
|
||||||
|
"mediaCode": "MED0089C8XCIMGOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-045",
|
||||||
|
"productCode": "PRD0089C8Y0QRIF4",
|
||||||
|
"mediaCode": "MED0089C8XYXU5FK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-046",
|
||||||
|
"productCode": "PRD0089C8YOOAHOG",
|
||||||
|
"mediaCode": "MED0089C8YN3HATC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-047",
|
||||||
|
"productCode": "PRD0089C8ZB4R4LC",
|
||||||
|
"mediaCode": "MED0089C8Z9FKM4G"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-048",
|
||||||
|
"productCode": "PRD0089C8ZXALP1C",
|
||||||
|
"mediaCode": "MED0089C8ZVNALTS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-049",
|
||||||
|
"productCode": "PRD0089C90L00I68",
|
||||||
|
"mediaCode": "MED0089C90JEKU80"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-050",
|
||||||
|
"productCode": "PRD0089C916XQWHS",
|
||||||
|
"mediaCode": "MED0089C91562HOG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-051",
|
||||||
|
"productCode": "PRD0089C91UDSLC0",
|
||||||
|
"mediaCode": "MED0089C91SRQGAO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-052",
|
||||||
|
"productCode": "PRD0089C92FS69Z4",
|
||||||
|
"mediaCode": "MED0089C92E5HNUO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-053",
|
||||||
|
"productCode": "PRD0089C931RS3K0",
|
||||||
|
"mediaCode": "MED0089C92ZYUQKG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-054",
|
||||||
|
"productCode": "PRD0089C93NZI39C",
|
||||||
|
"mediaCode": "MED0089C93M9P3PC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-055",
|
||||||
|
"productCode": "PRD0089C94AMTY4G",
|
||||||
|
"mediaCode": "MED0089C948Y9WQO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-056",
|
||||||
|
"productCode": "PRD0089C957WUQYO",
|
||||||
|
"mediaCode": "MED0089C9567O8HS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-057",
|
||||||
|
"productCode": "PRD0089C95UC2FPC",
|
||||||
|
"mediaCode": "MED0089C95SSI70G"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "HY-058",
|
||||||
|
"productCode": "PRD0089C96HSQLMO",
|
||||||
|
"mediaCode": "MED0089C96G7XERK"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"skipped": [],
|
||||||
|
"failures": []
|
||||||
|
}
|
||||||
@@ -0,0 +1,272 @@
|
|||||||
|
import html
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
|
BASE_URL = "http://127.0.0.1:8081"
|
||||||
|
SITE_CODE = "SIT0000000000001"
|
||||||
|
ROOT = Path(__file__).parent
|
||||||
|
IMAGE_DIR = ROOT / "product-images"
|
||||||
|
|
||||||
|
|
||||||
|
PRODUCTS = [
|
||||||
|
("HY-001", "保护盖打草头白色", "Protective Cover Trimmer Head - White", "8 × 8 × 2.3 cm", "White", "Trimmer Head", ""),
|
||||||
|
("HY-002", "保护盖打草头橙色", "Protective Cover Trimmer Head - Orange", "8 × 8 × 2.3 cm", "Orange", "Trimmer Head", ""),
|
||||||
|
("HY-003", "保护盖打草头红色", "Protective Cover Trimmer Head - Red", "8 × 8 × 2.3 cm", "Red", "Trimmer Head", ""),
|
||||||
|
("HY-004", "八孔铝打草头白色", "8-Hole Aluminum Trimmer Head - White", "21 × 21 cm", "White", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-005", "八孔铝打草头橙色", "8-Hole Aluminum Trimmer Head - Orange", "21 × 21 cm", "Orange", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-006", "八孔铝打草头红色", "8-Hole Aluminum Trimmer Head - Red", "21 × 21 cm", "Red", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-007", "四孔铝盘打草头", "4-Hole Aluminum Disc Trimmer Head", "11 × 11 × 1.4 cm", "Silver", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-008", "铝合金八孔打草头", "8-Hole Aluminum Alloy Trimmer Head", "8 × 8 × 3 cm", "Silver", "Trimmer Head", "Aluminum Alloy"),
|
||||||
|
("HY-009", "大铝盘打草头", "Large Aluminum Disc Trimmer Head", "13.5 × 13.5 × 2.5 cm", "Silver", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-010", "磨砂款打草头", "Matte Finish Trimmer Head", "", "Silver", "Trimmer Head", ""),
|
||||||
|
("HY-011", "光亮铝柱打草头", "Polished Aluminum Column Trimmer Head", "4.2 × 4.2 × 2 cm", "Silver", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-012", "大号铝圆柱打草头", "Large Aluminum Cylinder Trimmer Head", "", "Silver", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-013", "C5-2打草头", "C5-2 Trimmer Head", "12 × 8 × 8 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-014", "C6-2打草头", "C6-2 Trimmer Head", "13 × 13 × 8 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-015", "C25-2打草头", "C25-2 Trimmer Head", "12 × 12 × 5 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-016", "C26-2打草头", "C26-2 Trimmer Head", "7.2 × 4.5 cm", "Black / White", "Trimmer Head", ""),
|
||||||
|
("HY-017", "C27-2打草头", "C27-2 Trimmer Head", "14 × 14 × 8 cm", "Black / White", "Trimmer Head", ""),
|
||||||
|
("HY-018", "C46-2打草头", "C46-2 Trimmer Head", "16 × 16 × 7 cm", "Black / White", "Trimmer Head", ""),
|
||||||
|
("HY-019", "本田款打草头", "Honda-Style Trimmer Head", "13 × 13 × 7 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-020", "胡斯华纳款打草头", "Husqvarna-Style Trimmer Head", "11 × 11 × 6 cm", "Black / Blue", "Trimmer Head", ""),
|
||||||
|
("HY-021", "绿标箭头打草头", "Green-Label Arrow Trimmer Head", "9 × 9 × 7.4 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-022", "小松款打草头", "Komatsu-Style Trimmer Head", "13.5 × 6.7 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-023", "小松款铝打草头", "Komatsu-Style Aluminum Trimmer Head", "13 × 13 × 6 cm", "Black / Silver", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-024", "小松轴承款免拆打草头", "Komatsu-Style Bearing Trimmer Head", "13 × 13 × 8 cm", "Black / Yellow", "Trimmer Head", ""),
|
||||||
|
("HY-025", "意大利打款打草头", "Italian-Style Trimmer Head", "12.5 × 12.5 × 6 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-026", "意大利小款打草头", "Compact Italian-Style Trimmer Head", "10.5 × 10.5 × 6 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-027", "轴承款打草头", "Bearing-Type Trimmer Head", "12 × 12 × 7.7 cm", "Black / Silver", "Trimmer Head", ""),
|
||||||
|
("HY-028", "打草头+摇手", "Trimmer Head with Winding Handle", "11 × 11 × 8 cm", "Black / Green", "Trimmer Head", ""),
|
||||||
|
("HY-029", "铝蝴蝶款打草头", "Aluminum Butterfly Trimmer Head", "10 × 7.5 × 3.5 cm", "Silver / Black", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-030", "铝圆盘款打草头", "Aluminum Round Disc Trimmer Head", "12 × 12 × 2 cm", "Red", "Trimmer Head", "Aluminum"),
|
||||||
|
("HY-031", "欧码打草头黑色", "European-Type Trimmer Head - Black", "14.5 × 14.5 × 7.5 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-032", "欧码打草头橘色", "European-Type Trimmer Head - Orange", "14.5 × 14.5 × 7.5 cm", "Orange", "Trimmer Head", ""),
|
||||||
|
("HY-033", "欧码打草头红色", "European-Type Trimmer Head - Red", "14.5 × 14.5 × 7.5 cm", "Red", "Trimmer Head", ""),
|
||||||
|
("HY-034", "欧码打草头蓝色", "European-Type Trimmer Head - Blue", "14.5 × 14.5 × 7.5 cm", "Blue", "Trimmer Head", ""),
|
||||||
|
("HY-035", "黑色链条打草头", "Chain Trimmer Head - Black", "33.5 × 9 × 2 cm", "Black", "Chain Trimmer Head", "Metal"),
|
||||||
|
("HY-036", "红色链条打草头", "Chain Trimmer Head - Red", "33.5 × 9 × 2 cm", "Red", "Chain Trimmer Head", "Metal"),
|
||||||
|
("HY-037", "锂电打草头", "Cordless Trimmer Head", "14.5 × 14.5 × 7.5 cm", "Black", "Trimmer Head", ""),
|
||||||
|
("HY-038", "水陆两用除草头", "Wet and Dry Weeding Head", "23.5 × 23.5 × 4 cm", "Black / Red", "Weeding Head", ""),
|
||||||
|
("HY-039", "水陆除草头", "Wet and Dry Weeding Disc", "13 × 13 × 0.4 cm", "Red", "Weeding Head", ""),
|
||||||
|
("HY-040", "3刀锂电打草头", "3-Blade Cordless Trimmer Head", "15 × 15 × 3 cm", "Silver", "Trimmer Head", "Metal"),
|
||||||
|
("HY-041", "6刀锂电打草头", "6-Blade Cordless Trimmer Head", "15 × 15 × 3 cm", "Silver", "Trimmer Head", "Metal"),
|
||||||
|
("HY-042", "钢丝除草头", "Steel Wire Weeding Head", "", "Silver", "Weeding Head", "Steel Wire"),
|
||||||
|
("HY-043", "割草机刀片", "Brush Cutter Blade", "", "Silver / Green", "Brush Cutter Blade", "Metal"),
|
||||||
|
("HY-044", "割草机六叶刀片", "6-Tooth Brush Cutter Blade", "", "Red / Black", "Brush Cutter Blade", "Metal"),
|
||||||
|
("HY-045", "锯齿三角刀", "Serrated Triangular Brush Cutter Blade", "23 × 23 × 2 cm", "Silver / Black", "Brush Cutter Blade", "Metal"),
|
||||||
|
("HY-046", "尼龙盘", "Nylon Brush Wheel", "", "Orange", "Nylon Brush Wheel", "Nylon"),
|
||||||
|
("HY-047", "尼龙盘+八件套", "Nylon Brush Wheel with 8-Piece Adapter Kit", "", "Orange", "Nylon Brush Wheel Kit", "Nylon / Metal"),
|
||||||
|
("HY-048", "尼龙盘+固定四件套", "Nylon Brush Wheel with 4-Piece Fixing Kit", "", "Orange", "Nylon Brush Wheel Kit", "Nylon / Metal"),
|
||||||
|
("HY-049", "尼龙盘+斯蒂尔四件套", "Nylon Brush Wheel with Stihl-Style 4-Piece Kit", "", "Orange", "Nylon Brush Wheel Kit", "Nylon / Metal"),
|
||||||
|
("HY-050", "斯蒂尔多件套", "Stihl-Style Multi-Piece Adapter Kit", "", "Silver", "Adapter Kit", "Metal"),
|
||||||
|
("HY-051", "总成链接杆", "Gearbox Connecting Rod Assembly", "", "Silver / Black", "Connecting Rod Assembly", "Metal"),
|
||||||
|
("HY-052", "除草轮", "Weeding Wheel", "", "Black", "Weeding Wheel", "Metal"),
|
||||||
|
("HY-053", "一套除草轮", "Complete Weeding Wheel Set", "", "Black / Silver", "Weeding Wheel Set", "Metal"),
|
||||||
|
("HY-054", "一套松土轮", "Complete Cultivator Wheel Set", "", "Black / Silver", "Cultivator Wheel Set", "Metal"),
|
||||||
|
("HY-055", "一字刷", "Straight Wire Brush", "30.5 × 2.54 cm", "Orange", "Wire Brush", "Nylon / Wire"),
|
||||||
|
("HY-056", "3T刷", "3T Wire Brush", "18.5 cm", "Orange", "Wire Brush", "Nylon / Wire"),
|
||||||
|
("HY-057", "4T刷", "4T Wire Brush", "25.2 cm", "Orange", "Wire Brush", "Nylon / Wire"),
|
||||||
|
("HY-058", "黄油枪", "Grease Gun", "16.7 × 3.75 cm", "Black", "Grease Gun", "Metal"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def slugify(model, name):
|
||||||
|
return f"{model.lower()}-" + name.lower().replace(" - ", "-").replace(" ", "-").replace("/", "-")
|
||||||
|
|
||||||
|
|
||||||
|
def crop_product_images():
|
||||||
|
IMAGE_DIR.mkdir(exist_ok=True)
|
||||||
|
x_ranges = [(95, 555), (587, 1047), (1079, 1539)]
|
||||||
|
y_ranges = [(365, 750), (900, 1285), (1435, 1820)]
|
||||||
|
model_number = 1
|
||||||
|
for page_number in range(2, 8):
|
||||||
|
page = Image.open(ROOT / f"page-{page_number}.jpg").convert("RGB")
|
||||||
|
for top, bottom in y_ranges:
|
||||||
|
for left, right in x_ranges:
|
||||||
|
crop = page.crop((left, top, right, bottom))
|
||||||
|
crop.save(IMAGE_DIR / f"HY-{model_number:03d}.jpg", quality=92, optimize=True)
|
||||||
|
model_number += 1
|
||||||
|
page = Image.open(ROOT / "page-8.jpg").convert("RGB")
|
||||||
|
special = {
|
||||||
|
"HY-055": (60, 210, 492, 690),
|
||||||
|
"HY-056": (600, 210, 1032, 690),
|
||||||
|
"HY-057": (1140, 210, 1572, 690),
|
||||||
|
"HY-058": (60, 845, 492, 1325),
|
||||||
|
}
|
||||||
|
for model, box in special.items():
|
||||||
|
page.crop(box).save(IMAGE_DIR / f"{model}.jpg", quality=92, optimize=True)
|
||||||
|
|
||||||
|
|
||||||
|
def specifications(product):
|
||||||
|
model, _, _, dimensions, color, product_type, material = product
|
||||||
|
values = [("General", "Model", model, ""), ("General", "Product Type", product_type, "")]
|
||||||
|
if dimensions:
|
||||||
|
values.append(("Dimensions", "Product Dimensions", dimensions, ""))
|
||||||
|
if color:
|
||||||
|
values.append(("Appearance", "Color", color, ""))
|
||||||
|
if material:
|
||||||
|
values.append(("Material", "Primary Material", material, ""))
|
||||||
|
return [
|
||||||
|
{"groupName": group, "name": name, "value": value, "unit": unit, "sortNo": index}
|
||||||
|
for index, (group, name, value, unit) in enumerate(values, 1)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def attributes(product):
|
||||||
|
model, _, _, dimensions, color, product_type, material = product
|
||||||
|
values = [("Model", model), ("Product Type", product_type)]
|
||||||
|
if dimensions:
|
||||||
|
values.append(("Dimensions", dimensions))
|
||||||
|
if color:
|
||||||
|
values.append(("Color", color))
|
||||||
|
if material:
|
||||||
|
values.append(("Material", material))
|
||||||
|
return [
|
||||||
|
{"attributeCode": None, "attributeName": name, "value": value, "unit": None, "sortNo": index}
|
||||||
|
for index, (name, value) in enumerate(values, 1)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def description_html(product):
|
||||||
|
model, chinese_name, english_name, dimensions, color, product_type, material = product
|
||||||
|
features = [
|
||||||
|
f"Catalog model {html.escape(model)} for straightforward product identification.",
|
||||||
|
f"Designed as a {html.escape(product_type.lower())} for garden tool and brush cutter accessory sourcing.",
|
||||||
|
]
|
||||||
|
if dimensions:
|
||||||
|
features.append(f"Catalog dimensions: {html.escape(dimensions)}.")
|
||||||
|
if color:
|
||||||
|
features.append(f"Shown in {html.escape(color.lower())}; confirm availability when ordering.")
|
||||||
|
if material:
|
||||||
|
features.append(f"Primary material indicated by the catalog/product style: {html.escape(material)}.")
|
||||||
|
feature_items = "".join(f"<li>{item}</li>" for item in features)
|
||||||
|
return (
|
||||||
|
f"<h2>{html.escape(english_name)} Overview</h2>"
|
||||||
|
f"<p>{html.escape(english_name)} ({html.escape(model)}) is part of Hongyu's garden tool accessory range. "
|
||||||
|
f"The original catalog name is {html.escape(chinese_name)}. It is intended for importers, distributors, "
|
||||||
|
f"repair channels and garden machinery accessory suppliers.</p>"
|
||||||
|
f"<h2>Key Features</h2><ul>{feature_items}</ul>"
|
||||||
|
f"<h2>Applications</h2><p>Suitable for garden maintenance accessory sourcing and replacement-part distribution. "
|
||||||
|
f"Machine fitment, thread size, mounting bore and package contents should be confirmed before bulk ordering.</p>"
|
||||||
|
f"<h2>OEM and Wholesale Inquiry</h2><p>Contact us with the required quantity, target market, packaging, branding and compatibility details. "
|
||||||
|
f"Final specifications are subject to order confirmation.</p>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def request_json(session, method, path, **kwargs):
|
||||||
|
response = session.request(method, BASE_URL + path, timeout=90, **kwargs)
|
||||||
|
if not response.ok:
|
||||||
|
raise RuntimeError(f"{method} {path} failed: {response.status_code} {response.text}")
|
||||||
|
return response.json() if response.content else {}
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
crop_product_images()
|
||||||
|
session = requests.Session()
|
||||||
|
request_json(session, "POST", "/api/admin/v1/auth/login", json={"username": "admin", "password": "Shoplix@2026"})
|
||||||
|
existing = request_json(session, "POST", "/api/admin/v1/products/list", json={"siteCode": SITE_CODE})
|
||||||
|
existing_models = {item.get("model") for item in existing.get("items", [])}
|
||||||
|
created = []
|
||||||
|
skipped = []
|
||||||
|
failures = []
|
||||||
|
|
||||||
|
for sort_no, product in enumerate(PRODUCTS, 1):
|
||||||
|
model, _, english_name, dimensions, color, product_type, material = product
|
||||||
|
if model in existing_models:
|
||||||
|
skipped.append(model)
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
image_path = IMAGE_DIR / f"{model}.jpg"
|
||||||
|
with image_path.open("rb") as image_file:
|
||||||
|
media = request_json(
|
||||||
|
session,
|
||||||
|
"POST",
|
||||||
|
"/api/admin/v1/media/upload-image",
|
||||||
|
data={"siteCode": SITE_CODE, "altText": f"{english_name} {model}"},
|
||||||
|
files={"file": (image_path.name, image_file, "image/jpeg")},
|
||||||
|
)
|
||||||
|
summary_parts = [f"{english_name} ({model}) for garden tool accessory sourcing."]
|
||||||
|
if dimensions:
|
||||||
|
summary_parts.append(f"Catalog dimensions: {dimensions}.")
|
||||||
|
summary_parts.append("OEM and wholesale inquiries are welcome; confirm machine compatibility before ordering.")
|
||||||
|
payload = {
|
||||||
|
"productCode": None,
|
||||||
|
"siteCode": SITE_CODE,
|
||||||
|
"primaryCategoryCode": None,
|
||||||
|
"productName": f"{english_name} | {model}",
|
||||||
|
"slug": slugify(model, english_name),
|
||||||
|
"model": model,
|
||||||
|
"summary": " ".join(summary_parts),
|
||||||
|
"productContent": description_html(product),
|
||||||
|
"contentTemplateCode": None,
|
||||||
|
"templatePosition": None,
|
||||||
|
"coverMediaCode": media["mediaCode"],
|
||||||
|
"images": [{"mediaCode": media["mediaCode"], "sortNo": 1}],
|
||||||
|
"featured": False,
|
||||||
|
"inquiryEnabled": True,
|
||||||
|
"sortNo": sort_no,
|
||||||
|
"status": "DRAFT",
|
||||||
|
"specifications": specifications(product),
|
||||||
|
"attributes": attributes(product),
|
||||||
|
}
|
||||||
|
saved = request_json(session, "POST", "/api/admin/v1/products/save", json=payload)
|
||||||
|
product_code = saved["productCode"]
|
||||||
|
seo_title = f"{english_name} {model} | Hongyu Garden Tool Parts"
|
||||||
|
if len(seo_title) > 70:
|
||||||
|
seo_title = f"{english_name} {model} | Hongyu"
|
||||||
|
seo_description = (
|
||||||
|
f"Source {english_name} model {model} from Hongyu. "
|
||||||
|
f"{('Catalog size: ' + dimensions + '. ') if dimensions else ''}"
|
||||||
|
"OEM and wholesale inquiries for garden tool accessories are welcome."
|
||||||
|
)
|
||||||
|
structured_data = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "Product",
|
||||||
|
"name": english_name,
|
||||||
|
"model": model,
|
||||||
|
"description": seo_description,
|
||||||
|
"brand": {"@type": "Brand", "name": "Hongyu"},
|
||||||
|
"manufacturer": {"@type": "Organization", "name": "Yongkang Hongyu Industry and Trade Co., Ltd."},
|
||||||
|
}
|
||||||
|
seo_payload = {
|
||||||
|
"siteCode": SITE_CODE,
|
||||||
|
"pageType": "PRODUCT_DETAIL",
|
||||||
|
"targetCode": product_code,
|
||||||
|
"title": seo_title,
|
||||||
|
"description": seo_description,
|
||||||
|
"keywords": f"{english_name}, {model}, {product_type}, garden tool parts, brush cutter accessories, Hongyu",
|
||||||
|
"h1": f"{english_name} - {model}",
|
||||||
|
"canonicalUrl": None,
|
||||||
|
"robots": "noindex,follow",
|
||||||
|
"ogTitle": f"{english_name} | {model}",
|
||||||
|
"ogDescription": seo_description[:200],
|
||||||
|
"ogImageUrl": media.get("url"),
|
||||||
|
"structuredData": json.dumps(structured_data, ensure_ascii=False),
|
||||||
|
"status": "DRAFT",
|
||||||
|
"headings": [
|
||||||
|
{"level": 2, "text": f"{english_name} Overview", "sortNo": 1},
|
||||||
|
{"level": 2, "text": "Key Features", "sortNo": 2},
|
||||||
|
{"level": 2, "text": "Applications", "sortNo": 3},
|
||||||
|
{"level": 2, "text": "OEM and Wholesale Inquiry", "sortNo": 4},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
request_json(session, "POST", "/api/admin/v1/seo/save", json=seo_payload)
|
||||||
|
created.append({"model": model, "productCode": product_code, "mediaCode": media["mediaCode"]})
|
||||||
|
print(f"CREATED {model} {product_code}", flush=True)
|
||||||
|
except Exception as error:
|
||||||
|
failures.append({"model": model, "error": str(error)})
|
||||||
|
print(f"FAILED {model}: {error}", flush=True)
|
||||||
|
|
||||||
|
result = {"created": created, "skipped": skipped, "failures": failures}
|
||||||
|
(ROOT / "import-result.json").write_text(json.dumps(result, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||||
|
print(json.dumps({"created": len(created), "skipped": len(skipped), "failed": len(failures)}, ensure_ascii=False))
|
||||||
|
if failures:
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = Path(__file__).parent
|
||||||
|
OUTPUT = ROOT / "product-images-v2"
|
||||||
|
OUTPUT.mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
columns = [(63, 489), (603, 1029), (1143, 1569)]
|
||||||
|
rows = [(214, 688), (848, 1322), (1481, 1955)]
|
||||||
|
model_number = 1
|
||||||
|
for page_number in range(2, 8):
|
||||||
|
page = Image.open(ROOT / f"page-{page_number}.jpg").convert("RGB")
|
||||||
|
for top, bottom in rows:
|
||||||
|
for left, right in columns:
|
||||||
|
page.crop((left, top, right, bottom)).save(
|
||||||
|
OUTPUT / f"HY-{model_number:03d}.jpg", quality=94, optimize=True
|
||||||
|
)
|
||||||
|
model_number += 1
|
||||||
|
|
||||||
|
page = Image.open(ROOT / "page-8.jpg").convert("RGB")
|
||||||
|
for model, box in {
|
||||||
|
"HY-055": (63, 214, 489, 688),
|
||||||
|
"HY-056": (603, 214, 1029, 688),
|
||||||
|
"HY-057": (1143, 214, 1569, 688),
|
||||||
|
"HY-058": (63, 848, 489, 1322),
|
||||||
|
}.items():
|
||||||
|
crop = page.crop(box)
|
||||||
|
if model in {"HY-055", "HY-056", "HY-057"}:
|
||||||
|
ImageDraw.Draw(crop).rectangle((230, 300, 426, 474), fill="white")
|
||||||
|
crop.save(OUTPUT / f"{model}.jpg", quality=94, optimize=True)
|
||||||
|
|
||||||
|
thumb_size = (180, 200)
|
||||||
|
canvas = Image.new("RGB", (thumb_size[0] * 10, thumb_size[1] * 6), "white")
|
||||||
|
draw = ImageDraw.Draw(canvas)
|
||||||
|
for index, image_path in enumerate(sorted(OUTPUT.glob("HY-*.jpg"))):
|
||||||
|
image = Image.open(image_path).convert("RGB")
|
||||||
|
image.thumbnail((170, 170))
|
||||||
|
x = index % 10 * thumb_size[0]
|
||||||
|
y = index // 10 * thumb_size[1]
|
||||||
|
canvas.paste(image, (x + 5, y + 24))
|
||||||
|
draw.text((x + 5, y + 5), image_path.stem, fill="black")
|
||||||
|
canvas.save(ROOT / "clean-crop-preview.jpg", quality=92)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = Path(__file__).parent
|
||||||
|
X_RANGES = [(95, 555), (587, 1047), (1079, 1539)]
|
||||||
|
Y_RANGES = [(365, 830), (900, 1365), (1435, 1900)]
|
||||||
|
|
||||||
|
thumbs = []
|
||||||
|
for page_number in range(2, 8):
|
||||||
|
page = Image.open(ROOT / f"page-{page_number}.jpg").convert("RGB")
|
||||||
|
for row, (top, bottom) in enumerate(Y_RANGES):
|
||||||
|
for column, (left, right) in enumerate(X_RANGES):
|
||||||
|
crop = page.crop((left, top, right, bottom))
|
||||||
|
crop.thumbnail((230, 230))
|
||||||
|
thumbs.append((page_number, row, column, crop.copy()))
|
||||||
|
|
||||||
|
canvas = Image.new("RGB", (230 * 9, 260 * 6), "white")
|
||||||
|
draw = ImageDraw.Draw(canvas)
|
||||||
|
for index, (page_number, row, column, crop) in enumerate(thumbs):
|
||||||
|
x = (index % 9) * 230
|
||||||
|
y = (index // 9) * 260
|
||||||
|
canvas.paste(crop, (x, y + 22))
|
||||||
|
draw.text((x + 5, y + 4), f"p{page_number} r{row + 1} c{column + 1}", fill="black")
|
||||||
|
canvas.save(ROOT / "crop-preview.jpg", quality=90)
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
import json
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = Path(__file__).parent
|
||||||
|
sys.path.insert(0, str(ROOT))
|
||||||
|
from import_catalog import BASE_URL, PRODUCTS, SITE_CODE, request_json # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
|
def product_payload(detail, media_code, slug=None, product_code=None):
|
||||||
|
return {
|
||||||
|
"productCode": product_code,
|
||||||
|
"siteCode": SITE_CODE,
|
||||||
|
"primaryCategoryCode": detail.get("primaryCategoryCode"),
|
||||||
|
"productName": detail["productName"],
|
||||||
|
"slug": slug or detail["slug"],
|
||||||
|
"model": detail.get("model"),
|
||||||
|
"summary": detail.get("summary"),
|
||||||
|
"productContent": detail["productContent"],
|
||||||
|
"contentTemplateCode": detail.get("contentTemplateCode"),
|
||||||
|
"templatePosition": detail.get("templatePosition"),
|
||||||
|
"coverMediaCode": media_code,
|
||||||
|
"images": [{"mediaCode": media_code, "sortNo": 1}],
|
||||||
|
"featured": detail["featured"],
|
||||||
|
"inquiryEnabled": detail["inquiryEnabled"],
|
||||||
|
"sortNo": detail["sortNo"],
|
||||||
|
"status": detail["status"],
|
||||||
|
"specifications": detail.get("specifications") or [],
|
||||||
|
"attributes": detail.get("attributes") or [],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
session = requests.Session()
|
||||||
|
request_json(session, "POST", "/api/admin/v1/auth/login", json={"username": "admin", "password": "Shoplix@2026"})
|
||||||
|
listed = request_json(session, "POST", "/api/admin/v1/products/list", json={"siteCode": SITE_CODE})["items"]
|
||||||
|
by_model = {item.get("model"): item for item in listed if item.get("model")}
|
||||||
|
expected = [item[0] for item in PRODUCTS]
|
||||||
|
missing = [model for model in expected if model not in by_model]
|
||||||
|
if missing:
|
||||||
|
raise RuntimeError(f"Products missing before replacement: {missing}")
|
||||||
|
|
||||||
|
snapshots = {}
|
||||||
|
for model in expected:
|
||||||
|
item = by_model[model]
|
||||||
|
detail = request_json(session, "POST", "/api/admin/v1/products/detail", json={
|
||||||
|
"siteCode": SITE_CODE, "productCode": item["productCode"]
|
||||||
|
})
|
||||||
|
seo = request_json(session, "POST", "/api/admin/v1/seo/detail", json={
|
||||||
|
"siteCode": SITE_CODE, "pageType": "PRODUCT_DETAIL", "targetCode": item["productCode"]
|
||||||
|
})
|
||||||
|
snapshots[model] = {"detail": detail, "seo": seo}
|
||||||
|
|
||||||
|
uploaded = {}
|
||||||
|
image_dir = ROOT / "product-images-v2"
|
||||||
|
for model in expected:
|
||||||
|
image_path = image_dir / f"{model}.jpg"
|
||||||
|
with image_path.open("rb") as image_file:
|
||||||
|
media = request_json(
|
||||||
|
session,
|
||||||
|
"POST",
|
||||||
|
"/api/admin/v1/media/upload-image",
|
||||||
|
data={"siteCode": SITE_CODE, "altText": f"{snapshots[model]['detail']['productName']} product image"},
|
||||||
|
files={"file": (image_path.name, image_file, "image/jpeg")},
|
||||||
|
)
|
||||||
|
uploaded[model] = media["mediaCode"]
|
||||||
|
print(f"UPLOADED {model}", flush=True)
|
||||||
|
|
||||||
|
replaced = []
|
||||||
|
for model in expected:
|
||||||
|
detail = snapshots[model]["detail"]
|
||||||
|
old_code = detail["productCode"]
|
||||||
|
archived_slug = f"archived-{old_code.lower()}"
|
||||||
|
request_json(session, "POST", "/api/admin/v1/products/save", json=product_payload(
|
||||||
|
detail, detail["coverMediaCode"], slug=archived_slug, product_code=old_code
|
||||||
|
))
|
||||||
|
request_json(session, "POST", "/api/admin/v1/products/delete", json={
|
||||||
|
"siteCode": SITE_CODE, "productCode": old_code
|
||||||
|
})
|
||||||
|
saved = request_json(session, "POST", "/api/admin/v1/products/save", json=product_payload(
|
||||||
|
detail, uploaded[model], product_code=None
|
||||||
|
))
|
||||||
|
new_code = saved["productCode"]
|
||||||
|
seo = {key: value for key, value in snapshots[model]["seo"].items() if key != "seoCode"}
|
||||||
|
seo["targetCode"] = new_code
|
||||||
|
request_json(session, "POST", "/api/admin/v1/seo/save", json=seo)
|
||||||
|
replaced.append({"model": model, "oldProductCode": old_code, "newProductCode": new_code})
|
||||||
|
print(f"REPLACED {model} {old_code} -> {new_code}", flush=True)
|
||||||
|
|
||||||
|
result = {"uploaded": len(uploaded), "replaced": replaced}
|
||||||
|
(ROOT / "clean-reimport-result.json").write_text(json.dumps(result, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||||
|
print(json.dumps({"uploaded": len(uploaded), "replaced": len(replaced)}, ensure_ascii=False))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
+124
-3
@@ -44,7 +44,7 @@ import AgreementSettingsPage from "./AgreementSettingsPage";
|
|||||||
import AboutUsSettingsPage from "./AboutUsSettingsPage";
|
import AboutUsSettingsPage from "./AboutUsSettingsPage";
|
||||||
import DashboardPage from "./DashboardPage";
|
import DashboardPage from "./DashboardPage";
|
||||||
import CrmCustomerPage from "./CrmCustomerPage";
|
import CrmCustomerPage from "./CrmCustomerPage";
|
||||||
import { apiPost } from "./api";
|
import { apiPost, assetUrl } from "./api";
|
||||||
import { statusLabel } from "./statusLabels";
|
import { statusLabel } from "./statusLabels";
|
||||||
import {
|
import {
|
||||||
ensureCurrentSiteCode,
|
ensureCurrentSiteCode,
|
||||||
@@ -113,6 +113,13 @@ type Item = {
|
|||||||
sourceType?: string;
|
sourceType?: string;
|
||||||
statusLabel?: string;
|
statusLabel?: string;
|
||||||
createTime?: number;
|
createTime?: number;
|
||||||
|
primaryCategoryCode?: string;
|
||||||
|
primaryCategoryName?: string;
|
||||||
|
coverMediaUrl?: string;
|
||||||
|
};
|
||||||
|
type CategoryOption = {
|
||||||
|
categoryCode: string;
|
||||||
|
categoryName: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 将毫秒时间戳格式化为本地列表时间。 */
|
/** 将毫秒时间戳格式化为本地列表时间。 */
|
||||||
@@ -212,6 +219,9 @@ function App({
|
|||||||
const [items, setItems] = useState<Item[]>([]);
|
const [items, setItems] = useState<Item[]>([]);
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
|
const [categoryFilter, setCategoryFilter] = useState("");
|
||||||
|
const [statusFilter, setStatusFilter] = useState("");
|
||||||
|
const [categories, setCategories] = useState<CategoryOption[]>([]);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
const [siteDialogOpen, setSiteDialogOpen] = useState(false);
|
const [siteDialogOpen, setSiteDialogOpen] = useState(false);
|
||||||
@@ -305,7 +315,11 @@ function App({
|
|||||||
: section === "about-us"
|
: section === "about-us"
|
||||||
? { items: [] }
|
? { items: [] }
|
||||||
: section === "products"
|
: section === "products"
|
||||||
? await post("/products/list", { siteCode: SITE })
|
? await post("/products/list", {
|
||||||
|
siteCode: SITE,
|
||||||
|
primaryCategoryCode: categoryFilter || null,
|
||||||
|
status: statusFilter || null,
|
||||||
|
})
|
||||||
: section === "pages"
|
: section === "pages"
|
||||||
? await post("/pages/list", { siteCode: SITE })
|
? await post("/pages/list", { siteCode: SITE })
|
||||||
: section === "decoration"
|
: section === "decoration"
|
||||||
@@ -317,6 +331,8 @@ function App({
|
|||||||
: await post("/contents/list", {
|
: await post("/contents/list", {
|
||||||
siteCode: SITE,
|
siteCode: SITE,
|
||||||
contentType: section,
|
contentType: section,
|
||||||
|
primaryCategoryCode: categoryFilter || null,
|
||||||
|
status: statusFilter || null,
|
||||||
});
|
});
|
||||||
setItems(data.items || []);
|
setItems(data.items || []);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -324,8 +340,33 @@ function App({
|
|||||||
setItems([]);
|
setItems([]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/** 加载产品、新闻或案例列表所需的分类筛选项。 */
|
||||||
|
const loadCategoryFilters = async () => {
|
||||||
|
if (!["products", "NEWS", "CASE"].includes(section)) {
|
||||||
|
setCategories([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const data =
|
||||||
|
section === "products"
|
||||||
|
? await post("/products/categories/list", { siteCode: SITE })
|
||||||
|
: await post("/contents/categories/list", {
|
||||||
|
siteCode: SITE,
|
||||||
|
contentType: section,
|
||||||
|
});
|
||||||
|
setCategories(data.items || []);
|
||||||
|
} catch {
|
||||||
|
setCategories([]);
|
||||||
|
}
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void load();
|
void load();
|
||||||
|
}, [section, categoryFilter, statusFilter]);
|
||||||
|
useEffect(() => {
|
||||||
|
setQuery("");
|
||||||
|
setCategoryFilter("");
|
||||||
|
setStatusFilter("");
|
||||||
|
void loadCategoryFilters();
|
||||||
}, [section]);
|
}, [section]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handlePopState = () => {
|
const handlePopState = () => {
|
||||||
@@ -855,6 +896,39 @@ function App({
|
|||||||
placeholder={`搜索${title}名称或路径`}
|
placeholder={`搜索${title}名称或路径`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{["products", "NEWS", "CASE"].includes(section) && (
|
||||||
|
<div className="list-filters">
|
||||||
|
<select
|
||||||
|
aria-label="按分类筛选"
|
||||||
|
value={categoryFilter}
|
||||||
|
onChange={(event) =>
|
||||||
|
setCategoryFilter(event.target.value)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<option value="">全部分类</option>
|
||||||
|
{categories.map((category) => (
|
||||||
|
<option
|
||||||
|
key={category.categoryCode}
|
||||||
|
value={category.categoryCode}
|
||||||
|
>
|
||||||
|
{category.categoryName}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
<select
|
||||||
|
aria-label="按上下架状态筛选"
|
||||||
|
value={statusFilter}
|
||||||
|
onChange={(event) =>
|
||||||
|
setStatusFilter(event.target.value)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<option value="">全部状态</option>
|
||||||
|
<option value="PUBLISHED">已上架</option>
|
||||||
|
<option value="OFFLINE">已下架</option>
|
||||||
|
<option value="DRAFT">草稿</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
{error && (
|
{error && (
|
||||||
<div className="notice">
|
<div className="notice">
|
||||||
@@ -862,7 +936,7 @@ function App({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<section
|
<section
|
||||||
className={`table ${section === "inquiries" ? "inquiry-table" : ""}`}
|
className={`table ${section === "inquiries" ? "inquiry-table" : ""} ${section === "products" ? "product-list-table" : ["NEWS", "CASE"].includes(section) ? "content-list-table" : ""}`}
|
||||||
>
|
>
|
||||||
<div className="thead">
|
<div className="thead">
|
||||||
{section === "inquiries" ? (
|
{section === "inquiries" ? (
|
||||||
@@ -875,6 +949,27 @@ function App({
|
|||||||
<span>状态</span>
|
<span>状态</span>
|
||||||
<span>操作</span>
|
<span>操作</span>
|
||||||
</>
|
</>
|
||||||
|
) : section === "products" ? (
|
||||||
|
<>
|
||||||
|
<span>图片</span>
|
||||||
|
<span>名称</span>
|
||||||
|
<span>产品编号</span>
|
||||||
|
<span>分类</span>
|
||||||
|
<span>英文路径</span>
|
||||||
|
<span>状态</span>
|
||||||
|
<span>发布时间</span>
|
||||||
|
<span>操作</span>
|
||||||
|
</>
|
||||||
|
) : ["NEWS", "CASE"].includes(section) ? (
|
||||||
|
<>
|
||||||
|
<span>图片</span>
|
||||||
|
<span>名称</span>
|
||||||
|
<span>分类</span>
|
||||||
|
<span>英文路径</span>
|
||||||
|
<span>状态</span>
|
||||||
|
<span>发布时间</span>
|
||||||
|
<span>操作</span>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span>名称</span>
|
<span>名称</span>
|
||||||
@@ -940,6 +1035,24 @@ function App({
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
{["products", "NEWS", "CASE"].includes(
|
||||||
|
section,
|
||||||
|
) && (
|
||||||
|
<span className="list-cover">
|
||||||
|
{item.coverMediaUrl ? (
|
||||||
|
<img
|
||||||
|
src={assetUrl(item.coverMediaUrl)}
|
||||||
|
alt={
|
||||||
|
item.productName || item.title || "封面"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<span className="list-cover-empty">
|
||||||
|
暂无图片
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<span>
|
<span>
|
||||||
<strong>
|
<strong>
|
||||||
{item.productName ||
|
{item.productName ||
|
||||||
@@ -953,6 +1066,14 @@ function App({
|
|||||||
item.pageCode}
|
item.pageCode}
|
||||||
</small>
|
</small>
|
||||||
</span>
|
</span>
|
||||||
|
{section === "products" && (
|
||||||
|
<code>{item.productCode || "--"}</code>
|
||||||
|
)}
|
||||||
|
{["products", "NEWS", "CASE"].includes(
|
||||||
|
section,
|
||||||
|
) && (
|
||||||
|
<span>{item.primaryCategoryName || "未分类"}</span>
|
||||||
|
)}
|
||||||
<code>/{item.slug}</code>
|
<code>/{item.slug}</code>
|
||||||
<span
|
<span
|
||||||
className={`status ${item.status.toLowerCase()}`}
|
className={`status ${item.status.toLowerCase()}`}
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ header p {
|
|||||||
.toolbar {
|
.toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
.search {
|
.search {
|
||||||
@@ -173,6 +175,7 @@ header p {
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
.list-filters{display:flex;align-items:center;gap:10px}.list-filters select{height:40px;min-width:150px;border:1px solid #d9e0e5;border-radius:6px;background:#fff;padding:0 34px 0 12px;color:#34434f;font:inherit}.product-list-table,.content-list-table{overflow-x:auto}.product-list-table .thead,.product-list-table .row{min-width:1420px;grid-template-columns:82px minmax(250px,1.8fr) 150px minmax(150px,1fr) minmax(240px,1.4fr) 90px 145px 210px}.content-list-table .thead,.content-list-table .row{min-width:1260px;grid-template-columns:82px minmax(260px,1.8fr) minmax(150px,1fr) minmax(240px,1.4fr) 90px 145px 210px}.list-cover{display:flex!important;align-items:center;justify-content:center;width:68px;height:52px;border:1px solid #e2e7ea;border-radius:5px;background:#f7f9fa;overflow:hidden}.list-cover img{width:100%;height:100%;object-fit:cover}.list-cover-empty{font-size:11px;color:#98a2aa}.product-list-table .row>code,.content-list-table .row>code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||||
.notice {
|
.notice {
|
||||||
background: #fff6dc;
|
background: #fff6dc;
|
||||||
border: 1px solid #ead38e;
|
border: 1px solid #ead38e;
|
||||||
@@ -391,6 +394,7 @@ header p {
|
|||||||
.category-manager{max-width:1500px;margin:auto}.category-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}.category-heading h1{margin:0 0 5px}.category-heading p{margin:0;color:#72808d;font-size:13px}.category-table{background:#fff;border:1px solid #dfe5e9;border-radius:6px;overflow:hidden}.category-table-head,.category-row{display:grid;grid-template-columns:minmax(300px,2fr) 1.2fr .7fr .6fr;align-items:center;gap:18px;padding:13px 20px}.category-table-head{background:#f8fafb;color:#6d7983;font-size:12px;font-weight:600;border-bottom:1px solid #e4e9ed}.category-row{min-height:64px;border-bottom:1px solid #edf0f2}.category-row:last-child{border-bottom:0}.category-name{display:grid;grid-template-columns:24px 1fr;align-items:center;min-width:0}.category-name small{grid-column:2;color:#8b969f;font-size:10px;margin-top:3px}.tree-toggle{width:24px!important;height:24px;padding:0!important;display:grid!important;place-items:center}.tree-space{width:24px}.category-actions{display:flex;gap:5px}.category-actions button{width:34px;height:34px;display:grid;place-items:center;border:1px solid #d8dee3;background:#fff;border-radius:5px;color:#176b5b;cursor:pointer}.category-dialog{width:min(720px,calc(100vw - 32px));background:#fff;border-radius:7px;box-shadow:0 24px 70px rgba(0,0,0,.24);overflow:hidden}.dialog-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 24px;border-top:1px solid #e6e9ed}.dialog-foot button{border:1px solid #d9dee5;background:#fff;border-radius:5px;padding:10px 18px}.dialog-foot .primary{background:#176b5b;color:#fff}
|
.category-manager{max-width:1500px;margin:auto}.category-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}.category-heading h1{margin:0 0 5px}.category-heading p{margin:0;color:#72808d;font-size:13px}.category-table{background:#fff;border:1px solid #dfe5e9;border-radius:6px;overflow:hidden}.category-table-head,.category-row{display:grid;grid-template-columns:minmax(300px,2fr) 1.2fr .7fr .6fr;align-items:center;gap:18px;padding:13px 20px}.category-table-head{background:#f8fafb;color:#6d7983;font-size:12px;font-weight:600;border-bottom:1px solid #e4e9ed}.category-row{min-height:64px;border-bottom:1px solid #edf0f2}.category-row:last-child{border-bottom:0}.category-name{display:grid;grid-template-columns:24px 1fr;align-items:center;min-width:0}.category-name small{grid-column:2;color:#8b969f;font-size:10px;margin-top:3px}.tree-toggle{width:24px!important;height:24px;padding:0!important;display:grid!important;place-items:center}.tree-space{width:24px}.category-actions{display:flex;gap:5px}.category-actions button{width:34px;height:34px;display:grid;place-items:center;border:1px solid #d8dee3;background:#fff;border-radius:5px;color:#176b5b;cursor:pointer}.category-dialog{width:min(720px,calc(100vw - 32px));background:#fff;border-radius:7px;box-shadow:0 24px 70px rgba(0,0,0,.24);overflow:hidden}.dialog-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 24px;border-top:1px solid #e6e9ed}.dialog-foot button{border:1px solid #d9dee5;background:#fff;border-radius:5px;padding:10px 18px}.dialog-foot .primary{background:#176b5b;color:#fff}
|
||||||
.settings-tabs{display:flex;gap:20px;border-bottom:1px solid #dfe5e9;margin-bottom:18px}.settings-tabs button{border:0;background:transparent;padding:10px 2px;color:#6d7983;font:inherit;cursor:pointer}.settings-tabs button.active{color:#176b5b;border-bottom:2px solid #176b5b;font-weight:700}.forms-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.forms-heading h2{margin:0 0 4px}.forms-heading p{margin:0;color:#72808d;font-size:13px}.forms-list{background:#fff;border:1px solid #dfe5e9;border-radius:6px;overflow:hidden}.form-list-row{display:grid;grid-template-columns:2fr .7fr .7fr .5fr;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid #edf0f2}.form-list-row:last-child{border-bottom:0}.form-list-row>div{display:grid;gap:4px}.form-list-row small{color:#7b8791}.form-list-row .link{border:0;background:transparent;color:#176b5b;display:flex;align-items:center;gap:5px;cursor:pointer}.inquiry-form-editor{padding-bottom:50px}.inquiry-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;align-items:start}.inquiry-form-editor .edit-section>label{display:grid;gap:7px}.inquiry-form-editor .edit-section>label>span{font-size:13px;font-weight:600}.inquiry-form-editor .edit-section>label>input{border:1px solid #d8dee3;border-radius:5px;padding:10px 12px;font:inherit}.setting-check{display:flex!important;align-items:center;gap:9px;padding:10px 0;font-size:13px;cursor:pointer}.editor-side .setting-check>input{width:18px;height:18px;margin:0;flex:none}.editor-side .setting-check>span{font-weight:500}.form-field-table{border:1px solid #e1e6e9;border-radius:6px;overflow:hidden}.form-field-head,.form-field-item{display:grid;grid-template-columns:minmax(150px,1.3fr) minmax(120px,1fr) minmax(110px,.8fr) 70px 70px 88px;gap:14px;align-items:center;padding:12px 16px}.form-field-head{background:#f7f9fa;color:#6d7983;font-size:12px;border-bottom:1px solid #e1e6e9}.form-field-item{min-height:42px;border-bottom:1px solid #edf0f2;font-size:13px}.form-field-item:last-child{border-bottom:0}.form-field-item strong{font-weight:500}.form-field-item code{overflow:hidden;text-overflow:ellipsis;color:#66737d}.field-actions{display:flex;gap:6px}.field-actions button{width:34px;height:34px;border:1px solid #d8dee3;border-radius:5px;background:#fff;color:#176b5b;display:grid;place-items:center;cursor:pointer}.field-actions button.danger{color:#ad3c3c}.field-actions button:disabled{color:#b8c0c5;background:#f5f6f7;cursor:not-allowed}.field-empty{padding:42px 20px;text-align:center;color:#87929a;font-size:13px}.field-dialog{width:min(780px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:8px;box-shadow:0 24px 70px rgba(0,0,0,.24)}.field-dialog-grid{align-items:start}.field-dialog-grid input:disabled{background:#f1f3f4;color:#7c858c}.dialog-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center!important;gap:9px!important;padding:4px 0}.dialog-check input{width:18px;height:18px;margin:0}.dialog-check span{font-weight:500!important}
|
.settings-tabs{display:flex;gap:20px;border-bottom:1px solid #dfe5e9;margin-bottom:18px}.settings-tabs button{border:0;background:transparent;padding:10px 2px;color:#6d7983;font:inherit;cursor:pointer}.settings-tabs button.active{color:#176b5b;border-bottom:2px solid #176b5b;font-weight:700}.forms-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.forms-heading h2{margin:0 0 4px}.forms-heading p{margin:0;color:#72808d;font-size:13px}.forms-list{background:#fff;border:1px solid #dfe5e9;border-radius:6px;overflow:hidden}.form-list-row{display:grid;grid-template-columns:2fr .7fr .7fr .5fr;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid #edf0f2}.form-list-row:last-child{border-bottom:0}.form-list-row>div{display:grid;gap:4px}.form-list-row small{color:#7b8791}.form-list-row .link{border:0;background:transparent;color:#176b5b;display:flex;align-items:center;gap:5px;cursor:pointer}.inquiry-form-editor{padding-bottom:50px}.inquiry-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;align-items:start}.inquiry-form-editor .edit-section>label{display:grid;gap:7px}.inquiry-form-editor .edit-section>label>span{font-size:13px;font-weight:600}.inquiry-form-editor .edit-section>label>input{border:1px solid #d8dee3;border-radius:5px;padding:10px 12px;font:inherit}.setting-check{display:flex!important;align-items:center;gap:9px;padding:10px 0;font-size:13px;cursor:pointer}.editor-side .setting-check>input{width:18px;height:18px;margin:0;flex:none}.editor-side .setting-check>span{font-weight:500}.form-field-table{border:1px solid #e1e6e9;border-radius:6px;overflow:hidden}.form-field-head,.form-field-item{display:grid;grid-template-columns:minmax(150px,1.3fr) minmax(120px,1fr) minmax(110px,.8fr) 70px 70px 88px;gap:14px;align-items:center;padding:12px 16px}.form-field-head{background:#f7f9fa;color:#6d7983;font-size:12px;border-bottom:1px solid #e1e6e9}.form-field-item{min-height:42px;border-bottom:1px solid #edf0f2;font-size:13px}.form-field-item:last-child{border-bottom:0}.form-field-item strong{font-weight:500}.form-field-item code{overflow:hidden;text-overflow:ellipsis;color:#66737d}.field-actions{display:flex;gap:6px}.field-actions button{width:34px;height:34px;border:1px solid #d8dee3;border-radius:5px;background:#fff;color:#176b5b;display:grid;place-items:center;cursor:pointer}.field-actions button.danger{color:#ad3c3c}.field-actions button:disabled{color:#b8c0c5;background:#f5f6f7;cursor:not-allowed}.field-empty{padding:42px 20px;text-align:center;color:#87929a;font-size:13px}.field-dialog{width:min(780px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:8px;box-shadow:0 24px 70px rgba(0,0,0,.24)}.field-dialog-grid{align-items:start}.field-dialog-grid input:disabled{background:#f1f3f4;color:#7c858c}.dialog-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center!important;gap:9px!important;padding:4px 0}.dialog-check input{width:18px;height:18px;margin:0}.dialog-check span{font-weight:500!important}
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
|
.toolbar{align-items:stretch;flex-direction:column}.search{width:auto}.list-filters{display:grid;grid-template-columns:1fr 1fr}.list-filters select{min-width:0;width:100%}
|
||||||
.shell {
|
.shell {
|
||||||
grid-template-columns: 68px 1fr;
|
grid-template-columns: 68px 1fr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user