Browse Source

Merge branch 'all-v4-qindao' into 'all-v4'

fix: 选择租户删除掉删除按钮

See merge request skyeye/skyeye_frontend/skyeye-admin!243
Fei Liu 1 year ago
parent
commit
47ec3fd3bc

+ 6 - 12
src/layout/components/Header/SwitchTenant.vue

@@ -5,7 +5,6 @@
     <el-tree-select
       v-model="currentTenant"
       :data="options"
-      clearable
       check-strictly
       placeholder="请选择租户"
       @update:modelValue="handleChange"
@@ -24,19 +23,14 @@
     value: string;
   }
 
+  const userStore = useUserStore();
   const { setValue, getValue } = useTargetTenantIdSetting();
-
   const localTId = getValue();
-
-  const currentTenant = ref(localTId ? Number(localTId) : '');
-
-  const options = ref<TenantOption[]>([]);
-
-  const userStore = useUserStore();
-
-  const tenantName = computed(() => {
-    return userStore.info.tenantName;
+  const tenantId = computed(() => {
+    return userStore.info.tenantId;
   });
+  const currentTenant = ref(localTId ? Number(localTId) : Number(tenantId.value));
+  const options = ref<TenantOption[]>([]);
 
   onMounted(() => {
     queryListTenant().then((res) => {
@@ -47,7 +41,7 @@
 
   const handleChange = (targetTenantId: string) => {
     setValue(targetTenantId);
-    currentTenant.value = targetTenantId;
+    currentTenant.value = Number(targetTenantId) ;
     window.location.reload();
   };
 </script>

+ 28 - 0
src/types/message/constant.ts

@@ -0,0 +1,28 @@
+/* 推送消息类型:1-平台违规报警数据 2-平台访问统计数 3-指定人员访问数据 */
+export enum PushMessageTypeEnum {
+  VIOLATION_WARNING = 1,
+  ACCESS_COUNT = 2,
+  DESIGNEE_ACCESS_DATA = 3
+}
+
+/* 功能类型:1是新增,2是查询,3是编辑 */
+export enum OperationTypeEnum {
+  ADD = 1,
+  SEARCH = 2,
+  EDIT = 3
+}
+
+/* 统计时间段类型:1-周报 2-月报 3-季报 4-年报 5-自定义 */
+export enum StatisticTypeEnum {
+  WEEK_REPORT = 1,
+  MONTH_REPORT = 2,
+  QUARTER_REPORT = 3,
+  YEAR_REPORT = 4,
+  CUSTOM_REPORT = 5,
+}
+
+export const OperationTypeNames = {
+  [OperationTypeEnum.ADD]: '新增',
+  [OperationTypeEnum.SEARCH]: '查询',
+  [OperationTypeEnum.EDIT]: '编辑',
+} 

+ 3 - 3
src/views/datamanager/platformdata/components/query/Query.vue

@@ -50,7 +50,7 @@
     getWorkshopVisitedTimes,
   } from '@/api/datamanagement/dataplatform';
   import { formatWorkshopChart, formatCameraChart } from '@/utils/platformUtils';
-  import { deptTreeList } from '@/api/auth/dept';
+  import { getAllDepartments } from '@/api/auth/dept';
   import _ from 'lodash-es';
 
   const departmentList = ref<any[]>([]);
@@ -60,10 +60,10 @@
   const { flattenedWorkshops, getScenesTree, calculateTreeData } = sceneInfos;
   onMounted(() => {
     getScenesTree({ level: 1, valueKey: 'code', labelKey: 'name', disabled: true });
-    deptTreeList().then((res) => {
+    getAllDepartments().then((res) => {
       departmentList.value = calculateTreeData(
         res,
-        { level: 3, valueKey: 'deptId', labelKey: 'deptName' },
+        { level: 3, valueKey: 'id', labelKey: 'deptName' },
         1,
       );
     });

+ 3 - 3
src/views/datamanager/platformdata/components/score/Score.vue

@@ -60,7 +60,7 @@
   import { useSceneInfos } from '@/hooks/useSceneInfos';
   import ScoreTable from '../common/ScoreTable.vue';
   import ScoreLineChart from '../../charts/ScoreLineChart.vue';
-  import { deptTreeList } from '@/api/auth/dept';
+  import { getAllDepartments } from '@/api/auth/dept';
   import _ from 'lodash-es';
 
   const departmentList = ref<any[]>([]);
@@ -70,10 +70,10 @@
   const { getScenesTree, calculateTreeData } = sceneInfos;
   onMounted(() => {
     getScenesTree({ level: 1, valueKey: 'code', labelKey: 'name', disabled: true });
-    deptTreeList().then((res) => {
+    getAllDepartments().then((res) => {
       departmentList.value = calculateTreeData(
         res,
-        { level: 3, valueKey: 'deptId', labelKey: 'deptName' },
+        { level: 3, valueKey: 'id', labelKey: 'deptName' },
         1,
       );
     });