Browse Source

fix: 3437 3443 3444 3445

sgc 1 month ago
parent
commit
5921f48f0c
1 changed files with 54 additions and 42 deletions
  1. 54 42
      src/views/storeDecoration/personnelConfig/index.vue

+ 54 - 42
src/views/storeDecoration/personnelConfig/index.vue

@@ -36,27 +36,54 @@
           <div class="personnel-config-empty">暂无数据</div>
         </template>
         <template #operation="scope">
-          <el-button type="primary" link @click="editPersonnel(scope.row, 0)"> 编辑 </el-button>
-          <el-button
-            v-if="scope.row.onlineStatus === 0 || scope.row.onlineStatus === '0'"
-            type="primary"
-            link
-            @click="handleOffline(scope.row)"
-          >
-            下线
-          </el-button>
-          <el-button
-            v-else-if="scope.row.onlineStatus === 1 || scope.row.onlineStatus === '1'"
-            type="primary"
-            link
-            @click="handleOnline(scope.row)"
-          >
-            上线
-          </el-button>
-          <el-button v-if="scope.row.isPinned" type="primary" link @click="handleUnpin(scope.row)"> 取消置顶 </el-button>
-          <el-button v-else type="primary" link @click="handlePin(scope.row)"> 置顶 </el-button>
-          <el-button type="primary" link @click="deletePersonnelHandler(scope.row.id!, 0)"> 删除 </el-button>
-          <el-button type="primary" link @click="handleViewDetail(scope.row)"> 查看详情 </el-button>
+          <!-- 待审核(status === 0):只显示查看详情 -->
+          <template v-if="scope.row.status === 0 || scope.row.status === '0'">
+            <el-button type="primary" link @click="handleViewDetail(scope.row)"> 查看详情 </el-button>
+          </template>
+
+          <!-- 已驳回(status === 2):显示编辑、删除、查看详情 -->
+          <template v-else-if="scope.row.status === 2 || scope.row.status === '2'">
+            <el-button type="primary" link @click="editPersonnel(scope.row, 0)"> 编辑 </el-button>
+            <el-button type="primary" link @click="deletePersonnelHandler(scope.row.id!, 0)"> 删除 </el-button>
+            <el-button type="primary" link @click="handleViewDetail(scope.row)"> 查看详情 </el-button>
+          </template>
+
+          <!-- 已通过(status === 1):显示编辑、下线、置顶/取消置顶、删除、查看详情 -->
+          <template v-else-if="scope.row.status === 1 || scope.row.status === '1'">
+            <el-button type="primary" link @click="editPersonnel(scope.row, 0)"> 编辑 </el-button>
+            <el-button
+              v-if="scope.row.onlineStatus === 0 || scope.row.onlineStatus === '0'"
+              type="primary"
+              link
+              @click="handleOffline(scope.row)"
+            >
+              下线
+            </el-button>
+            <el-button
+              v-else-if="scope.row.onlineStatus === 1 || scope.row.onlineStatus === '1'"
+              type="primary"
+              link
+              @click="handleOnline(scope.row)"
+            >
+              上线
+            </el-button>
+            <el-button
+              v-if="scope.row.topStatus === 1 || scope.row.topStatus === '1'"
+              type="primary"
+              link
+              @click="handleUnpin(scope.row)"
+            >
+              取消置顶
+            </el-button>
+            <el-button v-else type="primary" link @click="handlePin(scope.row)"> 置顶 </el-button>
+            <el-button type="primary" link @click="deletePersonnelHandler(scope.row.id!, 0)"> 删除 </el-button>
+            <el-button type="primary" link @click="handleViewDetail(scope.row)"> 查看详情 </el-button>
+          </template>
+
+          <!-- 其他状态:默认显示查看详情 -->
+          <template v-else>
+            <el-button type="primary" link @click="handleViewDetail(scope.row)"> 查看详情 </el-button>
+          </template>
         </template>
       </ProTable>
     </div>
@@ -467,26 +494,9 @@ const columns = reactive<ColumnProps<any>[]>([
     }
   },
   {
-    prop: "submissionTime",
+    prop: "createdTime",
     label: "提交时间",
-    width: 180,
-    isShow: false,
-    search: {
-      el: "date-picker",
-      props: {
-        type: "datetimerange",
-        "range-separator": "至",
-        "start-placeholder": "请输入",
-        "end-placeholder": "请输入",
-        format: "YYYY-MM-DD HH:mm:ss",
-        "value-format": "YYYY-MM-DD HH:mm:ss"
-      },
-      key: "dateRange",
-      order: 5
-    },
-    render: (scope: any) => {
-      return scope.row.submissionTime || formatTime(scope.row.createdTime) || "—";
-    }
+    width: 180
   },
   { prop: "operation", label: "操作", fixed: "right", minWidth: 350 }
 ]);
@@ -531,10 +541,12 @@ const dataCallback = (data: any) => {
     tags: person.tag ? person.tag.split(",").map((tag: string) => tag.trim()) : [],
     description: person.personalIntroduction || "",
     onlineStatus: person.onlineStatus,
-    approvalStatus: person.status || person.approvalStatus, // 优先使用 status
+    status: person.status, // 审核状态:0 待审核,1 审核通过,2 审核拒绝
+    approvalStatus: person.status, // 保留 approvalStatus 用于表格列显示
     submissionTime: person.submissionTime || person.createTime || person.createdTime,
     createdTime: person.createTime || person.createdTime,
-    isPinned: person.isPinned || person.isTop || false
+    topStatus: person.topStatus, // 置顶状态:0 未置顶,1 已置顶
+    isPinned: person.topStatus === 1 || person.topStatus === "1" || person.isPinned || person.isTop || false // 保留 isPinned 用于兼容
   }));
 
   return {