Selaa lähdekoodia

feat: 增加计量授权用户的相关权限以及功能鉴权

lanjianrong 3 vuotta sitten
vanhempi
commit
b1ef17a97f

+ 1 - 1
src/api/sys/model/officeModel.ts

@@ -1,7 +1,7 @@
 /**
  * @description: Request list interface parameters
  */
-export type OfficeListParams = { categoryId?: string }
+export type OfficeListParams = { category?: string }
 
 export interface OfficeListItem {
   cid: string

+ 3 - 2
src/api/sys/model/projectModel.ts

@@ -30,9 +30,9 @@ export interface ProjectListItem {
 export type ProjectUpdateOrCreateParams = {
   id: string
   name: string
-  insideCategoryId: string
+  insideCategoryId?: string
   insideCategory: string
-  categoryId: string
+  categoryId?: string
   category: string
   staffId: string
   staffName: string
@@ -58,6 +58,7 @@ export type ProjectAccountItem = {
   mobile: string
   telephone: string
   isAdmin: number
+  jlAuth: number
   accountGroup: number
   enable: number
   contractPermission: string

+ 1 - 1
src/store/modules/user.ts

@@ -160,7 +160,7 @@ export const useUserStore = defineStore({
     },
 
     async getToken() {
-      await getXsrfToken('234')
+      await getXsrfToken('gs01')
       const token = getToken() as string
       this.setToken(token)
     },

+ 11 - 0
src/views/dashboard/project-detail/components/account.vue

@@ -189,6 +189,17 @@
         await nextTick()
         removeSchemaByFiled('password')
         formElRef.value?.setFieldsValue({ ...item })
+        if (item.jlAuth) {
+          formElRef.value?.updateSchema({
+            field: 'account',
+            component: 'Input',
+            label: '登录账号',
+            required: true,
+            componentProps: {
+              disabled: true
+            }
+          })
+        }
       }
 
       function submitModal() {

+ 16 - 14
src/views/dashboard/project-detail/components/info.vue

@@ -34,7 +34,9 @@
 
       const { createMessage } = useMessage()
       const officeStore = useOfficeStore()
-      const options = computed(() => officeStore.getCategoryOptions)
+      const options = computed(() =>
+        officeStore.getCategoryOptions.map(item => ({ label: item.label, value: item.label }))
+      )
       const staffOptions = computed(() => officeStore.getCategoriedStaff)
 
       const schemas = computed<FormSchema[]>(() => [
@@ -80,7 +82,7 @@
           required: true
         },
         {
-          field: 'insideCategoryId',
+          field: 'insideCategory',
           component: 'Select',
           componentProps: {
             options,
@@ -91,7 +93,7 @@
           required: true
         },
         {
-          field: 'categoryId',
+          field: 'category',
           component: 'Select',
           label: '销售负责人',
           componentProps: {
@@ -158,29 +160,29 @@
       })
       async function checkOffice() {
         officeStore.checkStaffList()
-        if (props.info.categoryId) {
-          await officeStore.getStaffWithCategoryIdAction({ categoryId: props.info.categoryId })
+        if (props.info.category) {
+          await officeStore.getStaffWithCategoryIdAction({ category: props.info.category })
         }
       }
       checkOffice()
       onMountedOrActivated(async () => {
         await updateSchema([
           {
-            field: 'insideCategoryId',
+            field: 'insideCategory',
             component: 'Select',
             label: '所在办事处',
             componentProps: { options, showArrow: true },
             required: true
           },
           {
-            field: 'categoryId',
+            field: 'category',
             component: 'Select',
             label: '销售负责人',
             componentProps: {
               options,
               showArrow: true,
               onChange: (value: string) => {
-                officeStore.getStaffWithCategoryIdAction({ categoryId: value })
+                officeStore.getStaffWithCategoryIdAction({ category: value })
               }
             },
             colProps: {
@@ -194,8 +196,8 @@
 
       const handleOnSave = async (values: {
         name: string
-        insideCategoryId: string
-        categoryId: string
+        insideCategory: string
+        category: string
         staffId: string
         remark: string
         status: string
@@ -207,11 +209,11 @@
           category: '',
           staffName: ''
         }
-        if (values.insideCategoryId) {
-          newVal.insideCategory = options.value.find(item => item.value === values.insideCategoryId)?.label || ''
+        if (values.insideCategory) {
+          newVal.insideCategory = options.value.find(item => item.value === values.insideCategory)?.label || ''
         }
-        if (values.categoryId) {
-          newVal.category = options.value.find(item => item.value === values.categoryId)?.label || ''
+        if (values.category) {
+          newVal.category = options.value.find(item => item.value === values.category)?.label || ''
         }
         if (values.staffId) {
           newVal.staffName = staffOptions.value.find(item => item.value === values.staffId)?.label || ''