shenwu 2 روز پیش
والد
کامیت
55855d918c
5فایلهای تغییر یافته به همراه22 افزوده شده و 6 حذف شده
  1. 1 1
      config/routes.tsx
  2. 1 0
      src/access.ts
  3. 7 2
      src/app.tsx
  4. 1 0
      src/pages/MiniApp/BookManage/Short/index.tsx
  5. 12 3
      src/pages/MiniApp/BookManage/Short/tableConfig.tsx

+ 1 - 1
config/routes.tsx

@@ -36,7 +36,7 @@ const newMenu = [
     icon: 'icon-yingyongguanli',
     path: '/distributor/appList',
     access: "isShow",
-    component: './Distributor/AppList',
+    component: './Distributor/AppList'
   },
   {
     name: 'distributor.corpManage',

+ 1 - 0
src/access.ts

@@ -6,6 +6,7 @@ export default function access(initialState: { menuType: "distributor" | "miniAp
     isShow: (route: { name: string; }) => {
       if (initialState?.menuType) {
         const { menuType, currentUser } = initialState;
+        console.log(route.name, menuType, currentUser)
         let regex = new RegExp(`^${menuType}\\.`);
         if (route.name.match(/(distributor.appManage)|(distributor.account)|(distributor.corpManage)/ig)) {
           return currentUser?.manageAccount && route.name.match(regex)

+ 7 - 2
src/app.tsx

@@ -22,7 +22,7 @@ export async function getInitialState(): Promise<{
   loading?: boolean;
   menuType: "distributor" | "miniApp",
   navTheme?: "2" | "3",
-  selectApp?: { appId: string, id: string, appName: string, appType: number, appCategory: 1 | 2 ,appKey:string} | null,
+  selectApp?: { appId: string, id: string, appName: string, appType: number, appCategory: 1 | 2, appKey: string } | null,
   token: any,
 }> {
   // 如果不是登录页面,执行
@@ -74,6 +74,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
             let icon = menu.icon.replace("-wx", '-dy')
             return { ...menu, icon }
           }
+          //子用户只有一个菜单隐藏侧边栏菜单
+          if (menu.name && menu.name.includes("distributor.appList") && !initialState?.currentUser?.manageAccount) {
+            return { ...menu, menuRender: false }
+          }
+          // console.log("menu", menu)
           return menu
         })
         // console.log("newMenu", newMenu)
@@ -111,7 +116,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
         history.push(loginPath);
       }
       // 假如普通用户重定向至应用列表
-      if(!initialState?.currentUser?.manageAccount && location?.pathname === "/distributor/account"){
+      if (!initialState?.currentUser?.manageAccount && location?.pathname === "/distributor/account") {
         history.push("/distributor/appList");
       }
     },

+ 1 - 0
src/pages/MiniApp/BookManage/Short/index.tsx

@@ -177,6 +177,7 @@ const Page: React.FC = (props: Props) => {
     };
     // 批量提审到腾讯
     const submitToTencentFn = () => {
+        console.log(editSelectedRow)
         let bookIds = editSelectedRow?.map(item => item.bookId)
         let { appId, appType } = publicData
         submitToTencent.run({ bookIds, appId, appType }).then(res => {

+ 12 - 3
src/pages/MiniApp/BookManage/Short/tableConfig.tsx

@@ -221,13 +221,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
         {
             title: '审核结果',
             tooltip: <span>书籍提交到腾讯平台审核的结果</span>,
-            dataIndex: 'publishVO',
-            key: 'publishVO',
+            dataIndex: 'auditStatus',
+            key: 'auditStatus',
             width: 100,
             align: 'center',
             hideInSearch: true,
             render: (_, b: any) => {
-                console.log("aaaa", b.publishVO)
                 let a = b.publishVO
                 let obj: any = [{ value: "default", text: "未提审" }, { value: "processing", text: "审核中" }, { value: "error", text: "审核失败" }, { value: "success", text: "审核成功" }]
                 return a ? <Badge text={obj[a.auditStatus].text} status={obj[a.auditStatus].value} /> : <Badge text={"未提审"} status={"default"} />
@@ -272,6 +271,16 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             colSize: 1,
             valueEnum: new Map(authList?.map(({ id, authorName }) => [id, authorName]))
         },
+        {
+            title: "审核状态",
+            dataIndex: 'auditStatus',
+            valueType: 'select',
+            hideInTable: true,
+            fieldProps: { showSearch: true, placeholder: '请选择分类' },
+            colSize: 1,
+            valueEnum: new Map([{ value: "0", text: "未提审" }, { value: "1", text: "审核中" }, { value: "2", text: "审核失败" }, { value: "3", text: "审核成功" }].map(({ value, text }) => [value, text]))
+
+        },
         {
             title: "频道",
             dataIndex: 'workDirection',