2 Commits baea27018a ... e467be69b8

Author SHA1 Message Date
  zhongxiaoyu e467be69b8 Merge branch 'master' of http://120.26.64.82:10880/BFFE/SZYGM1.0 1 year ago
  zhongxiaoyu ccd33e725f 请求携带按钮权限id 1 year ago
30 changed files with 117 additions and 29 deletions
  1. 15 8
      src/utils/axiosReq.ts
  2. 8 5
      src/views/BasicsData/airlineCompany/index.vue
  3. 3 0
      src/views/BasicsData/airportCompany/index.vue
  4. 3 0
      src/views/BasicsData/airportInfo/airportInfoChild/index.vue
  5. 3 0
      src/views/BasicsData/airportInfo/positionSetting/index.vue
  6. 3 0
      src/views/BasicsData/cargoInformation/index.vue
  7. 3 0
      src/views/BasicsData/containerMaintenance/index.vue
  8. 3 0
      src/views/BasicsData/deployNode/index.vue
  9. 3 0
      src/views/BasicsData/equipmentMaintenance/index.vue
  10. 9 1
      src/views/BasicsData/hiddenCompany/index.vue
  11. 3 0
      src/views/BasicsData/modelMaintenance/index.vue
  12. 3 0
      src/views/BasicsData/shippingSpace/index.vue
  13. 3 0
      src/views/BasicsData/specialCargoMaintenance/index.vue
  14. 3 0
      src/views/systemSettings/datastructure/datastructureTerm.vue
  15. 3 0
      src/views/systemSettings/datastructure/index.vue
  16. 3 0
      src/views/systemSettings/messageTemplate/index.vue
  17. 3 0
      src/views/systemSettings/protocolManagement/index.vue
  18. 3 0
      src/views/systemSettings/queryTemplate/index.vue
  19. 1 0
      src/views/systemSettings/queryTemplate/queryTemplateAdd.vue
  20. 3 0
      src/views/systemSettings/queryTemplate/queryTemplateColumn.vue
  21. 1 0
      src/views/systemSettings/queryTemplate/queryTemplateEdit.vue
  22. 6 2
      src/views/systemSettings/serviceManagement/index.vue
  23. 4 2
      src/views/systemSettings/serviceManagement/serviceEdit.vue
  24. 4 1
      src/views/systemSettings/sourceTube/index.vue
  25. 4 2
      src/views/userManagement/account/index.vue
  26. 4 2
      src/views/userManagement/accountGroup/index.vue
  27. 3 1
      src/views/userManagement/application/index.vue
  28. 2 1
      src/views/userManagement/hooks/useTable.ts
  29. 4 2
      src/views/userManagement/permission/index.vue
  30. 4 2
      src/views/userManagement/role/index.vue

+ 15 - 8
src/utils/axiosReq.ts

