فهرست منبع

fix(bugs): 修改权限优化

tangning 3 سال پیش
والد
کامیت
f761e10058

+ 1 - 1
src/locales/lang/zh-CN/routes/rightsEnterprises.ts

@@ -38,7 +38,7 @@ export default {
     9: '未过期',
   },
   addcamera: '新增相机权益',
-  maxlength: '请输入合理的数量!',
+  maxlength: '请输入0-999的权益数!',
   integer: '权益数应为正整数!',
   cameraTitle: '相机权益',
 };

+ 2 - 2
src/views/advertisement/schemas.ts

@@ -67,7 +67,7 @@ export const padsSchemas: FormSchema[] = [
       placeholder: '推荐排序',
       type: 'number',
       min: 0,
-      max: 99999,
+      max: 99999999,
     },
     required: true,
     rules: [
@@ -141,7 +141,7 @@ export const schemas: FormSchema[] = [
     componentProps: {
       maxLength: 5,
       placeholder: '轮播排序',
-      max: 99999,
+      max: 99999999,
       type: 'number',
       min: 0,
     },

+ 2 - 1
src/views/product/list.data.ts

@@ -107,6 +107,7 @@ export const columns: BasicColumn[] = [
   {
     title: '上架状态',
     dataIndex: 'isOnSale',
+    ifShow: showAction,
     width: 180,
     customRender: ({ record }) => {
       if (!Reflect.has(record, 'pendingStatus')) {
@@ -149,7 +150,7 @@ function showAction(): boolean {
   if (getCheckRole(['staff']) && getEquity([1, 2])) {
     return true;
   }
-  if (getCheckRole(['company_admin']) && getEquity([1])) {
+  if (getCheckRole(['company_admin']) && getEquity([2])) {
     return true;
   }
   if (getCheckRole(['super', 'plat_admin'])) {

+ 3 - 3
src/views/product/list.vue

@@ -4,7 +4,7 @@
       @register="registerTable"
       :rowSelection="{ type: 'checkbox', onChange: onSelectChange }"
     >
-      <template #toolbar v-if="!getCheckRole('tourist')">
+      <template #toolbar v-if="!getCheckRole('tourist') && showAction()">
         <a-button type="primary" @click="handleCreate"> 新增商品</a-button>
         <PopConfirmButton
           title="是否确定批量删除?"
@@ -179,10 +179,10 @@
         if (getCheckRole(['staff']) && getEquity([1, 2])) {
           return true;
         }
-        if (getCheckRole(['company_admin']) && getEquity([1])) {
+        if (getCheckRole(['company_admin']) && getEquity([2])) {
           return true;
         }
-        if (getCheckRole(['super', 'plat_admin', 'company_admin'])) {
+        if (getCheckRole(['super', 'plat_admin'])) {
           return true;
         }
         return false;

+ 2 - 2
src/views/rightsEnterprises/addModal.vue

@@ -80,7 +80,7 @@
           edit: true,
           // slots: { customRender: 'subNum' },
           editRule: async (text) => {
-            var regPos = /(^[1-9]\d*$)/; // 非负整数
+            var regPos = /^[0-9]\d*$/; // 整数
             if (text > 999 || text < -1) {
               return t('routes.rightsEnterprises.maxlength');
             } else if (!regPos.test(text)) {
@@ -237,7 +237,7 @@
           });
         });
         if (SunNum == 0) {
-          return createMessage.warning('不支持两个权益为空');
+          return createMessage.warning('不支持两个权益为空');
         }
         let res = await saveRights({
           companyId: modelRef.companyId,

+ 4 - 1
src/views/rightsEnterprises/list.vue

@@ -32,7 +32,8 @@
               ifShow:
                 getCheckRole([RoleEnum.PLAT_ADMIN]) &&
                 (record.state == 0 || record.state == 1) &&
-                !!record.userId,
+                !!record.userId &&
+                dayjs(record.activationTime).isAfter(dayjs()),
               color: 'error',
               onClick: handleUpBind.bind(null, record),
             },
@@ -55,6 +56,7 @@
   import { staffList, unbindRights } from '/@/api/rightsEnterprises/list';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  import dayjs from 'dayjs';
   import { RoleEnum } from '/@/enums/roleEnum';
   import { useGo } from '/@/hooks/web/usePage';
   import { Time } from '/@/components/Time';
@@ -307,6 +309,7 @@
         surplusSubNum,
         getCheckRole,
         getNumByStaffData,
+        dayjs,
       };
     },
   });

+ 1 - 1
src/views/staff/detailsModal.vue

@@ -247,7 +247,7 @@
             field: 'roleId',
             component: 'ApiSelect',
             componentProps: {
-              disabled: data.roleId == 2 ? false : data.id ? getCheckRole('plat_admin') : false,
+              disabled: data.roleId == 2 ? false : data.id ? true : false,
               api: getRoleListByParam,
               labelField: 'roleName',
               valueField: 'roleId',