chenrui  1 éve
szülő
commit
20d854ed33

+ 6 - 4
src/components/SimpleTable/index.vue

@@ -60,6 +60,8 @@ import { Options, useTableFilterAndSort } from "@/hooks/useTableFilterAndSort";
 import { ElTable } from "element-plus";
 import { useTableSettingsStore } from "@/store/tableSettings";
 import { Query } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
+const router = useRouter();
 const dataContent = ref({});
 const conditon = ref("");
 type SummaryMethod<T> = (data: {
@@ -272,12 +274,12 @@ const computedColumnProps = computed(() => {
   });
 });
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
 };

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

@@ -152,7 +152,8 @@ import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
-
+import { useUserStore } from "@/store/user";
+const router = useRouter();
 const formRules = useElement().formRules;
 const page = ref(0); //分页参数
 const dataContent = ref({});
@@ -261,12 +262,12 @@ const delRest = () => {
   flag.value = false;
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 4
src/views/BasicsData/airportCompany/index.vue

@@ -134,8 +134,10 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import * as _ from "lodash";
 import { ElMessage } from "element-plus";
+const router = useRouter();
 const power = ref<string>("new_airlines_button"); //权限
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
@@ -266,12 +268,12 @@ const getSelectData = async (id?, name?) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 5 - 4
src/views/BasicsData/airportInfo/index.vue

@@ -212,6 +212,7 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { translateDataToTreeAll } from "@/utils/validate";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import { ElMessage } from "element-plus";
 import Cookies from "js-cookie";
 const formRules = useElement().formRules;
@@ -489,12 +490,12 @@ const handleNodeClick = (data) => {
   gueryRoles();
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 4
src/views/BasicsData/cargoInformation/index.vue

@@ -117,7 +117,9 @@ import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
+import { useUserStore } from "@/store/user";
 const formRules = useElement().formRules;
+const router = useRouter();
 const page = ref<number>(0); //分页参数
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
@@ -240,12 +242,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 2
src/views/BasicsData/containerMaintenance/index.vue

@@ -115,10 +115,12 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { useUserStore } from "@/store/user";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
+const router = useRouter();
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
 const rowTitle = ref<string>("");
@@ -241,10 +243,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    needPage: ++page.value,
-    dataContent: Object.values(dataContent.value),
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 4
src/views/BasicsData/deployNode/index.vue

@@ -95,8 +95,10 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import { ElMessage } from "element-plus";
 const formRules = useElement().formRules;
+const router = useRouter();
 const page = ref<number>(0); //分页参数
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
@@ -208,12 +210,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 2
src/views/BasicsData/equipmentMaintenance/index.vue

@@ -143,9 +143,11 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import { ElMessage } from "element-plus";
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
+const router = useRouter();
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
 const rowTitle = ref<string>("");
@@ -272,10 +274,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    needPage: ++page.value,
-    dataContent: Object.values(dataContent.value),
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 2
src/views/BasicsData/hiddenCompany/index.vue

@@ -82,7 +82,8 @@ import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
 import { CommonTableColumn, CommonValue } from "~/common";
-
+import { useUserStore } from "@/store/user";
+const router = useRouter();
 const tableColumns = [
   {
     columnLabel: "航司二字码",
@@ -198,10 +199,13 @@ const delRest = () => {
   flag.value = false;
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
     needPage: ++page.value,
-    dataContent: Object.values(dataContent.value),
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   if (conditon.value == null) {

+ 5 - 2
src/views/BasicsData/modelMaintenance/index.vue

@@ -112,6 +112,7 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import { ElMessage } from "element-plus";
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
@@ -246,10 +247,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    needPage: ++page.value,
-    dataContent: Object.values(dataContent.value),
+    ddataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 6 - 4
src/views/BasicsData/specialCargoMaintenance/index.vue

@@ -116,8 +116,10 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import { ElMessage } from "element-plus";
 const formRules = useElement().formRules;
+const router = useRouter();
 const page = ref<number>(0); //分页参数
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
@@ -241,12 +243,12 @@ const btnClick = (row, index, param) => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 22 - 21
src/views/dataQuery/components/DataQueryView/index.vue

@@ -243,7 +243,8 @@ import { useTable } from "./useTable";
 import { useTableColumnSet } from "@/hooks/useTableColumnSet";
 import { CommonTableFormatter } from "~/common";
 import { Query } from "@/api/webApi";
-
+import { useUserStore } from "@/store/user";
+const router = useRouter();
 const props = defineProps({
   name: {
     type: String,
@@ -407,25 +408,27 @@ const { tableColumns, tableData, getTableData } = useTable(
   loading
 );
 const gueryRoles = async () => {
-  const { code, returnData } = await Query({
-    id: DATACONTENT_ID.allId,
-    dataContent: [
-      sessionStorage.getItem("auth-id"),
-      sessionStorage.getItem("User_Id"),
-    ],
-  });
-  conditon.value = returnData.listValues[0].query_col_conditon;
-  tableCols.value = [];
-  if (conditon.value == null) {
-    tableCols.value = tableColumns.value;
-  } else {
-    conditon.value.split(",").forEach((element) => {
-      tableColumns.value.forEach((res) => {
-        if (element === res.columnName) {
-          tableCols.value.push(res);
-        }
-      });
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
+  if (authMap[role] !== null) {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.allId,
+      dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
     });
+    conditon.value = returnData.listValues[0].query_col_conditon;
+    tableCols.value = [];
+    if (conditon.value == null) {
+      tableCols.value = tableColumns.value;
+    } else {
+      conditon.value.split(",").forEach((element) => {
+        tableColumns.value.forEach((res) => {
+          if (element === res.columnName) {
+            tableCols.value.push(res);
+          }
+        });
+      });
+    }
   }
 };
 gueryRoles();
@@ -496,8 +499,6 @@ const cellClass = ({ row, column, rowIndex, columnIndex }) => {
   return classes.join(" ");
 };
 
-const router = useRouter();
-
 const cellClickHandler = (row, column, cell, event) => {
   switch (props.name) {
     case "flight": {

+ 5 - 2
src/views/systemSettings/warningSet/index.vue

@@ -284,6 +284,7 @@ import {
 } from "@/api/webApi";
 import { ElMessage } from "element-plus";
 import { onMounted } from "vue";
+import { useUserStore } from "@/store/user";
 
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
@@ -456,10 +457,12 @@ const delRest = () => {
   flag.value = false;
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const { code, returnData } = await Query({
     id: DATACONTENT_ID.allId,
-    needPage: ++page.value,
-    dataContent: Object.values(dataContent.value),
+    dataContent: [authMap[role], sessionStorage.getItem("User_Id")],
   });
   conditon.value = returnData.listValues[0].query_col_conditon;
   getQuery();

+ 5 - 1
src/views/userManagement/account/index.vue

@@ -142,6 +142,7 @@ import Search from "@/components/search/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { translateDataToTreeAll } from "@/utils/validate";
 import { GeneralDataReception, Query } from "@/api/webApi";
+import { useUserStore } from "@/store/user";
 import * as _ from "lodash";
 import MD5 from "blueimp-md5";
 import table from "../hooks/useTable";
@@ -220,8 +221,11 @@ const getGroup = async () => {
   }
 };
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const res = await table.getTable(DATACONTENT_ID.allId, [
-    sessionStorage.getItem("auth-id"),
+    authMap[role],
     sessionStorage.getItem("User_Id"),
   ]);
   conditon.value = res.tableData.value[0].query_col_conditon;

+ 6 - 1
src/views/userManagement/accountGroup/index.vue

@@ -76,11 +76,13 @@ import { ref, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
 import Search from "@/components/search/index.vue";
+import { useUserStore } from "@/store/user";
 import * as _ from "lodash";
 import table from "../hooks/useTable";
 const ruleFormRef = ref<FormInstance>();
 const tableHeader = ref<any>([]);
 const tableData = ref<any>([]);
+const router = useRouter();
 const tableBtnGroup = <any>[
   {
     name: "编辑",
@@ -113,8 +115,11 @@ onBeforeMount(() => {
   gueryRoles();
 });
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const res = await table.getTable(DATACONTENT_ID.allId, [
-    sessionStorage.getItem("auth-id"),
+    authMap[role],
     sessionStorage.getItem("User_Id"),
   ]);
   conditon.value = res.tableData.value[0].query_col_conditon;

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

@@ -109,8 +109,10 @@
 import { ref, onBeforeMount } from "vue";
 import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
+import { useUserStore } from "@/store/user";
 import * as _ from "lodash";
 import table from "../hooks/useTable";
+const router = useRouter();
 const ruleFormRef = ref<FormInstance>();
 const tableHeader = ref<any>([]);
 const tableData = ref<any>([]);
@@ -148,8 +150,11 @@ onBeforeMount(() => {
   gueryRoles();
 });
 const gueryRoles = async () => {
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const res = await table.getTable(DATACONTENT_ID.allId, [
-    sessionStorage.getItem("auth-id"),
+    authMap[role],
     sessionStorage.getItem("User_Id"),
   ]);
   conditon.value = res.tableData.value[0].query_col_conditon;

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

@@ -105,6 +105,7 @@ import { ElMessage, FormInstance, FormRules } from "element-plus";
 import Table from "@/components/tableTemp/index.vue";
 import Search from "@/components/search/index.vue";
 import table from "../hooks/useTable";
+import { useUserStore } from "@/store/user";
 import * as _ from "lodash";
 const router = useRouter();
 const ruleFormRef = ref<FormInstance>();
@@ -152,9 +153,11 @@ onBeforeMount(() => {
 });
 
 const gueryRoles = async () => {
-  console.log(sessionStorage.getItem("auth-id"));
+  const route = router.currentRoute;
+  const authMap = useUserStore().authMap;
+  const role = route.value.meta?.roles?.[0];
   const res = await table.getTable(DATACONTENT_ID.allId, [
-    sessionStorage.getItem("auth-id"),
+    authMap[role],
     sessionStorage.getItem("User_Id"),
   ]);
   conditon.value = res.tableData.value[0].query_col_conditon;