Commit 6f1f24b43e191c5ccc36d2335146f62cb06b0094
1 parent
557f2937
refactor
Showing
9 changed files
with
30 additions
and
29 deletions
yudao-ui-admin-vue3/src/App.vue
| 1 | +<template> | ||
| 2 | + <ConfigGlobal :size="currentSize"> | ||
| 3 | + <RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" /> | ||
| 4 | + </ConfigGlobal> | ||
| 5 | +</template> | ||
| 1 | <script setup lang="ts"> | 6 | <script setup lang="ts"> |
| 2 | import { computed } from 'vue' | 7 | import { computed } from 'vue' |
| 3 | -import { useAppStore } from '@/store/modules/app' | ||
| 4 | -import { ConfigGlobal } from '@/components/ConfigGlobal' | 8 | +import Cookies from 'js-cookie' |
| 5 | import { isDark } from '@/utils/is' | 9 | import { isDark } from '@/utils/is' |
| 10 | +import { useAppStore } from '@/store/modules/app' | ||
| 6 | import { useDesign } from '@/hooks/web/useDesign' | 11 | import { useDesign } from '@/hooks/web/useDesign' |
| 7 | -import Cookies from 'js-cookie' | 12 | +import { ConfigGlobal } from '@/components/ConfigGlobal' |
| 8 | 13 | ||
| 9 | const { getPrefixCls } = useDesign() | 14 | const { getPrefixCls } = useDesign() |
| 10 | - | ||
| 11 | const prefixCls = getPrefixCls('app') | 15 | const prefixCls = getPrefixCls('app') |
| 12 | - | ||
| 13 | const appStore = useAppStore() | 16 | const appStore = useAppStore() |
| 14 | - | ||
| 15 | const currentSize = computed(() => appStore.getCurrentSize) | 17 | const currentSize = computed(() => appStore.getCurrentSize) |
| 16 | - | ||
| 17 | const greyMode = computed(() => appStore.getGreyMode) | 18 | const greyMode = computed(() => appStore.getGreyMode) |
| 18 | 19 | ||
| 19 | // 根据浏览器当前主题设置系统主题色 | 20 | // 根据浏览器当前主题设置系统主题色 |
| @@ -32,12 +33,6 @@ const setDefaultTheme = () => { | @@ -32,12 +33,6 @@ const setDefaultTheme = () => { | ||
| 32 | setDefaultTheme() | 33 | setDefaultTheme() |
| 33 | </script> | 34 | </script> |
| 34 | 35 | ||
| 35 | -<template> | ||
| 36 | - <ConfigGlobal :size="currentSize"> | ||
| 37 | - <RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" /> | ||
| 38 | - </ConfigGlobal> | ||
| 39 | -</template> | ||
| 40 | - | ||
| 41 | <style lang="less"> | 36 | <style lang="less"> |
| 42 | @prefix-cls: ~'@{namespace}-app'; | 37 | @prefix-cls: ~'@{namespace}-app'; |
| 43 | 38 |
yudao-ui-admin-vue3/src/views/Error/404.vue
| 1 | <template> | 1 | <template> |
| 2 | <Error @error-click="errorClick" /> | 2 | <Error @error-click="errorClick" /> |
| 3 | </template> | 3 | </template> |
| 4 | - | ||
| 5 | <script setup lang="ts"> | 4 | <script setup lang="ts"> |
| 6 | import { Error } from '@/components/Error' | 5 | import { Error } from '@/components/Error' |
| 7 | import { useRouter } from 'vue-router' | 6 | import { useRouter } from 'vue-router' |
yudao-ui-admin-vue3/src/views/Error/500.vue
| 1 | <template> | 1 | <template> |
| 2 | <Error type="500" @error-click="errorClick" /> | 2 | <Error type="500" @error-click="errorClick" /> |
| 3 | </template> | 3 | </template> |
| 4 | - | ||
| 5 | <script setup lang="ts"> | 4 | <script setup lang="ts"> |
| 6 | import { Error } from '@/components/Error' | 5 | import { Error } from '@/components/Error' |
| 7 | import { useRouter } from 'vue-router' | 6 | import { useRouter } from 'vue-router' |
yudao-ui-admin-vue3/src/views/Profile/components/BasicInfo.vue
| @@ -15,13 +15,14 @@ import { reactive, onMounted, unref, ref } from 'vue' | @@ -15,13 +15,14 @@ import { reactive, onMounted, unref, ref } from 'vue' | ||
| 15 | import type { FormRules } from 'element-plus' | 15 | import type { FormRules } from 'element-plus' |
| 16 | import { ElMessage, ElRadioGroup, ElRadio } from 'element-plus' | 16 | import { ElMessage, ElRadioGroup, ElRadio } from 'element-plus' |
| 17 | import { useI18n } from '@/hooks/web/useI18n' | 17 | import { useI18n } from '@/hooks/web/useI18n' |
| 18 | +import { FormSchema } from '@/types/form' | ||
| 19 | +import { FormExpose } from '@/components/Form' | ||
| 18 | import { | 20 | import { |
| 19 | getUserProfileApi, | 21 | getUserProfileApi, |
| 20 | updateUserProfileApi, | 22 | updateUserProfileApi, |
| 21 | UserProfileUpdateReqVO | 23 | UserProfileUpdateReqVO |
| 22 | } from '@/api/system/user/profile' | 24 | } from '@/api/system/user/profile' |
| 23 | -import { FormSchema } from '@/types/form' | ||
| 24 | -import { FormExpose } from '@/components/Form' | 25 | + |
| 25 | const { t } = useI18n() | 26 | const { t } = useI18n() |
| 26 | // 表单校验 | 27 | // 表单校验 |
| 27 | const rules = reactive<FormRules>({ | 28 | const rules = reactive<FormRules>({ |
yudao-ui-admin-vue3/src/views/Profile/components/ProfileUser.vue
| @@ -40,11 +40,12 @@ | @@ -40,11 +40,12 @@ | ||
| 40 | </div> | 40 | </div> |
| 41 | </template> | 41 | </template> |
| 42 | <script setup lang="ts"> | 42 | <script setup lang="ts"> |
| 43 | -import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' | ||
| 44 | import { onMounted, ref } from 'vue' | 43 | import { onMounted, ref } from 'vue' |
| 45 | import dayjs from 'dayjs' | 44 | import dayjs from 'dayjs' |
| 46 | import UserAvatar from './UserAvatar.vue' | 45 | import UserAvatar from './UserAvatar.vue' |
| 47 | import { useI18n } from '@/hooks/web/useI18n' | 46 | import { useI18n } from '@/hooks/web/useI18n' |
| 47 | +import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' | ||
| 48 | + | ||
| 48 | const { t } = useI18n() | 49 | const { t } = useI18n() |
| 49 | const userInfo = ref<ProfileVO>() | 50 | const userInfo = ref<ProfileVO>() |
| 50 | const getUserInfo = async () => { | 51 | const getUserInfo = async () => { |
yudao-ui-admin-vue3/src/views/Profile/components/ResetPwd.vue
| @@ -16,12 +16,13 @@ | @@ -16,12 +16,13 @@ | ||
| 16 | </el-form> | 16 | </el-form> |
| 17 | </template> | 17 | </template> |
| 18 | <script setup lang="ts"> | 18 | <script setup lang="ts"> |
| 19 | -import { InputPassword } from '@/components/InputPassword' | 19 | +import { ref, reactive } from 'vue' |
| 20 | import { ElForm, ElFormItem, ElMessage } from 'element-plus' | 20 | import { ElForm, ElFormItem, ElMessage } from 'element-plus' |
| 21 | import type { FormRules, FormInstance } from 'element-plus' | 21 | import type { FormRules, FormInstance } from 'element-plus' |
| 22 | -import { updateUserPwdApi } from '@/api/system/user/profile' | ||
| 23 | -import { ref, reactive } from 'vue' | ||
| 24 | import { useI18n } from '@/hooks/web/useI18n' | 22 | import { useI18n } from '@/hooks/web/useI18n' |
| 23 | +import { InputPassword } from '@/components/InputPassword' | ||
| 24 | +import { updateUserPwdApi } from '@/api/system/user/profile' | ||
| 25 | + | ||
| 25 | const { t } = useI18n() | 26 | const { t } = useI18n() |
| 26 | const formRef = ref<FormInstance>() | 27 | const formRef = ref<FormInstance>() |
| 27 | const password = reactive({ | 28 | const password = reactive({ |
yudao-ui-admin-vue3/src/views/Profile/components/UserAvatar.vue
| @@ -94,6 +94,7 @@ import { VueCropper } from 'vue-cropper' | @@ -94,6 +94,7 @@ import { VueCropper } from 'vue-cropper' | ||
| 94 | import { ElRow, ElCol, ElUpload, ElMessage, ElDialog } from 'element-plus' | 94 | import { ElRow, ElCol, ElUpload, ElMessage, ElDialog } from 'element-plus' |
| 95 | import { propTypes } from '@/utils/propTypes' | 95 | import { propTypes } from '@/utils/propTypes' |
| 96 | import { uploadAvatarApi } from '@/api/system/user/profile' | 96 | import { uploadAvatarApi } from '@/api/system/user/profile' |
| 97 | + | ||
| 97 | const cropper = ref() | 98 | const cropper = ref() |
| 98 | const dialogVisible = ref(false) | 99 | const dialogVisible = ref(false) |
| 99 | const cropperVisible = ref(false) | 100 | const cropperVisible = ref(false) |
yudao-ui-admin-vue3/src/views/Profile/components/UserSocial.vue
| @@ -24,13 +24,15 @@ | @@ -24,13 +24,15 @@ | ||
| 24 | <script setup lang="ts"> | 24 | <script setup lang="ts"> |
| 25 | import { onMounted, ref } from 'vue' | 25 | import { onMounted, ref } from 'vue' |
| 26 | import { ElTable, ElTableColumn } from 'element-plus' | 26 | import { ElTable, ElTableColumn } from 'element-plus' |
| 27 | +import { useMessage } from '@/hooks/web/useMessage' | ||
| 27 | import { SystemUserSocialTypeEnum } from '@/utils/constants' | 28 | import { SystemUserSocialTypeEnum } from '@/utils/constants' |
| 28 | import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' | 29 | import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' |
| 29 | import { socialAuthRedirect, socialUnbind } from '@/api/system/user/socialUser' | 30 | import { socialAuthRedirect, socialUnbind } from '@/api/system/user/socialUser' |
| 30 | -import { ElMessage } from 'element-plus' | ||
| 31 | 31 | ||
| 32 | +const message = useMessage() | ||
| 32 | const socialUsers = ref<any[]>([]) | 33 | const socialUsers = ref<any[]>([]) |
| 33 | const userInfo = ref<ProfileVO>() | 34 | const userInfo = ref<ProfileVO>() |
| 35 | + | ||
| 34 | const initSocial = async () => { | 36 | const initSocial = async () => { |
| 35 | const res = await getUserProfileApi() | 37 | const res = await getUserProfileApi() |
| 36 | userInfo.value = res | 38 | userInfo.value = res |
| @@ -59,7 +61,7 @@ const unbind = async (row) => { | @@ -59,7 +61,7 @@ const unbind = async (row) => { | ||
| 59 | if (res) { | 61 | if (res) { |
| 60 | row.openid = undefined | 62 | row.openid = undefined |
| 61 | } | 63 | } |
| 62 | - ElMessage.success('解绑成功') | 64 | + message.success('解绑成功') |
| 63 | } | 65 | } |
| 64 | 66 | ||
| 65 | onMounted(async () => { | 67 | onMounted(async () => { |
yudao-ui-admin-vue3/src/views/visualization/jmreport/index.vue
| 1 | +<template> | ||
| 2 | + <ContentWrap> | ||
| 3 | + <IFrame :src="src" /> | ||
| 4 | + </ContentWrap> | ||
| 5 | +</template> | ||
| 6 | + | ||
| 1 | <script setup lang="ts"> | 7 | <script setup lang="ts"> |
| 8 | +import { ref } from 'vue' | ||
| 2 | import { IFrame } from '@/components/IFrame' | 9 | import { IFrame } from '@/components/IFrame' |
| 3 | import { getAccessToken } from '@/utils/auth' | 10 | import { getAccessToken } from '@/utils/auth' |
| 4 | -import { ref } from 'vue' | 11 | + |
| 5 | const BASE_URL = import.meta.env.VITE_BASE_URL | 12 | const BASE_URL = import.meta.env.VITE_BASE_URL |
| 6 | const src = ref(BASE_URL + '/jmreport/list?token=' + getAccessToken()) | 13 | const src = ref(BASE_URL + '/jmreport/list?token=' + getAccessToken()) |
| 7 | </script> | 14 | </script> |
| 8 | 15 | ||
| 9 | -<template> | ||
| 10 | - <ContentWrap> | ||
| 11 | - <IFrame :src="src" /> | ||
| 12 | - </ContentWrap> | ||
| 13 | -</template> |