Просмотр исходного кода

fix: SKU specs Map正确序列化为JSON + 审核中心滚动容器统一

Xiaogang Liao 2 месяцев назад
Родитель
Сommit
10e3bbd7d1

+ 5 - 2
cfc-backend/src/main/java/com/etotem/cfc/service/ProductSkuService.java

@@ -28,7 +28,7 @@ public class ProductSkuService {
 
     @Transactional
     public ProductSku create(ProductSku sku) {
-        sku.setSpecs(normalizeSpecsToJson(String.valueOf(sku.getSpecs())));
+        sku.setSpecs(normalizeSpecsToJson(sku.getSpecs()));
         sku.setCreateTime(new Date());
         sku.setUpdateTime(new Date());
         if (sku.getEnabled() == null) {
@@ -44,7 +44,7 @@ public class ProductSkuService {
     @Transactional
     public void update(ProductSku sku) {
         if (sku.getSpecs() != null) {
-            sku.setSpecs(normalizeSpecsToJson(String.valueOf(sku.getSpecs())));
+            sku.setSpecs(normalizeSpecsToJson(sku.getSpecs()));
         }
         sku.setUpdateTime(new Date());
         skuMapper.updateById(sku);
@@ -90,6 +90,9 @@ public class ProductSkuService {
      */
     static String normalizeSpecsToJson(Object specsObj) {
         if (specsObj == null) return "{}";
+        if (specsObj instanceof java.util.Map) {
+            return com.alibaba.fastjson.JSON.toJSONString(specsObj);
+        }
         String specs;
         if (specsObj instanceof String) {
             specs = (String) specsObj;

+ 2 - 2
cfc-web/src/views/admin/review/ActivityAudit.vue

@@ -10,7 +10,7 @@
       <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="title" label="活动名称" min-width="200" show-overflow-tooltip />
@@ -29,7 +29,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 2 - 2
cfc-web/src/views/admin/review/ActivityRegistrationAudit.vue

@@ -9,7 +9,7 @@
       </el-select>
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column label="用户" width="120">
@@ -32,7 +32,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
   </div>
 </template>
 

+ 2 - 2
cfc-web/src/views/admin/review/ArticleAudit.vue

@@ -12,7 +12,7 @@
       <el-button v-if="selectedRows.length > 0 && statusFilter === 'pending'" size="small" type="success" @click="handleBatchApprove">批量通过({{ selectedRows.length }})</el-button>
       <el-button v-if="selectedRows.length > 0 && statusFilter === 'pending'" size="small" type="danger" @click="showBatchRejectDialog">批量驳回({{ selectedRows.length }})</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;" @selection-change="onSelectionChange">
       <el-table-column type="selection" width="40" v-if="statusFilter === 'pending'" />
       <el-table-column prop="id" label="ID" width="60" />
@@ -39,7 +39,7 @@
           <el-button v-else size="mini" type="primary" @click="showDetail(row)">查看</el-button>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-pagination
       v-if="total > 0"

+ 2 - 2
cfc-web/src/views/admin/review/ButlerAudit.vue

@@ -9,7 +9,7 @@
       </el-select>
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="档案ID" width="80" />
       <el-table-column prop="userId" label="用户ID" width="80" />
@@ -29,7 +29,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 2 - 2
cfc-web/src/views/admin/review/GuideAudit.vue

@@ -10,7 +10,7 @@
       <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="nickname" label="昵称" width="120" />
@@ -30,7 +30,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-pagination
       v-if="total > 0"

+ 2 - 2
cfc-web/src/views/admin/review/HierarchyAudit.vue

@@ -9,7 +9,7 @@
       </el-select>
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="applicantName" label="申请人" width="120" />
@@ -30,7 +30,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 2 - 2
cfc-web/src/views/admin/review/NutritionistAudit.vue

@@ -10,7 +10,7 @@
       <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="nickname" label="昵称" width="120" />
@@ -30,7 +30,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 7 - 7
cfc-web/src/views/admin/review/PackageAudit.vue

@@ -11,11 +11,11 @@
       <el-button v-if="selectedRows.length > 0 && statusFilter === 'pending'" size="small" type="success" @click="handleBatchApprove">批量通过({{ selectedRows.length }})</el-button>
       <el-button v-if="selectedRows.length > 0 && statusFilter === 'pending'" size="small" type="danger" @click="showBatchRejectDialog">批量驳回({{ selectedRows.length }})</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;" @selection-change="onSelectionChange">
       <el-table-column type="selection" width="40" v-if="statusFilter === 'pending'" />
       <el-table-column prop="id" label="ID" width="60" />
-      <el-table-column prop="name" label="套餐名称" min-width="180" show-overflow-tooltip />
+      <el-table-column prop="name" label="任务模板名称" min-width="180" show-overflow-tooltip />
       <el-table-column prop="cycleDays" label="周期" width="70">
         <template slot-scope="{ row }">{{ row.cycleDays }}天</template>
       </el-table-column>
@@ -44,7 +44,7 @@
           <el-button v-else size="mini" type="primary" @click="showDetail(row)">查看</el-button>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-pagination
       v-if="total > 0"
@@ -56,11 +56,11 @@
       style="margin-top:12px;text-align:right;"
     />
 
-    <el-dialog title="套餐详情" :visible.sync="detailVisible" width="700px" top="5vh">
+    <el-dialog title="任务模板详情" :visible.sync="detailVisible" width="700px" top="5vh">
       <div v-if="currentRow" style="max-height:60vh;overflow-y:auto;">
         <el-form label-width="110px" size="small">
           <el-form-item label="ID">{{ currentRow.id }}</el-form-item>
-          <el-form-item label="套餐名称">{{ currentRow.name }}</el-form-item>
+          <el-form-item label="任务模板名称">{{ currentRow.name }}</el-form-item>
           <el-form-item label="状态"><el-tag :type="statusType(currentRow.status)">{{ statusLabel(currentRow.status) }}</el-tag></el-form-item>
           <el-form-item label="周期">{{ currentRow.cycleDays }} 天</el-form-item>
           <el-form-item label="价格">{{ formatPrice(currentRow.price) }}</el-form-item>
@@ -168,7 +168,7 @@ export default {
     },
     async handleApprove(row) {
       try {
-        await this.$confirm('确认通过该套餐?', '提示', { type: 'warning' })
+        await this.$confirm('确认通过该任务模板?', '提示', { type: 'warning' })
         await reviewPackage({ id: row.id, action: 'approve' })
         this.$message.success('已通过')
         this.loadData()
@@ -199,7 +199,7 @@ export default {
     },
     async handleBatchApprove() {
       try {
-        await this.$confirm(`确认通过所选 ${this.selectedRows.length} 个套餐?`, '提示', { type: 'warning' })
+        await this.$confirm(`确认通过所选 ${this.selectedRows.length} 个任务模板?`, '提示', { type: 'warning' })
         for (const row of this.selectedRows) {
           await reviewPackage({ id: row.id, action: 'approve' })
         }

+ 2 - 2
cfc-web/src/views/admin/review/ProductAudit.vue

@@ -9,7 +9,7 @@
       </el-select>
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="name" label="商品名称" min-width="180" show-overflow-tooltip />
@@ -28,7 +28,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 2 - 2
cfc-web/src/views/admin/review/VendorAudit.vue

@@ -10,7 +10,7 @@
       <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="nickname" label="昵称" width="120" />
@@ -33,7 +33,7 @@
           <span v-else class="no-op">—</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />

+ 2 - 2
cfc-web/src/views/admin/review/WithdrawAudit.vue

@@ -10,7 +10,7 @@
       <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
       <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
     </div>
-    <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
+    <div style="overflow:auto;max-height:calc(100vh - 300px);min-width:0;box-sizing:border-box;">
     <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column label="用户" width="120">
@@ -37,7 +37,7 @@
           <span v-else style="color:#999">-</span>
         </template>
       </el-table-column>
-    </el-table></div></div>
+    </el-table></div>
 
     <el-pagination
       v-if="total > 0"