Skip to content

Commit

Permalink
refactor(admin): update antdv4
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 9, 2023
1 parent 70c46a9 commit ad14520
Show file tree
Hide file tree
Showing 123 changed files with 3,569 additions and 5,683 deletions.
62 changes: 31 additions & 31 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,30 @@
}
},
"dependencies": {
"@ant-design/icons-vue": "^6.1.0",
"@ant-design/icons-vue": "^7.0.1",
"@iconify/iconify": "^3.1.1",
"@logicflow/core": "^1.2.17",
"@logicflow/extension": "^1.2.18",
"@vben/hooks": "workspace:*",
"@vue/shared": "^3.3.7",
"@vueuse/core": "^9.13.0",
"@vueuse/shared": "^9.13.0",
"@zxcvbn-ts/core": "^2.2.1",
"@vue/shared": "^3.3.8",
"@vueuse/core": "^10.5.0",
"@vueuse/shared": "^10.5.0",
"@zxcvbn-ts/core": "^3.0.4",
"ant-design-vue": "^4.0.6",
"axios": "^1.6.0",
"axios": "^1.6.1",
"codemirror": "^5.65.15",
"cropperjs": "^1.6.1",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.10",
"echarts": "^5.4.3",
"exceljs": "^4.4.0",
"ids": "1.0.0",
"ids": "1.0.5",
"intro.js": "^7.2.0",
"lodash-es": "^4.17.21",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.1",
"pinia": "2.0.33",
"pinia": "2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"print-js": "^1.6.0",
"qrcode": "^1.5.3",
Expand All @@ -79,50 +79,50 @@
"showdown": "^2.1.0",
"socket.io-client": "^4.7.2",
"sortablejs": "^1.15.0",
"tinymce": "^5.10.8",
"tinymce": "^5.10.7",
"vditor": "^3.9.6",
"vue": "^3.3.7",
"vue-i18n": "^9.6.1",
"vue": "^3.3.8",
"vue-i18n": "^9.6.5",
"vue-json-pretty": "^2.2.4",
"vue-router": "^4.2.5",
"vue-types": "^5.1.1",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.5.13",
"vxe-table-plugin-export-xlsx": "^3.1.0",
"xe-utils": "^3.5.13",
"xe-utils": "^3.5.14",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@iconify/json": "^2.2.134",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@iconify/json": "^2.2.139",
"@purge-icons/generated": "^0.9.0",
"@types/codemirror": "^5.60.12",
"@types/crypto-js": "^4.1.3",
"@types/intro.js": "^5.1.3",
"@types/lodash-es": "^4.17.10",
"@types/mockjs": "^1.0.9",
"@types/nprogress": "^0.2.2",
"@types/qrcode": "^1.5.4",
"@types/qs": "^6.9.9",
"@types/showdown": "^2.0.3",
"@types/sortablejs": "^1.15.4",
"@types/codemirror": "^5.60.13",
"@types/crypto-js": "^4.2.1",
"@types/intro.js": "^5.1.4",
"@types/lodash-es": "^4.17.11",
"@types/mockjs": "^1.0.10",
"@types/nprogress": "^0.2.3",
"@types/qrcode": "^1.5.5",
"@types/qs": "^6.9.10",
"@types/showdown": "^2.0.4",
"@types/sortablejs": "^1.15.5",
"@vben/eslint-config": "workspace:*",
"@vben/stylelint-config": "workspace:*",
"@vben/ts-config": "workspace:*",
"@vben/types": "workspace:*",
"@vben/vite-config": "workspace:*",
"@vue/compiler-sfc": "^3.3.7",
"@vue/compiler-sfc": "^3.3.8",
"@vue/test-utils": "^2.4.1",
"unbuild": "^1.2.1",
"unbuild": "^2.0.0",
"unplugin-vue-define-options": "^1.3.18",
"vite": "^4.5.0",
"vite-plugin-mock": "^2.9.8",
"vite-plugin-mock": "^3.0.0",
"vue-tsc": "^1.8.22"
},
"packageManager": "pnpm@8.10.0",
"packageManager": "pnpm@8.10.2",
"engines": {
"node": ">=16.15.1",
"node": ">=18",
"pnpm": ">=8.1.0"
}
}
}
21 changes: 18 additions & 3 deletions apps/admin/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
<template>
<ConfigProvider :locale="getAntdLocale" :theme="isDark ? darkTheme : {}">
<ConfigProvider :locale="getAntdLocale" :theme="themeConfig">
<AppProvider>
<RouterView />
</AppProvider>
</ConfigProvider>
</template>

