Quellcode durchsuchen

feat: 新增商品id筛选

叶静 vor 2 Wochen
Ursprung
Commit
05c32dc551

+ 13 - 4
src/app/shop/admin/goods/goods/index.vue

@@ -159,6 +159,16 @@ async function getType() {
 
 // 搜索字段配置
 const searchFields = reactive({
+  id: {
+    type: 'input',
+    get label() {
+      return t('modules.goods.goodsId');
+    },
+    get placeholder() {
+      return t('form.inputGoodsId');
+    },
+    width: 150,
+  },
   storeName: {
     type: 'input',
     get label() {
@@ -184,6 +194,7 @@ const searchFields = reactive({
 
 // 默认搜索值
 const defaultSearchValues = reactive({
+  id: '',
   storeName: '',
   cateId: '',
   status: '',
@@ -226,13 +237,11 @@ const handleSearch = (searchParams) => {
 
 // 重置处理
 const handleReset = () => {
-  // 清除排序参数
+  // 完全清空搜索参数,只保留默认排序
   currentSearchParams.value = {
-    ...currentSearchParams.value,
     sortway: 0 // 重置为默认排序
   };
-  // 由于使用了 v-model,currentSearchParams 会自动清空
-  // 直接调用 getData,会自动使用当前的搜索条件和状态
+  // 直接调用 getData,使用空的搜索条件
   getData(1, {});
 };
 

+ 3 - 1
src/locales/en-US/index.json

@@ -319,6 +319,7 @@
     "createTime": "Create Time",
     "updateTime": "Update Time",
     "goodsName": "Goods Name",
+    "inputGoodsId": "Please enter goods ID",
     "goodsPrice": "Goods Price",
     "goodsStock": "Goods Stock",
     "goodsCategory": "Goods Category",
@@ -1179,7 +1180,8 @@
       "goodsSupplierRequired": "Please enter goods supplier",
       "goodsImageRequired": "Please upload goods image",
       "goodsDetailImageRequired": "Please upload goods detail image",
-      "mainImageRatioTip": "Image must be in 1:1 square aspect ratio"
+      "mainImageRatioTip": "Image must be in 1:1 square aspect ratio",
+      "goodsId": "Goods ID"
     },
     "order": {
       "orderManagement": "Order Management",

+ 3 - 1
src/locales/zh-CN/index.json

@@ -319,6 +319,7 @@
     "createTime": "创建时间",
     "updateTime": "更新时间",
     "goodsName": "商品名称",
+    "inputGoodsId": "请输入商品ID",
     "goodsPrice": "商品价格",
     "goodsStock": "商品库存",
     "goodsCategory": "商品分类",
@@ -1191,7 +1192,8 @@
       "batchOnSale": "批量上架",
       "batchOffSale": "批量下架",
       "batchDelete": "批量删除",
-      "mainImageRatioTip": "图片必须为1:1正方形比例"
+      "mainImageRatioTip": "图片必须为1:1正方形比例",
+      "goodsId": "商品ID"
     },
     "order": {
       "orderManagement": "订单管理",