fix 修复变量问题

This commit is contained in:
ahao 2023-12-16 11:45:35 +08:00
parent 88040a1998
commit 0433708a2e
9 changed files with 37 additions and 27 deletions

View File

@ -126,7 +126,7 @@ const toggleDark = () => useToggle(isDark);
const topNavChange = (val: any) => { const topNavChange = (val: any) => {
if (!val) { if (!val) {
appStore.toggleSideBarHide(false); appStore.toggleSideBarHide(false);
permissionStore.setSidebarRouters(permissionStore.defaultRoutes); permissionStore.setSidebarRouters(permissionStore.defaultRoutes as any);
} }
}; };

View File

@ -29,13 +29,13 @@ import useSettingsStore from '@/store/modules/settings';
import usePermissionStore from '@/store/modules/permission'; import usePermissionStore from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router'; import { RouteRecordRaw } from 'vue-router';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute(); const route = useRoute();
const appStore = useAppStore(); const appStore = useAppStore();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const permissionStore = usePermissionStore(); const permissionStore = usePermissionStore();
const sidebarRouters = computed<RouteRecordRaw[]>(() => permissionStore.sidebarRouters); const sidebarRouters = computed<RouteRecordRaw[]>(() => permissionStore.sidebarRouters as any);
const showLogo = computed(() => settingsStore.sidebarLogo); const showLogo = computed(() => settingsStore.sidebarLogo);
const sideTheme = computed(() => settingsStore.sideTheme); const sideTheme = computed(() => settingsStore.sideTheme);
const theme = computed(() => settingsStore.theme); const theme = computed(() => settingsStore.theme);

View File

@ -54,7 +54,7 @@ const state = reactive<SearchState>({
const openSearch = () => { const openSearch = () => {
state.menuQuery = ''; state.menuQuery = '';
state.isShowSearch = true; state.isShowSearch = true;
state.menuList = generateRoutes(routes.value); state.menuList = generateRoutes(routes.value as any);
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
layoutMenuAutocompleteRef.value.focus(); layoutMenuAutocompleteRef.value.focus();

View File

@ -5,30 +5,30 @@ declare global {
declare type ElTableInstance = ep.TableInstance; declare type ElTableInstance = ep.TableInstance;
declare type ElUploadInstance = ep.UploadInstance; declare type ElUploadInstance = ep.UploadInstance;
declare type ElScrollbarInstance = ep.ScrollbarInstance; declare type ElScrollbarInstance = ep.ScrollbarInstance;
declare type ElInputInstance = ep.InputInstance;
declare type ElInputNumberInstance = ep.InputNumberInstance;
declare type ElRadioInstance = ep.RadioInstance;
declare type ElRadioGroupInstance = ep.RadioGroupInstance;
declare type ElRadioButtonInstance = ep.RadioButtonInstance;
declare type ElCheckboxInstance = ep.CheckboxInstance;
declare type ElSwitchInstance = ep.SwitchInstance;
declare type ElCascaderInstance = ep.CascaderInstance;
declare type ElColorPickerInstance = ep.ColorPickerInstance;
declare type ElRateInstance = ep.RateInstance;
declare type ElSliderInstance = ep.SliderInstance;
declare type TransferKey = ep.TransferKey;
declare type CheckboxValueType = ep.CheckboxValueType;
declare type ElFormRules = ep.FormRules;
declare type DateModelType = ep.DateModelType;
declare type UploadFile = ep.UploadFile;
declare type ElTreeInstance = InstanceType<typeof ep.ElTree>; declare type ElTreeInstance = InstanceType<typeof ep.ElTree>;
declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>; declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>;
declare type ElSelectInstance = InstanceType<typeof ep.ElSelect>; declare type ElSelectInstance = InstanceType<typeof ep.ElSelect>;
declare type ElCardInstance = InstanceType<typeof ep.ElCard>; declare type ElCardInstance = InstanceType<typeof ep.ElCard>;
declare type ElDialogInstance = InstanceType<typeof ep.ElDialog>; declare type ElDialogInstance = InstanceType<typeof ep.ElDialog>;
declare type ElInputInstance = InstanceType<typeof ep.ElInput>;
declare type ElInputNumberInstance = InstanceType<typeof ep.ElInputNumber>;
declare type ElRadioInstance = InstanceType<typeof ep.ElRadio>;
declare type ElRadioGroupInstance = InstanceType<typeof ep.ElRadioGroup>;
declare type ElRadioButtonInstance = InstanceType<typeof ep.ElRadioButton>;
declare type ElCheckboxInstance = InstanceType<typeof ep.ElCheckbox>;
declare type ElCheckboxGroupInstance = InstanceType<typeof ep.ElCheckboxGroup>; declare type ElCheckboxGroupInstance = InstanceType<typeof ep.ElCheckboxGroup>;
declare type ElSwitchInstance = InstanceType<typeof ep.ElSwitch>;
declare type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>; declare type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>;
declare type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>; declare type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>;
declare type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>; declare type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>;
declare type ElCascaderInstance = InstanceType<typeof ep.ElCascader>;
declare type ElColorPickerInstance = InstanceType<typeof ep.ElColorPicker>;
declare type ElRateInstance = InstanceType<typeof ep.ElRate>;
declare type ElSliderInstance = InstanceType<typeof ep.ElSlider>;
declare type TransferKey = ep.TransferKey;
declare type CheckboxValueType = ep.CheckboxValueType;
declare type ElFormRules = ep.FormRules;
declare type DateModelType = ep.DateModelType;
declare type UploadFile = typeof ep.UploadFile;
} }

View File

@ -126,8 +126,9 @@
<script setup name="Cache" lang="ts"> <script setup name="Cache" lang="ts">
import { getCache } from '@/api/monitor/cache'; import { getCache } from '@/api/monitor/cache';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { CacheVO } from '@/api/monitor/cache/types';
const cache = ref<any>({}); const cache = ref<Partial<CacheVO>>({});
const commandstats = ref(); const commandstats = ref();
const usedmemory = ref(); const usedmemory = ref();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -172,7 +172,7 @@ const initFormData: DeptForm = {
email: undefined, email: undefined,
status: '0' status: '0'
}; };
const data = reactive<PageData<DeptForm, DeptQuery>>({ const initData: PageData<DeptForm, DeptQuery> = {
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -187,7 +187,8 @@ const data = reactive<PageData<DeptForm, DeptQuery>>({
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }], email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }] phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }]
} }
}); };
const data = reactive<PageData<DeptForm, DeptQuery>>(initData);
const { queryParams, form, rules } = toRefs<PageData<DeptForm, DeptQuery>>(data); const { queryParams, form, rules } = toRefs<PageData<DeptForm, DeptQuery>>(data);