<script lang="ts" setup>
import { ConfigProvider } from 'ant-design-vue';
import { AppProvider } from '@/components/Application';
import { useTitle } from '@/hooks/web/useTitle';
import { useLocale } from '@/locales/useLocale';
import { ConfigProvider } from 'ant-design-vue';
import 'dayjs/locale/zh-cn';
import { useDarkModeTheme } from '@/hooks/setting/useDarkModeTheme';
import 'dayjs/locale/zh-cn';
import { computed } from 'vue';
// support Multi-language
const { getAntdLocale } = useLocale();
const { isDark, darkTheme } = useDarkModeTheme();
const themeConfig = computed(() =>
Object.assign(
{
token: {
colorPrimary: '#0960bd',
colorSuccess: '#55D187',
colorWarning: '#EFBD47',
colorError: '#ED6F6F',
colorInfo: '#0960bd',
},
},
isDark.value ? darkTheme : {},
),
);
// Listening to page changes and dynamically changing site titles
useTitle();
</script>
2 changes: 1 addition & 1 deletion apps/admin/src/api/sys/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface GetUserInfoModel {
// 用户名
username: string;
// 真实名字
realName: string;
nickname: string;
// 头像
avatar: string;
// 介绍
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/api/system/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { defHttp } from '/@/utils/http/axios';
export interface User {
id: number;
username: string;
realName: string;
nickname: string;
}

export type UserListResult = BasicPaginationResult<User>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<script lang="ts" setup>
import { computed, unref } from 'vue';
import { SvgIcon } from '/@/components/Icon';
import { useDesign } from '/@/hooks/web/useDesign';
import { ThemeEnum } from '/@/enums/appEnum';
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground';
import { useDesign } from '/@/hooks/web/useDesign';
import { updateDarkTheme } from '/@/logics/theme/dark';
import { ThemeEnum } from '/@/enums/appEnum';
import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground';
const { prefixCls } = useDesign('dark-switch');
const { getDarkMode, setDarkMode, getShowDarkModeToggle } = useRootSetting();
Expand Down
8 changes: 5 additions & 3 deletions apps/admin/src/components/Basic/src/BasicHelp.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="tsx">
import type { CSSProperties, PropType } from 'vue';
import type { CSSProperties, PropType, VNodeChild } from 'vue';
import { defineComponent, computed, unref } from 'vue';
import { Tooltip } from 'ant-design-vue';
import { InfoCircleOutlined } from '@ant-design/icons-vue';
Expand Down Expand Up @@ -36,7 +36,9 @@
/**
* Help text list
*/
text: { type: [Array, String] as PropType<string[] | string> },
text: {
type: [Array, String, Object] as PropType<string[] | string | VNodeChild | JSX.Element>,
},
};
export default defineComponent({
Expand Down Expand Up @@ -71,7 +73,7 @@
);
});
}
return null;
return <div>{textList}</div>;
}
return () => {
Expand Down
1 change: 0 additions & 1 deletion apps/admin/src/components/Form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ export { default as ApiTree } from './src/components/ApiTree.vue';
export { default as ApiRadioGroup } from './src/components/ApiRadioGroup.vue';
export { default as ApiCascader } from './src/components/ApiCascader.vue';
export { default as ApiTransfer } from './src/components/ApiTransfer.vue';
export { default as ImageUpload } from './src/components/ImageUpload.vue';

export { BasicForm };
3 changes: 1 addition & 2 deletions apps/admin/src/components/Form/src/componentMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import ApiTree from './components/ApiTree.vue';
import ApiTreeSelect from './components/ApiTreeSelect.vue';
import ApiCascader from './components/ApiCascader.vue';
import ApiTransfer from './components/ApiTransfer.vue';
import ImageUpload from './components/ImageUpload.vue';
import { BasicUpload } from '/@/components/Upload';
import { BasicUpload, ImageUpload } from '/@/components/Upload';
import { StrengthMeter } from '/@/components/StrengthMeter';
import { IconPicker } from '/@/components/Icon';
import { CountdownInput } from '/@/components/CountDown';
Expand Down
4 changes: 3 additions & 1 deletion apps/admin/src/components/Form/src/components/ApiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { useI18n } from '/@/hooks/web/useI18n';
import { propTypes } from '/@/utils/propTypes';
type OptionsItem = { label: string; value: string; disabled?: boolean };
type OptionsItem = { label?: string; value?: string; disabled?: boolean; [name: string]: any };
export default defineComponent({
name: 'ApiSelect',
Expand Down Expand Up @@ -127,6 +127,8 @@
console.warn(error);
} finally {
loading.value = false;
// reset status
isFirstLoaded.value = false;
}
}
Expand Down
1 change: 0 additions & 1 deletion apps/admin/src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
const { autoSetPlaceHolder, size } = props.formProps;
const propsData: Recordable<any> = {
allowClear: true,
getPopupContainer: (trigger: Element) => trigger.parentNode,
size,
...unref(getComponentsProps),
disabled: unref(getDisable),
Expand Down
Loading

0 comments on commit ad14520

Please sign in to comment.