From 96c5a968efc4a2919c95164ee48b7160b93894ac Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Wed, 22 Nov 2023 14:43:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 104 ++++++++++++++--------------- src/components/Form/src/Form.vue | 15 +++-- src/components/Table/src/Table.vue | 24 +++---- src/config/axios/config.ts | 10 ++- src/styles/index.less | 2 +- tsconfig.json | 2 - 6 files changed, 82 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index 67b5de9..cda18e9 100644 --- a/package.json +++ b/package.json @@ -28,87 +28,85 @@ "dependencies": { "@iconify/iconify": "^3.1.1", "@iconify/vue": "^4.1.1", - "@vueuse/core": "^10.2.1", + "@vueuse/core": "^10.6.1", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", - "@zxcvbn-ts/core": "^3.0.3", + "@zxcvbn-ts/core": "^3.0.4", "animate.css": "^4.1.1", - "axios": "^1.4.0", - "dayjs": "^1.11.9", + "axios": "^1.6.2", + "dayjs": "^1.11.10", "echarts": "^5.4.3", "echarts-wordcloud": "^2.1.0", - "element-plus": "^2.3.8", - "intro.js": "^7.0.1", + "element-plus": "^2.4.2", "lodash-es": "^4.17.21", "mitt": "^3.0.1", "mockjs": "^1.1.0", "nprogress": "^0.2.0", - "pinia": "^2.1.4", + "pinia": "^2.1.7", "pinia-plugin-persist": "^1.0.0", "qrcode": "^1.5.3", "qs": "^6.11.2", "sortablejs": "^1.15.0", - "url": "^0.11.1", - "vue": "3.3.4", - "vue-i18n": "9.2.2", - "vue-router": "^4.2.4", - "vue-types": "^5.1.0" + "url": "^0.11.3", + "vue": "3.3.8", + "vue-i18n": "9.7.0", + "vue-router": "^4.2.5", + "vue-types": "^5.1.1" }, "devDependencies": { - "@commitlint/cli": "^17.6.7", - "@commitlint/config-conventional": "^17.6.7", - "@iconify/json": "^2.2.92", - "@intlify/unplugin-vue-i18n": "^0.12.2", - "@purge-icons/generated": "^0.9.0", - "@types/intro.js": "^5.1.1", - "@types/lodash-es": "^4.17.8", - "@types/node": "^20.4.2", - "@types/nprogress": "^0.2.0", - "@types/qrcode": "^1.5.1", - "@types/qs": "^6.9.7", - "@types/sortablejs": "^1.15.1", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", - "@unocss/transformer-variant-group": "^0.53.5", - "@vitejs/plugin-legacy": "^4.1.0", - "@vitejs/plugin-vue": "^4.2.3", - "@vitejs/plugin-vue-jsx": "^3.0.1", - "@vue-macros/volar": "^0.12.2", - "autoprefixer": "^10.4.14", + "@commitlint/cli": "^18.4.3", + "@commitlint/config-conventional": "^18.4.3", + "@iconify/json": "^2.2.144", + "@intlify/unplugin-vue-i18n": "^1.5.0", + "@purge-icons/generated": "^0.10.0", + "@types/lodash-es": "^4.17.12", + "@types/node": "^20.9.4", + "@types/nprogress": "^0.2.3", + "@types/qrcode": "^1.5.5", + "@types/qs": "^6.9.10", + "@types/sortablejs": "^1.15.7", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "@unocss/transformer-variant-group": "^0.57.7", + "@vitejs/plugin-legacy": "^5.1.0", + "@vitejs/plugin-vue": "^4.5.0", + "@vitejs/plugin-vue-jsx": "^3.1.0", + "@vue-macros/volar": "^0.17.3", + "autoprefixer": "^10.4.16", "consola": "^3.2.3", - "eslint": "^8.45.0", - "eslint-config-prettier": "^8.8.0", - "eslint-define-config": "^1.21.0", - "eslint-plugin-prettier": "^5.0.0", - "eslint-plugin-vue": "^9.15.1", + "eslint": "^8.54.0", + "eslint-config-prettier": "^9.0.0", + "eslint-define-config": "^2.0.0", + "eslint-plugin-prettier": "^5.0.1", + "eslint-plugin-vue": "^9.18.1", "husky": "^8.0.3", - "less": "^4.1.3", - "lint-staged": "^13.2.3", - "plop": "^3.1.2", - "postcss": "^8.4.26", + "less": "^4.2.0", + "lint-staged": "^15.1.0", + "plop": "^4.0.0", + "postcss": "^8.4.31", "postcss-html": "^1.5.0", "postcss-less": "^6.0.0", - "prettier": "^3.0.0", - "rimraf": "^5.0.1", - "rollup": "^3.26.3", - "stylelint": "^15.10.1", + "prettier": "^3.1.0", + "rimraf": "^5.0.5", + "rollup": "^4.5.1", + "stylelint": "^15.11.0", "stylelint-config-html": "^1.1.0", "stylelint-config-recommended": "^13.0.0", "stylelint-config-standard": "^34.0.0", "stylelint-order": "^6.0.3", - "terser": "^5.19.1", - "typescript": "5.1.6", - "unocss": "^0.53.5", - "unplugin-vue-define-options": "^1.3.11", - "vite": "4.4.4", - "vite-plugin-ejs": "^1.6.4", + "terser": "^5.24.0", + "typescript": "5.3.2", + "unocss": "^0.57.7", + "unplugin-vue-define-options": "^1.4.0", + "vite": "5.0.2", + "vite-plugin-ejs": "^1.7.0", "vite-plugin-eslint": "^1.8.1", "vite-plugin-mock": "2.9.6", "vite-plugin-progress": "^0.0.7", - "vite-plugin-purge-icons": "^0.9.2", + "vite-plugin-purge-icons": "^0.10.0", "vite-plugin-style-import": "2.0.0", "vite-plugin-svg-icons": "^2.0.1", - "vue-tsc": "^1.8.5" + "vue-tsc": "^1.8.22" }, "engines": { "node": ">= 14.18.0" diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index 347ea4f..6df8835 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -93,9 +93,6 @@ export default defineComponent({ // element form 实例 const elFormRef = ref>() - // useForm传入的props - const outsideProps = ref({}) - const mergeProps = ref({}) const getProps = computed(() => { @@ -124,8 +121,6 @@ export default defineComponent({ const setProps = (props: FormProps = {}) => { mergeProps.value = Object.assign(unref(mergeProps), props) - // @ts-ignore - outsideProps.value = props } const delSchema = (field: string) => { @@ -334,7 +329,11 @@ export default defineComponent({ ref={(el: any) => setComponentRefMap(el, item.field)} {...(autoSetPlaceholder && setTextPlaceholder(item))} {...setComponentProps(item)} - style={item.componentProps?.style || {}} + style={ + item.componentProps?.style || { + width: '100%' + } + } > {{ ...slotsMap }} @@ -406,4 +405,8 @@ export default defineComponent({ margin-right: 0 !important; margin-left: 0 !important; } + +.@{elNamespace}-form--inline .@{elNamespace}-input { + width: 245px; +} diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index 0cbd50c..6fc3ff9 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -362,12 +362,12 @@ export default defineComponent({ return children && children.length ? renderTreeTableColumn(children) : props?.slots?.default - ? props.slots.default(...args) - : v?.formatter - ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) - : isImageUrl - ? renderPreview(get(data.row, v.field)) - : get(data.row, v.field) + ? props.slots.default(...args) + : v?.formatter + ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) + : isImageUrl + ? renderPreview(get(data.row, v.field)) + : get(data.row, v.field) } } if (props?.slots?.header) { @@ -459,12 +459,12 @@ export default defineComponent({ return children && children.length ? renderTreeTableColumn(children) : props?.slots?.default - ? props.slots.default(...args) - : v?.formatter - ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) - : isImageUrl - ? renderPreview(get(data.row, v.field)) - : get(data.row, v.field) + ? props.slots.default(...args) + : v?.formatter + ? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index) + : isImageUrl + ? renderPreview(get(data.row, v.field)) + : get(data.row, v.field) } } if (props?.slots?.header) { diff --git a/src/config/axios/config.ts b/src/config/axios/config.ts index d51c9da..2b3bd4d 100644 --- a/src/config/axios/config.ts +++ b/src/config/axios/config.ts @@ -6,6 +6,9 @@ import { } from './types' import { ElMessage } from 'element-plus' import qs from 'qs' +import { useStorage } from '@/hooks/web/useStorage' + +const { clear } = useStorage() const config: AxiosConfig = { /** @@ -83,7 +86,12 @@ const defaultResponseInterceptors = (response: AxiosResponse) => { } else if (response.data.code === config.code) { return response.data } else { - ElMessage.error(response.data.message) + ElMessage.error(response?.data?.message) + if (response?.data?.code === 401) { + // token过期 + clear() + window.location.reload() + } } } diff --git a/src/styles/index.less b/src/styles/index.less index cebb2c7..6825d70 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -4,4 +4,4 @@ // 解决抽屉弹出时,body宽度变化的问题 .el-popup-parent--hidden { width: 100% !important; -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 04de651..b3654fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,8 +27,6 @@ "@intlify/unplugin-vue-i18n/types", "vite/client", "element-plus/global", - "@types/intro.js", - "@types/qrcode", "vite-plugin-svg-icons/client", "unplugin-vue-define-options/macros-global" ]