View File

@ -60,7 +60,7 @@ import { getAuthRole, updateAuthRole } from '@/api/system/user';
import { UserForm } from '@/api/system/user/types'; import { UserForm } from '@/api/system/user/types';
const route = useRoute(); const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance();
const loading = ref(true); const loading = ref(true);
const total = ref(0); const total = ref(0);

View File

@ -27,7 +27,7 @@
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<svg-icon icon-class="tree" />所属部门 <svg-icon icon-class="tree" />所属部门
<div v-if="state.user.dept" class="pull-right">{{ state.user.dept.deptName }} / {{ state.postGroup }}</div> <div v-if="state.user.dept" class="pull-right">{{ state.user.dept?.deptName }} / {{ state.postGroup }}</div>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<svg-icon icon-class="peoples" />所属角色 <svg-icon icon-class="peoples" />所属角色
@ -72,9 +72,16 @@ import ResetPwd from './resetPwd.vue';
import ThirdParty from './thirdParty.vue'; import ThirdParty from './thirdParty.vue';
import { getAuthList } from '@/api/system/social/auth'; import { getAuthList } from '@/api/system/social/auth';
import { getUserProfile } from '@/api/system/user'; import { getUserProfile } from '@/api/system/user';
import { UserVO } from '@/api/system/user/types';
const activeTab = ref('userinfo'); const activeTab = ref('userinfo');
const state = ref<Record<string, any>>({ interface State {
user: Partial<UserVO>;
roleGroup: string;
postGroup: string;
auths: any;
}
const state = ref<State>({
user: {}, user: {},
roleGroup: '', roleGroup: '',
postGroup: '', postGroup: '',

View File

@ -6,6 +6,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"strict": true, "strict": true,
"jsx": "preserve", "jsx": "preserve",
"strictNullChecks": false,
"sourceMap": true, "sourceMap": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,