diff --git a/.env.front b/.env.front new file mode 100644 index 00000000..2641417d --- /dev/null +++ b/.env.front @@ -0,0 +1,19 @@ +# 本地开发环境 +NODE_ENV=development + +VITE_DEV=true + +# 请求路径 +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' + +# 上传路径 +VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH=/dev-api + +# 接口地址 +VITE_API_URL=/admin-api + +# 打包路径 +VITE_BASE_PATH=/ diff --git a/.env.static b/.env.static new file mode 100644 index 00000000..034a7f4d --- /dev/null +++ b/.env.static @@ -0,0 +1,31 @@ +# 开发环境 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://localhost:48080' + +# 上传路径 +VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH= + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/admin-ui-vue3/ + +# 输出路径 +VITE_OUT_DIR=dist-dev diff --git a/README.md b/README.md index 96bdd51b..b3e9cc78 100644 --- a/README.md +++ b/README.md @@ -36,16 +36,16 @@ | 框架 | 说明 | 版本 | |----------------------------------------------------------------------|------------------|--------| | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.1.1 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.30 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.1.4 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.34 | | [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.9.5 | -| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.30 | -| [vueuse](https://vueuse.org/) | 常用工具集 | 9.12.0 | +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.33 | +| [vueuse](https://vueuse.org/) | 常用工具集 | 9.13.0 | | [vxe-table](https://vxetable.cn/) | Vue 最强表单 | 4.3.10 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | | [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.0.1 | +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 | | [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.23 | ## 开发工具 diff --git a/build/vite/index.ts b/build/vite/index.ts index 717db992..304ce0d5 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -14,6 +14,7 @@ import viteCompression from 'vite-plugin-compression' import vueSetupExtend from 'vite-plugin-vue-setup-extend' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' + export function createVitePlugins(VITE_APP_TITLE: string) { const root = process.cwd() // 路径查找 @@ -27,7 +28,7 @@ export function createVitePlugins(VITE_APP_TITLE: string) { progress(), PurgeIcons(), vueSetupExtend(), - ElementPlus(), + ElementPlus({}), AutoImport({ include: [ /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts index a4bff7b9..3d90dbac 100644 --- a/build/vite/optimize.ts +++ b/build/vite/optimize.ts @@ -67,7 +67,19 @@ const include = [ 'element-plus/es/components/dropdown/style/index', 'element-plus/es/components/dropdown-menu/style/index', 'element-plus/es/components/dropdown-item/style/index', - 'element-plus/es/components/skeleton/style/index' + 'element-plus/es/components/skeleton/style/index', + 'element-plus/es/components/skeleton/style/css', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/tree/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/badge/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/breadcrumb-item/style/css' ] const exclude = ['@iconify/json'] diff --git a/package.json b/package.json index 5b55353a..d067560f 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,18 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.7.0-snapshot.1922", + "version": "1.7.1-snapshot.1941", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, "scripts": { "i": "pnpm install", "dev": "vite --mode base", + "front": "vite --mode front", "ts:check": "vue-tsc --noEmit", - "build:pro": "vite build --mode pro", - "build:dev": "vite build --mode dev", - "build:test": "npm run ts:check && vite build --mode test", + "build:pro": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode pro", + "build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev", + "build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test", + "build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static", "serve:pro": "vite preview --mode pro", "serve:dev": "vite preview --mode dev", "serve:test": "vite preview --mode test", @@ -27,12 +29,12 @@ "@form-create/designer": "^3.1.0", "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.1.0", - "@vueuse/core": "^9.12.0", + "@vueuse/core": "^9.13.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", "@zxcvbn-ts/core": "^2.2.1", "animate.css": "^4.1.1", - "axios": "^1.3.3", + "axios": "^1.3.4", "bpmn-js-token-simulation": "^0.10.0", "camunda-bpmn-moddle": "^7.0.1", "cropperjs": "^1.5.13", @@ -41,18 +43,18 @@ "diagram-js": "^11.6.0", "echarts": "^5.4.1", "echarts-wordcloud": "^2.1.0", - "element-plus": "2.2.30", - "fast-xml-parser": "^4.1.2", + "element-plus": "2.2.34", + "fast-xml-parser": "^4.1.3", "highlight.js": "^11.7.0", "intro.js": "^6.0.0", - "jsencrypt": "^3.3.1", + "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", "min-dash": "^4.0.0", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.30", + "pinia": "^2.0.33", "qrcode": "^1.5.1", - "qs": "^6.11.0", + "qs": "^6.11.1", "steady-xml": "^0.1.0", "url": "^0.11.0", "vue": "3.2.47", @@ -66,19 +68,19 @@ "xml-js": "^1.6.11" }, "devDependencies": { - "@commitlint/cli": "^17.4.3", - "@commitlint/config-conventional": "^17.4.3", - "@iconify/json": "^2.2.21", + "@commitlint/cli": "^17.4.4", + "@commitlint/config-conventional": "^17.4.4", + "@iconify/json": "^2.2.31", "@intlify/unplugin-vue-i18n": "^0.8.2", "@purge-icons/generated": "^0.9.0", - "@types/intro.js": "^5.1.0", + "@types/intro.js": "^5.1.1", "@types/lodash-es": "^4.17.6", - "@types/node": "^18.13.0", + "@types/node": "^18.14.6", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.5.0", "@types/qs": "^6.9.7", - "@typescript-eslint/eslint-plugin": "^5.52.0", - "@typescript-eslint/parser": "^5.52.0", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1", "@vitejs/plugin-legacy": "^4.0.1", "@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue-jsx": "^3.0.0", @@ -86,8 +88,8 @@ "bpmn-js": "^8.9.0", "bpmn-js-properties-panel": "^0.46.0", "consola": "^2.15.3", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.6.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.7.0", "eslint-define-config": "^1.15.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.9.0", @@ -96,21 +98,21 @@ "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", "prettier": "^2.8.4", - "rimraf": "^4.1.2", - "rollup": "^3.15.0", - "sass": "^1.58.1", - "stylelint": "^15.1.0", + "rimraf": "^4.3.1", + "rollup": "^3.18.0", + "sass": "^1.58.3", + "stylelint": "^15.2.0", "stylelint-config-html": "^1.1.0", "stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended": "^10.0.1", "stylelint-config-standard": "^30.0.1", "stylelint-order": "^6.0.2", - "terser": "^5.16.3", + "terser": "^5.16.5", "typescript": "4.9.5", - "unplugin-auto-import": "^0.14.2", - "unplugin-element-plus": "^0.6.0", - "unplugin-vue-components": "^0.23.0", - "vite": "4.1.1", + "unplugin-auto-import": "^0.15.1", + "unplugin-element-plus": "^0.7.0", + "unplugin-vue-components": "^0.24.1", + "vite": "4.1.4", "vite-plugin-compression": "^0.5.1", "vite-plugin-ejs": "^1.6.4", "vite-plugin-eslint": "^1.8.1", @@ -119,7 +121,7 @@ "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-windicss": "^1.8.10", - "vue-tsc": "^1.0.24", + "vue-tsc": "^1.2.0", "windicss": "^3.5.6" }, "engines": { diff --git a/src/components/Descriptions/src/Descriptions.vue b/src/components/Descriptions/src/Descriptions.vue index d6cea87a..fca37000 100644 --- a/src/components/Descriptions/src/Descriptions.vue +++ b/src/components/Descriptions/src/Descriptions.vue @@ -109,7 +109,13 @@ const toggleClick = () => { v-bind="getBindItemValue(item)" > + + diff --git a/src/main.ts b/src/main.ts index 4aba7d93..b3a9da16 100644 --- a/src/main.ts +++ b/src/main.ts @@ -55,7 +55,7 @@ import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 import Logger from '@/utils/Logger' // 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 -if (isDevMode() == true) { +if (isDevMode()) { import('element-plus/dist/index.css') } diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index e9fbf371..a60d0e45 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -58,7 +58,7 @@ export const useTagsViewStore = defineStore('tagsView', { // 删除某个 delView(view: RouteLocationNormalizedLoaded) { this.delVisitedView(view) - this.addCachedView() + this.delCachedView() }, // 删除tag delVisitedView(view: RouteLocationNormalizedLoaded) { @@ -80,7 +80,7 @@ export const useTagsViewStore = defineStore('tagsView', { // 删除所有缓存和tag delAllViews() { this.delAllVisitedViews() - this.addCachedView() + this.delCachedView() }, // 删除所有tag delAllVisitedViews() { diff --git a/src/styles/index.scss b/src/styles/index.scss index d53c2a6c..39c4c4da 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -6,6 +6,11 @@ margin-left: 2px !important; } +// 解决抽屉弹出时,body宽度变化的问题 +.el-popup-parent--hidden { + width: 100% !important; +} + /* nprogress 适配 element-plus 的主题色 */ #nprogress { & .bar { diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index f06196b1..fa82a4aa 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -1,5 +1,7 @@ -// generated by unplugin-vue-components -// We suggest you to commit this file into source control +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' @@ -21,6 +23,7 @@ declare module '@vue/runtime-core' { DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] + ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] @@ -50,6 +53,7 @@ declare module '@vue/runtime-core' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] + ElImage: typeof import('element-plus/es')['ElImage'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] ElLink: typeof import('element-plus/es')['ElLink'] @@ -60,12 +64,15 @@ declare module '@vue/runtime-core' { ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSkeleton: typeof import('element-plus/es')['ElSkeleton'] + ElSpace: typeof import('element-plus/es')['ElSpace'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTableV2: typeof import('element-plus/es')['ElTableV2'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] + ElTag: typeof import('element-plus/es')['ElTag'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index d30eb960..a05a5b48 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -1,4 +1,7 @@ -// Generated by 'unplugin-auto-import' +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-auto-import export {} declare global { const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE'] @@ -68,5 +71,5 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component,ComponentPublicInstance,ComputedRef,InjectionKey,PropType,Ref,VNode } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' } diff --git a/src/utils/env.ts b/src/utils/env.ts index 4a45f622..ea271813 100644 --- a/src/utils/env.ts +++ b/src/utils/env.ts @@ -1,6 +1,6 @@ export const isDevMode = () => { const dev = import.meta.env.VITE_DEV - if (dev && dev === true) { + if (dev && dev === 'true') { return true } else { return false diff --git a/src/utils/routerHelper.ts b/src/utils/routerHelper.ts index 0ae8e1e20..af6a9c3c 100644 --- a/src/utils/routerHelper.ts +++ b/src/utils/routerHelper.ts @@ -212,9 +212,11 @@ const addToChildren = ( } } const toCamelCase = (str: string, upperCaseFirst: boolean) => { - str = (str || '').toLowerCase().replace(/-(.)/g, function (group1: string) { - return group1.toUpperCase() - }) + str = (str || '') + .replace(/-(.)/g, function (group1: string) { + return group1.toUpperCase() + }) + .replaceAll('-', '') if (upperCaseFirst && str) { str = str.charAt(0).toUpperCase() + str.slice(1) diff --git a/src/views/bpm/definition/definition.data.ts b/src/views/bpm/definition/definition.data.ts index 919cbd9c..14a0c319 100644 --- a/src/views/bpm/definition/definition.data.ts +++ b/src/views/bpm/definition/definition.data.ts @@ -17,23 +17,29 @@ const crudSchemas = reactive({ title: '定义名称', field: 'name', table: { - width: 120, + // width: 120, slots: { default: 'name_default' } } }, { - title: '流程分类', + title: '定义分类', field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number' + // dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + // dictClass: 'number', + table: { + // width: 120, + slots: { + default: 'category_default' + } + } }, { title: '表单信息', field: 'formId', table: { - width: 120, + // width: 200, slots: { default: 'formId_default' } @@ -43,7 +49,7 @@ const crudSchemas = reactive({ title: '流程版本', field: 'version', table: { - width: 80, + // width: 80, slots: { default: 'version_default' } @@ -53,7 +59,7 @@ const crudSchemas = reactive({ title: '激活状态', field: 'suspensionState', table: { - width: 80, + // width: 80, slots: { default: 'suspensionState_default' } @@ -63,10 +69,10 @@ const crudSchemas = reactive({ title: '部署时间', field: 'deploymentTime', isForm: false, - formatter: 'formatDate', - table: { - width: 180 - } + formatter: 'formatDate' + // table: { + // width: 180 + // } } ] }) diff --git a/src/views/bpm/definition/index.vue b/src/views/bpm/definition/index.vue index 19a7cf06..f2ef640c 100644 --- a/src/views/bpm/definition/index.vue +++ b/src/views/bpm/definition/index.vue @@ -6,6 +6,10 @@ + + diff --git a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts b/src/views/bpm/taskAssignRule/taskAssignRule.data.ts index 1ced3425..cad74325 100644 --- a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts +++ b/src/views/bpm/taskAssignRule/taskAssignRule.data.ts @@ -43,4 +43,12 @@ const crudSchemas = reactive({ } ] }) + +export const idShowActionClick = (modelId?: any) => { + if (modelId) { + return true + } else { + return false + } +} export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/server/index.vue b/src/views/infra/server/index.vue index 8e748b26..cc7590d6 100644 --- a/src/views/infra/server/index.vue +++ b/src/views/infra/server/index.vue @@ -3,7 +3,7 @@