@@ -12,13 +12,20 @@ const service: any = axios.create()
 // 请求拦截
 service.interceptors.request.use(
   (request: AxiosReqTy) => {
-    const route = router.currentRoute
-    const data = request.data!
     const authMap = useUserStore().authMap
-    if (!data.id || data.id !== DATACONTENT_ID.loginId) {
-      const role = route.value.meta?.roles?.[0]
-      if (role && authMap[role]) {
-        request.headers['auth-id'] = authMap[role]
+    const data = request.data!
+    if (data.btnAuth) {
+      if (authMap[data.btnAuth]) {
+        request.headers['auth-id'] = authMap[data.btnAuth]
+      }
+      delete data.btnAuth
+    } else {
+      const route = router.currentRoute
+      if (!data.id || data.id !== DATACONTENT_ID.loginId) {
+        const role = route.value.meta?.roles?.[0]
+        if (role && authMap[role]) {
+          request.headers['auth-id'] = authMap[role]
+        }
       }
     }
     // token setting
@@ -55,7 +62,7 @@ service.interceptors.request.use(
 )
 // 响应拦截
 service.interceptors.response.use(
-  (response) => {
+  response => {
     const res = response.data
 
     // if the custom code is not 20000, it is judged as an error.
@@ -89,7 +96,7 @@ service.interceptors.response.use(
       return res
     }
   },
-  (error) => {
+  error => {
     const des500 = `${error}`.split(' ').includes('500')
     if (des500) {
       ElMessage({

+ 8 - 5
src/views/BasicsData/airlineCompany/index.vue

@@ -219,10 +219,12 @@ const submitForm = () => {
   });
 };
 const resetTable = () => {
-  page.value = 0;
-  noMore.value = false;
-  tableData.value = [];
-};
+  page.value = 0
+  noMore.value = false
+  tableData.value = []
+}
+
+const btnAuthMap = [, 'new_airlines_button', 'airline_editor_button', 'airlines_delete_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -232,7 +234,8 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
-    });
+      btnAuth: btnAuthMap[data.event],
+    })
     if (code == 0) {
       ElMessage.success(`操作成功`);
       // this.$message.success("操作成功");

+ 3 - 0
src/views/BasicsData/airportCompany/index.vue

@@ -224,6 +224,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_airport_companies_button', 'airport_company_editor_button', 'airport_company_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -233,6 +235,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/airportInfo/airportInfoChild/index.vue

@@ -264,6 +264,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'newly_added_terminal_button', 'terminal_editing_button', 'terminal_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -277,6 +279,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/airportInfo/positionSetting/index.vue

@@ -241,6 +241,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'position_addition_button', 'position_edit_button', 'location_delete_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -253,6 +255,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/cargoInformation/index.vue

@@ -222,6 +222,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_freight_forwarder_button', 'freight_forwarder_editor_button', 'freight_forwarder_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -231,6 +233,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/containerMaintenance/index.vue

@@ -221,6 +221,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'container_addition_button', 'container_edit_button', 'container_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -230,6 +232,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/deployNode/index.vue

@@ -207,6 +207,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_node_button', 'node_editing_button', 'node_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -216,6 +218,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/equipmentMaintenance/index.vue

@@ -235,12 +235,15 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'equipment_addition_button', 'device_editing_button', 'device_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 9 - 1
src/views/BasicsData/hiddenCompany/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-statuser="true" @addForm="addForm">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        powerData="new_airlines_button"
+        @addForm="addForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">屏蔽航司维护</div>
@@ -232,6 +237,8 @@ const resetTable = () => {
   noMore.value = false
   tableData.value = []
 }
+
+const btnAuthMap = [, 'new_airlines_button', 'airline_editor_button', 'airlines_delete_button']
 //新增-编辑-删除
 const generalDataReception = async data => {
   try {
@@ -241,6 +248,7 @@ const generalDataReception = async data => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     })
     if (code == 0) {
       ElMessage.success(`操作成功`)

+ 3 - 0
src/views/BasicsData/modelMaintenance/index.vue

@@ -233,6 +233,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_model_button', 'airline_editor_button', 'model_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   console.log(data);
@@ -243,6 +245,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/shippingSpace/index.vue

@@ -224,6 +224,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_cabin_button', 'cabin_editor_button', 'cabin_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -237,6 +239,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event]
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/BasicsData/specialCargoMaintenance/index.vue

@@ -222,6 +222,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_special_goods_type_button', 'edit_special_cargo_type_button', 'special_cargo_type_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -231,6 +233,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/systemSettings/datastructure/datastructureTerm.vue

@@ -463,6 +463,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'add_data_item_button', 'data_item_editing_button', 'data_item_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -476,6 +478,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/systemSettings/datastructure/index.vue

@@ -306,6 +306,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_data_structure_button', 'data_structure_editing_button', 'data_structure_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -315,6 +317,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/systemSettings/messageTemplate/index.vue

@@ -200,6 +200,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'adding_message_template', 'message_template_editing', 'message_template_deletion']
 //新增-编辑-删除
 const generalDataReception = async (formData) => {
   try {
@@ -207,6 +209,7 @@ const generalDataReception = async (formData) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(formData),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/systemSettings/protocolManagement/index.vue

@@ -290,6 +290,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'agreement_addition', 'arotocol_Editing', 'agreement_deletion']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -299,6 +301,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 3 - 0
src/views/systemSettings/queryTemplate/index.vue

@@ -223,6 +223,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'add_query_template_button', 'query_template_editing_button', 'query_template_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -232,6 +234,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code === "0") {
       ElMessage.success(`操作成功`);

+ 1 - 0
src/views/systemSettings/queryTemplate/queryTemplateAdd.vue

@@ -152,6 +152,7 @@ const preserFormer = async () => {
     const res = await GeneralDataReception({
       serviceId: SERVICE_ID.sysQueryTabId,
       dataContent: JSON.stringify(params),
+      btnAuth: 'add_query_template_button',
     });
     if (Number(res.code) === 0) {
       ElMessage.success(`成功`);

+ 3 - 0
src/views/systemSettings/queryTemplate/queryTemplateColumn.vue

@@ -485,6 +485,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'column_setting_add_button', 'column_settings_edit_button', 'column_setting_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -498,6 +500,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 1 - 0
src/views/systemSettings/queryTemplate/queryTemplateEdit.vue

@@ -155,6 +155,7 @@ const preserFormer = async () => {
     const res = await GeneralDataReception({
       serviceId: SERVICE_ID.sysQueryTabId,
       dataContent: JSON.stringify(params),
+      btnAuth: 'query_template_editing_button'
     });
     if (Number(res.code) === 0) {
       ElMessage.success(`成功`);

+ 6 - 2
src/views/systemSettings/serviceManagement/index.vue

@@ -194,7 +194,7 @@ const getSelectOptions = async (id: number) => {
   try {
     const {
       code,
-      returnData: { listValues },
+      returnData,
       message,
     }: SelectOptionQueryResult = await Query({
       id,
@@ -203,6 +203,7 @@ const getSelectOptions = async (id: number) => {
     if (Number(code) !== 0) {
       throw new Error(message ?? "失败");
     }
+    const listValues = returnData.listValues || returnData
     const options = listValues.map(({ k, v, setlabel, setvalue }) => ({
       k,
       v,
@@ -336,6 +337,7 @@ const changeServiceState = async (serviceID: number, runState: string) => {
     } = await Query({
       id: DATACONTENT_ID.sysServiceNodeList,
       dataContent: [serviceID],
+      btnAuth: 'service_stop_button'
     });
     if (Number(code) !== 0) {
       throw new Error(message ?? "失败");
@@ -405,6 +407,7 @@ const deleteService = async () => {
     const { code, message } = await GeneralDataReception({
       serviceId: SERVICE_ID.sysServiceEdit,
       dataContent: JSON.stringify(dataContent),
+      btnAuth: 'service_deletion_button'
     });
     if (Number(code) === 0) {
       ElMessage.success(message ?? "成功");
@@ -419,7 +422,7 @@ const addServiceDialogShow = () => {
   serviceDialogType.value = "add";
   msgTitle.value = "新增服务管理";
   serviceDialogVisible.value = true;
-  console.log(queryTemplateIDMap, selectOptionMap);
+  // console.log(queryTemplateIDMap, selectOptionMap);
 };
 const addServiceDialogHide = () => {
   serviceFormRef.value?.resetFields();
@@ -491,6 +494,7 @@ const createService = async () => {
     const { code, message } = await GeneralDataReception({
       serviceId: SERVICE_ID.sysServiceEdit,
       dataContent: JSON.stringify(dataContent),
+      btnAuth: 'service_addition_button',
     });
     if (Number(code) === 0) {
       ElMessage.success(message ?? "成功");

+ 4 - 2
src/views/systemSettings/serviceManagement/serviceEdit.vue

@@ -417,7 +417,7 @@
                 @clear="logSearchClearHandler"
               />
               <el-button
-                size="mini"
+                size="default"
                 type="primary"
                 style="margin-left: 16px"
                 @click="logSearchHandler"
@@ -597,7 +597,7 @@ const getSelectOptions = async (id: number) => {
   try {
     const {
       code,
-      returnData: { listValues },
+      returnData,
       message,
     }: SelectOptionQueryResult = await Query({
       id,
@@ -606,6 +606,7 @@ const getSelectOptions = async (id: number) => {
     if (Number(code) !== 0) {
       throw new Error(message ?? '失败')
     }
+    const listValues = returnData.listValues || returnData
     const options = listValues.map(({ k, v, setlabel, setvalue }) => ({
       k,
       v,
@@ -704,6 +705,7 @@ const serviceSubmitHandler = async () => {
     const { code, message } = await GeneralDataReception({
       serviceId: SERVICE_ID.sysServiceEdit,
       dataContent: JSON.stringify(dataContent),
+      btnAuth: 'service_editor_button',
     })
     if (Number(code) === 0) {
       ElMessage.success(message ?? '成功')

+ 4 - 1
src/views/systemSettings/sourceTube/index.vue

@@ -218,7 +218,7 @@ const getSelectData = async (id, name) => {
   });
   if (code == 0) {
     tableOptionser.value = returnData.listValues;
-    tableOptionCopys.value = _.cloneDeep(returnData.listValues);
+    // tableOptionCopys.value = _.cloneDeep(returnData.listValues);
   } else {
     tableOptionser.value = [];
   }
@@ -280,6 +280,8 @@ const resetTable = () => {
   noMore.value = false;
   tableData.value = [];
 };
+
+const btnAuthMap = [, 'new_data_source_button', 'data_source_editing_button', 'data_source_deletion_button']
 //新增-编辑-删除
 const generalDataReception = async (data) => {
   try {
@@ -289,6 +291,7 @@ const generalDataReception = async (data) => {
     const { code } = await GeneralDataReception({
       serviceId: serviceId.value,
       dataContent: JSON.stringify(data),
+      btnAuth: btnAuthMap[data.event],
     });
     if (code == 0) {
       ElMessage.success(`操作成功`);

+ 4 - 2
src/views/userManagement/account/index.vue

@@ -161,6 +161,7 @@ const pageInit = () => {
   accountList();
 };
 
+const btnAuthMap = [, 'add_account_button', 'account_editing_button', 'account_deletion_button']
 //增删改
 const dataChange = async (event, data) => {
   const { code, message } = await table.dataChange(
@@ -168,8 +169,9 @@ const dataChange = async (event, data) => {
     event,
     {
       ...data,
-      user_status: data.user_status != 0 ? 2 : 0
-    }
+      user_status: data.user_status != 0 ? 2 : 0,
+    },
+    btnAuthMap[event]
   );
   if (code == 0) {
     ElMessage.success(message);

+ 4 - 2
src/views/userManagement/accountGroup/index.vue

@@ -103,7 +103,8 @@ const remove = async () => {
     const { code, message } = await table.dataChange(
       SERVICE_ID.accountGroupScId,
       3,
-      rowIndex.value
+      rowIndex.value,
+      'account_group_deletion_button'
     );
 
     if (code == 0) {
@@ -127,7 +128,8 @@ const saveAddAccount = async (event) => {
     const { code, message } = await table.dataChange(
       SERVICE_ID.accountGroupScId,
       event,
-      ruleForm.value
+      ruleForm.value,
+      event == 1 ? 'add_account_group_button' : 'account_group_editing_button'
     );
     if (code == 0) {
       ElMessage.success(message);

+ 3 - 1
src/views/userManagement/application/index.vue

@@ -110,12 +110,14 @@ const addApp = () => {
   ruleForm.value = {};
 };
 
+const btnAuthMap = [, 'add_application_button', 'apply_edit_button', 'apply_delete_button']
 //增删改
 const dataChange = async (event, data) => {
   const { code, message } = await table.dataChange(
     SERVICE_ID.appScId,
     event,
-    data
+    data,
+    btnAuthMap[event]
   );
   if (code == 0) {
     ElMessage.success(message);

+ 2 - 1
src/views/userManagement/hooks/useTable.ts

@@ -34,11 +34,12 @@ const getTable = async (id: IdType, dataContent) => {
   }
 }
 
-const dataChange = async (id: IdType, event: IdType, data) => {
+const dataChange = async (id: IdType, event: IdType, data: any, btnAuth?: string) => {
   const obj = Object.assign(data, { event })
   const { code, message } = await GeneralDataReception({
     serviceId: id,
     dataContent: JSON.stringify(obj),
+    btnAuth
   })
   return {
     code,

+ 4 - 2
src/views/userManagement/permission/index.vue

@@ -199,7 +199,7 @@ const renderChange = (data) => {
     delete data.children;
   }
   data.event = 2;
-  changeAuth(data);
+  changeAuth(data, 'switch');
 };
 
 // 重置表单
@@ -277,11 +277,13 @@ const addAuth = () => {
   });
 };
 
+const btnAuthMap = [, 'button_permission_item_add_button', 'permission_item_editing_button', 'permission_item_deletion_button']
 //增删改
-const changeAuth = async (obj?, type?) => {
+const changeAuth = async (obj: any, type?: string) => {
   const { code, message } = await GeneralDataReception({
     serviceId: SERVICE_ID.authScId,
     dataContent: JSON.stringify(obj),
+    btnAuth: type === 'switch' ? 'permission_item_status_switch_button' : btnAuthMap[obj.event]
   });
   if (code == 0) {
     ElMessage.success(message);

+ 4 - 2
src/views/userManagement/role/index.vue

@@ -142,13 +142,15 @@ const addApp = () => {
   dT.value = "add";
   ruleForm.value = {};
 };
-// 新增/编辑角色
+const btnAuthMap = [, 'new_role_button', 'role_editing_button', 'role_deletion_button']
+// 新增/编辑/删除角色
 const saveRole = async (event, data) => {
   try {
     const { code, message } = await table.dataChange(
       SERVICE_ID.roleMsgId,
       event,
-      data
+      data,
+      btnAuthMap[event]
     );
     if (code == 0) {
       ElMessage.success(message);