Procházet zdrojové kódy

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

qindao před 1 rokem
rodič
revize
33179bf514

+ 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]: '编辑',
+}