From 9dc361e708b2251487d41ac4abd5b6630caa405b Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Sun, 23 Apr 2023 11:44:03 +0800 Subject: [PATCH 01/47] =?UTF-8?q?=F0=9F=8C=88=20style(Form/src):=20Modifyi?= =?UTF-8?q?ng=20word=20spelling=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改ts类型 PlaceholderModel单词拼写 - 修改initModel方法 FormModel注释拼写 --- src/components/Form/src/helper.ts | 8 ++++---- src/components/Form/src/types.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Form/src/helper.ts b/src/components/Form/src/helper.ts index 9cab8ff1..cdfc8caa 100644 --- a/src/components/Form/src/helper.ts +++ b/src/components/Form/src/helper.ts @@ -1,6 +1,6 @@ import type { Slots } from 'vue' import { getSlot } from '@/utils/tsxHelper' -import { PlaceholderMoel } from './types' +import { PlaceholderModel } from './types' import { FormSchema } from '@/types/form' import { ColProps } from '@/types/components' @@ -10,7 +10,7 @@ import { ColProps } from '@/types/components' * @returns 返回提示信息对象 * @description 用于自动设置placeholder */ -export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { +export const setTextPlaceholder = (schema: FormSchema): PlaceholderModel => { const { t } = useI18n() const textMap = ['Input', 'Autocomplete', 'InputNumber', 'InputPassword'] const selectMap = ['Select', 'SelectV2', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect'] @@ -108,8 +108,8 @@ export const setItemComponentSlots = ( /** * * @param schema Form表单结构化数组 - * @param formModel FormMoel - * @returns FormMoel + * @param formModel FormModel + * @returns FormModel * @description 生成对应的formModel */ export const initModel = (schema: FormSchema[], formModel: Recordable) => { diff --git a/src/components/Form/src/types.ts b/src/components/Form/src/types.ts index 92a49d85..dcd01e78 100644 --- a/src/components/Form/src/types.ts +++ b/src/components/Form/src/types.ts @@ -1,6 +1,6 @@ import { FormSchema } from '@/types/form' -export interface PlaceholderMoel { +export interface PlaceholderModel { placeholder?: string startPlaceholder?: string endPlaceholder?: string From e31f922b82a90e8aa89ef61fc50eef7752c2ea7f Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 18:46:40 +0800 Subject: [PATCH 02/47] chore: update deps --- package.json | 66 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 1a836c5a..ecbaff98 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,12 @@ "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.1.0", "@videojs-player/vue": "^1.0.0", - "@vueuse/core": "^9.13.0", + "@vueuse/core": "^10.1.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.5", + "axios": "^1.3.6", "benz-amr-recorder": "^1.1.5", "bpmn-js-token-simulation": "^0.10.0", "camunda-bpmn-moddle": "^7.0.1", @@ -46,19 +46,19 @@ "crypto-js": "^4.1.1", "dayjs": "^1.11.7", "diagram-js": "^11.6.0", - "echarts": "^5.4.1", + "echarts": "^5.4.2", "echarts-wordcloud": "^2.1.0", "element-plus": "2.3.3", - "fast-xml-parser": "^4.1.3", + "fast-xml-parser": "^4.2.2", "highlight.js": "^11.7.0", "intro.js": "^7.0.1", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", - "min-dash": "^4.0.0", + "min-dash": "^4.1.0", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.34", - "qrcode": "^1.5.1", + "pinia": "^2.0.35", + "qrcode": "^1.5.3", "qs": "^6.11.1", "steady-xml": "^0.1.0", "url": "^0.11.0", @@ -73,61 +73,61 @@ "xml-js": "^1.6.11" }, "devDependencies": { - "@commitlint/cli": "^17.5.0", - "@commitlint/config-conventional": "^17.4.4", - "@iconify/json": "^2.2.38", + "@commitlint/cli": "^17.6.1", + "@commitlint/config-conventional": "^17.6.1", + "@iconify/json": "^2.2.54", "@intlify/unplugin-vue-i18n": "^0.10.0", "@purge-icons/generated": "^0.9.0", "@types/intro.js": "^5.1.1", "@types/lodash-es": "^4.17.7", - "@types/node": "^18.15.5", + "@types/node": "^18.16.0", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.5.0", "@types/qs": "^6.9.7", - "@typescript-eslint/eslint-plugin": "^5.56.0", - "@typescript-eslint/parser": "^5.56.0", + "@typescript-eslint/eslint-plugin": "^5.59.0", + "@typescript-eslint/parser": "^5.59.0", "@vitejs/plugin-legacy": "^4.0.2", "@vitejs/plugin-vue": "^4.1.0", "@vitejs/plugin-vue-jsx": "^3.0.1", "autoprefixer": "^10.4.14", "bpmn-js": "^8.9.0", "bpmn-js-properties-panel": "^0.46.0", - "consola": "^2.15.3", - "eslint": "^8.36.0", + "consola": "^3.1.0", + "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", - "eslint-define-config": "^1.17.0", + "eslint-define-config": "^1.18.0", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-vue": "^9.9.0", - "lint-staged": "^13.2.0", - "postcss": "^8.4.21", + "eslint-plugin-vue": "^9.11.0", + "lint-staged": "^13.2.1", + "postcss": "^8.4.23", "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", - "prettier": "^2.8.6", - "rimraf": "^4.4.1", - "rollup": "^3.20.0", - "sass": "^1.59.3", - "stylelint": "^15.3.0", + "prettier": "^2.8.8", + "rimraf": "^5.0.0", + "rollup": "^3.20.7", + "sass": "^1.62.0", + "stylelint": "^15.6.0", "stylelint-config-html": "^1.1.0", "stylelint-config-prettier": "^9.0.5", - "stylelint-config-recommended": "^11.0.0", - "stylelint-config-standard": "^31.0.0", + "stylelint-config-recommended": "^12.0.0", + "stylelint-config-standard": "^33.0.0", "stylelint-order": "^6.0.3", - "terser": "^5.16.6", - "typescript": "5.0.2", - "unplugin-auto-import": "^0.15.1", - "unplugin-element-plus": "^0.7.0", + "terser": "^5.17.1", + "typescript": "5.0.4", + "unplugin-auto-import": "^0.15.3", + "unplugin-element-plus": "^0.7.1", "unplugin-vue-components": "^0.24.1", - "vite": "4.2.1", + "vite": "4.3.1", "vite-plugin-compression": "^0.5.1", "vite-plugin-ejs": "^1.6.4", "vite-plugin-eslint": "^1.8.1", - "vite-plugin-progress": "^0.0.6", + "vite-plugin-progress": "^0.0.7", "vite-plugin-purge-icons": "^0.9.2", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-top-level-await": "^1.3.0", "vite-plugin-vue-setup-extend-plus": "^0.1.0", "vite-plugin-windicss": "^1.8.10", - "vue-tsc": "^1.2.0", + "vue-tsc": "^1.4.4", "windicss": "^3.5.6" }, "engines": { From 462b5b55d8c5a46adc95376378912bbf04e3fd83 Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 18:48:11 +0800 Subject: [PATCH 03/47] chore: remove stylelint-config-prettier --- package.json | 1 - stylelint.config.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index ecbaff98..7a00c122 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,6 @@ "sass": "^1.62.0", "stylelint": "^15.6.0", "stylelint-config-html": "^1.1.0", - "stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended": "^12.0.0", "stylelint-config-standard": "^33.0.0", "stylelint-order": "^6.0.3", diff --git a/stylelint.config.js b/stylelint.config.js index d4005726..a8ba3d30 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -2,7 +2,7 @@ module.exports = { root: true, plugins: ['stylelint-order'], customSyntax: 'postcss-html', - extends: ['stylelint-config-standard', 'stylelint-config-prettier'], + extends: ['stylelint-config-standard'], rules: { 'selector-pseudo-class-no-unknown': [ true, From 4b6103a6f7a69a57b592e219bc61c215f92a8b1f Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 18:59:09 +0800 Subject: [PATCH 04/47] chore: optimize --- build/vite/optimize.ts | 92 +++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts index 416ea02e..9d576191 100644 --- a/build/vite/optimize.ts +++ b/build/vite/optimize.ts @@ -17,7 +17,6 @@ const include = [ 'cropperjs', 'lodash-es', 'nprogress', - 'animate.css', 'web-storage-cache', '@iconify/iconify', '@vueuse/core', @@ -33,37 +32,58 @@ const include = [ 'element-plus/es', 'element-plus/es/locale/lang/zh-cn', 'element-plus/es/locale/lang/en', - 'element-plus/es/components/backtop/style/index', - 'element-plus/es/components/form/style/index', - 'element-plus/es/components/radio-group/style/index', - 'element-plus/es/components/radio/style/index', - 'element-plus/es/components/checkbox/style/index', - 'element-plus/es/components/checkbox-group/style/index', - 'element-plus/es/components/switch/style/index', - 'element-plus/es/components/time-picker/style/index', - 'element-plus/es/components/date-picker/style/index', - 'element-plus/es/components/col/style/index', - 'element-plus/es/components/form-item/style/index', - 'element-plus/es/components/alert/style/index', - 'element-plus/es/components/breadcrumb/style/index', - 'element-plus/es/components/select/style/index', - 'element-plus/es/components/input/style/index', - 'element-plus/es/components/breadcrumb-item/style/index', - 'element-plus/es/components/tag/style/index', - 'element-plus/es/components/pagination/style/index', - 'element-plus/es/components/table/style/index', - 'element-plus/es/components/table-column/style/index', - 'element-plus/es/components/card/style/index', - 'element-plus/es/components/row/style/index', - 'element-plus/es/components/button/style/index', - 'element-plus/es/components/menu/style/index', - 'element-plus/es/components/sub-menu/style/index', - 'element-plus/es/components/menu-item/style/index', - 'element-plus/es/components/option/style/index', - '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/backtop/style/css', + 'element-plus/es/components/form/style/css', + 'element-plus/es/components/radio-group/style/css', + 'element-plus/es/components/radio/style/css', + 'element-plus/es/components/checkbox/style/css', + 'element-plus/es/components/checkbox-group/style/css', + 'element-plus/es/components/switch/style/css', + 'element-plus/es/components/time-picker/style/css', + 'element-plus/es/components/date-picker/style/css', + 'element-plus/es/components/descriptions/style/css', + 'element-plus/es/components/descriptions-item/style/css', + 'element-plus/es/components/link/style/css', + 'element-plus/es/components/tooltip/style/css', + 'element-plus/es/components/drawer/style/css', + 'element-plus/es/components/dialog/style/css', + 'element-plus/es/components/checkbox-button/style/css', + 'element-plus/es/components/option-group/style/css', + 'element-plus/es/components/radio-button/style/css', + 'element-plus/es/components/cascader/style/css', + 'element-plus/es/components/color-picker/style/css', + 'element-plus/es/components/input-number/style/css', + 'element-plus/es/components/rate/style/css', + 'element-plus/es/components/select-v2/style/css', + 'element-plus/es/components/tree-select/style/css', + 'element-plus/es/components/slider/style/css', + 'element-plus/es/components/time-select/style/css', + 'element-plus/es/components/autocomplete/style/css', + 'element-plus/es/components/image-viewer/style/css', + 'element-plus/es/components/upload/style/css', + 'element-plus/es/components/col/style/css', + 'element-plus/es/components/form-item/style/css', + 'element-plus/es/components/alert/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/select/style/css', + 'element-plus/es/components/input/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/tag/style/css', + 'element-plus/es/components/pagination/style/css', + 'element-plus/es/components/table/style/css', + 'element-plus/es/components/table-v2/style/css', + 'element-plus/es/components/table-column/style/css', + 'element-plus/es/components/card/style/css', + 'element-plus/es/components/row/style/css', + 'element-plus/es/components/button/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/option/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/skeleton/style/css', 'element-plus/es/components/skeleton/style/css', 'element-plus/es/components/backtop/style/css', 'element-plus/es/components/menu/style/css', @@ -76,7 +96,13 @@ const include = [ 'element-plus/es/components/badge/style/css', 'element-plus/es/components/breadcrumb/style/css', 'element-plus/es/components/breadcrumb-item/style/css', - 'element-plus/es/components/image/style/css' + 'element-plus/es/components/image/style/css', + 'element-plus/es/components/collapse-transition/style/css', + 'element-plus/es/components/timeline/style/css', + 'element-plus/es/components/timeline-item/style/css', + 'element-plus/es/components/collapse/style/css', + 'element-plus/es/components/collapse-item/style/css', + 'element-plus/es/components/button-group/style/css' ] const exclude = ['@iconify/json'] From 148602556ae94b56efa35817a66db521567ea458 Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 19:00:25 +0800 Subject: [PATCH 05/47] fix: type error --- src/views/system/notice/NoticeForm.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/system/notice/NoticeForm.vue b/src/views/system/notice/NoticeForm.vue index 114a2c81..42060abd 100644 --- a/src/views/system/notice/NoticeForm.vue +++ b/src/views/system/notice/NoticeForm.vue @@ -17,9 +17,9 @@ @@ -27,9 +27,9 @@ From 6b7d092c29aa16b2cd6f0548bf37d2cbac849e43 Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 19:35:06 +0800 Subject: [PATCH 06/47] fix: api error --- src/api/system/notify/template/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/system/notify/template/index.ts b/src/api/system/notify/template/index.ts index 50196e85..cd0e1223 100644 --- a/src/api/system/notify/template/index.ts +++ b/src/api/system/notify/template/index.ts @@ -39,7 +39,7 @@ export const updateNotifyTemplate = async (data: NotifyTemplateVO) => { } // 删除站内信模板 -export const deleteNotifyTemplateApi = async (id: number) => { +export const deleteNotifyTemplate = async (id: number) => { return await request.delete({ url: '/system/notify-template/delete?id=' + id }) } From fc366f18c8e315207f9d2d9b224995fd970cc511 Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 19:35:14 +0800 Subject: [PATCH 07/47] fix: type warn --- src/views/bpm/definition/index.vue | 2 +- src/views/bpm/group/UserGroupForm.vue | 2 +- src/views/bpm/group/index.vue | 3 ++- src/views/bpm/model/editor/index.vue | 2 +- src/views/bpm/model/index.vue | 2 +- src/views/bpm/oa/leave/detail.vue | 2 +- src/views/bpm/processInstance/create/index.vue | 2 +- src/views/infra/build/index.vue | 10 ++++++---- src/views/infra/codegen/PreviewCode.vue | 15 ++++++++------- src/views/system/dict/data/DictDataForm.vue | 4 +++- .../notify/template/NotifyTemplateSendForm.vue | 4 ++-- src/views/system/post/PostForm.vue | 2 +- 12 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/views/bpm/definition/index.vue b/src/views/bpm/definition/index.vue index c18e9a92..2580b1cd 100644 --- a/src/views/bpm/definition/index.vue +++ b/src/views/bpm/definition/index.vue @@ -87,7 +87,7 @@ diff --git a/src/views/bpm/group/UserGroupForm.vue b/src/views/bpm/group/UserGroupForm.vue index 5a3ca804..f5ea479c 100644 --- a/src/views/bpm/group/UserGroupForm.vue +++ b/src/views/bpm/group/UserGroupForm.vue @@ -68,7 +68,7 @@ const formRules = reactive({ status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref -const userList = ref([]) // 用户列表 +const userList = ref([]) // 用户列表 /** 打开弹窗 */ const open = async (type: string, id?: number) => { diff --git a/src/views/bpm/group/index.vue b/src/views/bpm/group/index.vue index f2427f71..f1d6b271 100644 --- a/src/views/bpm/group/index.vue +++ b/src/views/bpm/group/index.vue @@ -117,6 +117,7 @@ import { dateFormatter } from '@/utils/formatTime' import * as UserGroupApi from '@/api/bpm/userGroup' import * as UserApi from '@/api/system/user' import UserGroupForm from './UserGroupForm.vue' +import { UserVO } from '@/api/system/user' const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -131,7 +132,7 @@ const queryParams = reactive({ createTime: [] }) const queryFormRef = ref() // 搜索的表单 -const userList = ref([]) // 用户列表 +const userList = ref([]) // 用户列表 /** 查询列表 */ const getList = async () => { diff --git a/src/views/bpm/model/editor/index.vue b/src/views/bpm/model/editor/index.vue index 24908ae5..dd135e72 100644 --- a/src/views/bpm/model/editor/index.vue +++ b/src/views/bpm/model/editor/index.vue @@ -16,7 +16,7 @@ diff --git a/src/views/bpm/oa/leave/detail.vue b/src/views/bpm/oa/leave/detail.vue index a1b646a1..67ca7d7f 100644 --- a/src/views/bpm/oa/leave/detail.vue +++ b/src/views/bpm/oa/leave/detail.vue @@ -28,7 +28,7 @@ const props = defineProps({ id: propTypes.number.def(undefined) }) const detailLoading = ref(false) // 表单的加载中 -const detailData = ref({}) // 详情数据 +const detailData = ref({}) // 详情数据 const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编号 /** 获得数据 */ diff --git a/src/views/bpm/processInstance/create/index.vue b/src/views/bpm/processInstance/create/index.vue index 11cf929b..802b1a72 100644 --- a/src/views/bpm/processInstance/create/index.vue +++ b/src/views/bpm/processInstance/create/index.vue @@ -43,7 +43,7 @@ - + diff --git a/src/views/system/post/PostForm.vue b/src/views/system/post/PostForm.vue index e4ea8ad7..a314806b 100644 --- a/src/views/system/post/PostForm.vue +++ b/src/views/system/post/PostForm.vue @@ -117,7 +117,7 @@ const resetForm = () => { sort: undefined, status: CommonStatusEnum.ENABLE, remark: '' - } + } as any formRef.value?.resetFields() } From 53b6f0bdf4d24a44f88efe0740c10aeba72ffa08 Mon Sep 17 00:00:00 2001 From: xingyu Date: Sun, 23 Apr 2023 19:36:34 +0800 Subject: [PATCH 08/47] docs: update deps --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4ddd4f2..633381b0 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ | 框架 | 说明 | 版本 | |----------------------------------------------------------------------|------------------|--------| | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 | -| [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.33 | -| [vueuse](https://vueuse.org/) | 常用工具集 | 9.13.0 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.1 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.3.3 | +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 | +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 | +| [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 | | [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 | From 2ab8ea45daf555c1b4891ef617b645ce746b55bf Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 24 Apr 2023 09:13:31 +0800 Subject: [PATCH 09/47] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20vben=20=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 633381b0..f5619e8b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ * nodejs > 16.0.0 && pnpm > 7.30.0 * 演示地址【Vue3 + element-plus】: +* 演示地址【Vue3 + vben(ant-design-vue)】: * 演示地址【Vue2 + element-ui】: * 启动文档: * 视频教程: @@ -19,8 +20,8 @@ **芋道**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。 -* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) -* 改换saas,自动引入等功能 [vue-element-plus-admin](https://gitee.com/yudaocode/vue-element-plus-admin) +* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) 实现 +* 改换 saas,自动引入等功能 * 使用 Element Plus 免费开源的中后台模版,具备如下特性: ![首页](preview/home.png) From a0014bed6529b15e07cf96413d4702c9904682a8 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 24 Apr 2023 11:42:44 +0800 Subject: [PATCH 10/47] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=95=8C=E9=9D=A2=E7=BB=93=E6=9E=84=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 31 ++- src/views/mall/product/management/addForm.vue | 53 +++++ .../management/components/BasicInfoForm.vue | 191 +++++++++++++++ .../management/components/DescriptionForm.vue | 13 + .../components/OtherSettingsForm.vue | 94 ++++++++ .../product/management/components/index.ts | 5 + src/views/mall/product/management/index.vue | 225 ++++++++++++++++++ 7 files changed, 608 insertions(+), 4 deletions(-) create mode 100644 src/views/mall/product/management/addForm.vue create mode 100644 src/views/mall/product/management/components/BasicInfoForm.vue create mode 100644 src/views/mall/product/management/components/DescriptionForm.vue create mode 100644 src/views/mall/product/management/components/OtherSettingsForm.vue create mode 100644 src/views/mall/product/management/components/index.ts create mode 100644 src/views/mall/product/management/index.vue diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 55e933ed..32848b9a 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -2,9 +2,9 @@ import { Layout } from '@/utils/routerHelper' const { t } = useI18n() /** -* redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 -* name:'router-name' 设定路由的名字,一定要填写不然使用时会出现各种问题 -* meta : { + * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' 设定路由的名字,一定要填写不然使用时会出现各种问题 + * meta : { hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false) alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式, @@ -31,7 +31,7 @@ const { t } = useI18n() canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false) } -**/ + **/ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/redirect', @@ -345,6 +345,29 @@ const remainingRouter: AppRouteRecordRaw[] = [ meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } } ] + }, + { + path: '/product', + component: Layout, + name: 'ProductManagementEdit', + meta: { + hidden: true + }, + children: [ + { + path: 'productManagementAdd', + component: () => import('@/views/mall/product/management/addForm.vue'), + name: 'ProductManagementAdd', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:edit', + title: '添加商品', + activeMenu: '/product/product-management' + } + } + ] } ] diff --git a/src/views/mall/product/management/addForm.vue b/src/views/mall/product/management/addForm.vue new file mode 100644 index 00000000..d077df5b --- /dev/null +++ b/src/views/mall/product/management/addForm.vue @@ -0,0 +1,53 @@ + + diff --git a/src/views/mall/product/management/components/BasicInfoForm.vue b/src/views/mall/product/management/components/BasicInfoForm.vue new file mode 100644 index 00000000..1b33e9eb --- /dev/null +++ b/src/views/mall/product/management/components/BasicInfoForm.vue @@ -0,0 +1,191 @@ + + + diff --git a/src/views/mall/product/management/components/DescriptionForm.vue b/src/views/mall/product/management/components/DescriptionForm.vue new file mode 100644 index 00000000..53609705 --- /dev/null +++ b/src/views/mall/product/management/components/DescriptionForm.vue @@ -0,0 +1,13 @@ + + diff --git a/src/views/mall/product/management/components/OtherSettingsForm.vue b/src/views/mall/product/management/components/OtherSettingsForm.vue new file mode 100644 index 00000000..e8152883 --- /dev/null +++ b/src/views/mall/product/management/components/OtherSettingsForm.vue @@ -0,0 +1,94 @@ + + diff --git a/src/views/mall/product/management/components/index.ts b/src/views/mall/product/management/components/index.ts new file mode 100644 index 00000000..04e6f74d --- /dev/null +++ b/src/views/mall/product/management/components/index.ts @@ -0,0 +1,5 @@ +import BasicInfoForm from './BasicInfoForm.vue' +import DescriptionForm from './DescriptionForm.vue' +import OtherSettingsForm from './OtherSettingsForm.vue' + +export { BasicInfoForm, DescriptionForm, OtherSettingsForm } diff --git a/src/views/mall/product/management/index.vue b/src/views/mall/product/management/index.vue new file mode 100644 index 00000000..4fdfed1b --- /dev/null +++ b/src/views/mall/product/management/index.vue @@ -0,0 +1,225 @@ + + From ace8f9e302b05b3226d1910290784096092dacc1 Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Mon, 24 Apr 2023 11:50:30 +0800 Subject: [PATCH 11/47] =?UTF-8?q?=F0=9F=90=9E=20fix(styles/index):=20Updat?= =?UTF-8?q?e=20.el-scrollbar=5F=5Fbar=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 解决表格内容超过表格总宽度后,横向滚动条前端顶不到表格边缘的问题 --- src/styles/index.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/styles/index.scss b/src/styles/index.scss index 2781c12e..33d29123 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -10,6 +10,12 @@ width: 100% !important; } +// 解决表格内容超过表格总宽度后,横向滚动条前端顶不到表格边缘的问题 +.el-scrollbar__bar { + display: flex; + justify-content: flex-start; +} + /* nprogress 适配 element-plus 的主题色 */ #nprogress { & .bar { From c38abc365c779528d5ea5d2926a895aa1211eaf9 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 26 Apr 2023 17:17:39 +0800 Subject: [PATCH 12/47] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E5=BB=BA=E3=80=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E3=80=81=E6=8F=90=E4=BA=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/management/type/index.ts | 22 ++++ src/utils/object.ts | 17 +++ src/views/mall/product/management/addForm.vue | 90 +++++++++++-- .../management/components/BasicInfoForm.vue | 118 +++++++++--------- .../management/components/DescriptionForm.vue | 82 ++++++++++-- .../components/OtherSettingsForm.vue | 87 ++++++++++--- src/views/system/dict/index.vue | 91 ++++++++------ 7 files changed, 374 insertions(+), 133 deletions(-) create mode 100644 src/api/mall/product/management/type/index.ts create mode 100644 src/utils/object.ts diff --git a/src/api/mall/product/management/type/index.ts b/src/api/mall/product/management/type/index.ts new file mode 100644 index 00000000..3d372c45 --- /dev/null +++ b/src/api/mall/product/management/type/index.ts @@ -0,0 +1,22 @@ +export interface SpuType { + name?: string // 商品名称 + categoryId?: number // 商品分类 + keyword?: string // 关键字 + unit?: string // 单位 + picUrl?: string // 商品封面图 + sliderPicUrls?: string[] // 商品轮播图 + introduction?: string // 商品简介 + deliveryTemplateId?: number // 运费模版 + selectRule?: string // 选择规格 TODO 暂时定义 + specType?: boolean // 商品规格 + subCommissionType?: boolean // 分销类型 + description?: string // 商品详情 + sort?: string // 商品排序 + giveIntegral?: number // 赠送积分 + virtualSalesCount?: number // 虚拟销量 + recommendHot?: boolean // 是否热卖 + recommendBenefit?: boolean // 是否优惠 + recommendBest?: boolean // 是否精品 + recommendNew?: boolean // 是否新品 + recommendGood?: boolean // 是否优品 +} diff --git a/src/utils/object.ts b/src/utils/object.ts new file mode 100644 index 00000000..8edd1888 --- /dev/null +++ b/src/utils/object.ts @@ -0,0 +1,17 @@ +/** + * 将值复制到目标对象,且以目标对象属性为准,例:target: {a:1} source:{a:2,b:3} 结果为:{a:2} + * @param target 目标对象 + * @param source 源对象 + */ +export const copyValueToTarget = (target, source) => { + const newObj = Object.assign({}, target, source) + // 删除多余属性 + Object.keys(newObj).forEach((key) => { + // 如果不是target中的属性则删除 + if (Object.keys(target).indexOf(key) === -1) { + delete newObj[key] + } + }) + // 更新目标对象值 + Object.assign(target, newObj) +} diff --git a/src/views/mall/product/management/addForm.vue b/src/views/mall/product/management/addForm.vue index d077df5b..f915b204 100644 --- a/src/views/mall/product/management/addForm.vue +++ b/src/views/mall/product/management/addForm.vue @@ -2,13 +2,25 @@ - + - + - + @@ -22,6 +34,7 @@ - diff --git a/src/views/mall/product/management/components/DescriptionForm.vue b/src/views/mall/product/management/components/DescriptionForm.vue index 53609705..f29f29b4 100644 --- a/src/views/mall/product/management/components/DescriptionForm.vue +++ b/src/views/mall/product/management/components/DescriptionForm.vue @@ -1,13 +1,79 @@ diff --git a/src/views/mall/product/management/components/OtherSettingsForm.vue b/src/views/mall/product/management/components/OtherSettingsForm.vue index e8152883..155a0aba 100644 --- a/src/views/mall/product/management/components/OtherSettingsForm.vue +++ b/src/views/mall/product/management/components/OtherSettingsForm.vue @@ -1,19 +1,19 @@ diff --git a/src/views/mall/product/management/components/ProductAttributesAddForm.vue b/src/views/mall/product/management/components/ProductAttributesAddForm.vue new file mode 100644 index 00000000..70fd2824 --- /dev/null +++ b/src/views/mall/product/management/components/ProductAttributesAddForm.vue @@ -0,0 +1,82 @@ + + diff --git a/src/views/mall/product/management/components/SkuList/index.vue b/src/views/mall/product/management/components/SkuList/index.vue new file mode 100644 index 00000000..fd148126 --- /dev/null +++ b/src/views/mall/product/management/components/SkuList/index.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/views/mall/product/management/index.vue b/src/views/mall/product/management/index.vue index 4fdfed1b..83b52f01 100644 --- a/src/views/mall/product/management/index.vue +++ b/src/views/mall/product/management/index.vue @@ -47,12 +47,7 @@ 重置 - + 新增 @@ -133,8 +128,8 @@ diff --git a/src/views/mall/product/management/components/ProductAttributesAddForm.vue b/src/views/mall/product/management/components/ProductAttributesAddForm.vue index 70fd2824..f498b7dd 100644 --- a/src/views/mall/product/management/components/ProductAttributesAddForm.vue +++ b/src/views/mall/product/management/components/ProductAttributesAddForm.vue @@ -62,7 +62,7 @@ const submitForm = async () => { const propertyId = await PropertyApi.createProperty(data) emit('success', { id: propertyId, ...formData.value, values: [] }) } else { - emit(res[0]) // 因为只用一个 + emit('success', res[0]) // 因为只用一个 } message.success(t('common.createSuccess')) dialogVisible.value = false From 538d1e0b6cc997e701a6c7cc22b6550ddf21cd42 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 30 Apr 2023 02:26:35 +0800 Subject: [PATCH 17/47] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86:=20f?= =?UTF-8?q?ix:=E6=A0=B9=E6=8D=AE=E5=95=86=E5=93=81=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=94=9F=E6=88=90=E8=A1=A8=E6=A0=BC=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/product/management/type/spuType.ts | 1 - .../management/components/BasicInfoForm.vue | 39 +++--- .../components/ProductAttributes.vue | 4 +- .../components/ProductAttributesAddForm.vue | 3 + .../management/components/SkuList/index.vue | 129 ++++++++++++++++-- 5 files changed, 140 insertions(+), 36 deletions(-) diff --git a/src/api/mall/product/management/type/spuType.ts b/src/api/mall/product/management/type/spuType.ts index f51bc526..5d9b65ef 100644 --- a/src/api/mall/product/management/type/spuType.ts +++ b/src/api/mall/product/management/type/spuType.ts @@ -9,7 +9,6 @@ export interface SpuType { sliderPicUrls?: string[] // 商品轮播图 introduction?: string // 商品简介 deliveryTemplateId?: number // 运费模版 - selectRule?: string // 选择规格 TODO 暂时定义 specType?: boolean // 商品规格 subCommissionType?: boolean // 分销类型 skus?: SkuType[] // sku数组 diff --git a/src/views/mall/product/management/components/BasicInfoForm.vue b/src/views/mall/product/management/components/BasicInfoForm.vue index 90f7c0df..d06a787d 100644 --- a/src/views/mall/product/management/components/BasicInfoForm.vue +++ b/src/views/mall/product/management/components/BasicInfoForm.vue @@ -60,7 +60,7 @@ - + 单规格 多规格 @@ -76,12 +76,17 @@ - - 添加规格 + + 添加规格 + + + + - + @@ -110,14 +115,8 @@ const props = defineProps({ }) const AttributesAddFormRef = ref() // 添加商品属性表单 const ProductManagementBasicInfoRef = ref() // 表单Ref -// 属性列表 -const attributeList = ref([ - { - id: 1, - name: '颜色', - values: [{ id: 1, name: '白色' }] - } -]) +const attributeList = ref([]) // 商品属性列表 +/** 添加商品属性 */ const addAttribute = (property: any) => { attributeList.value.push(property) } @@ -176,10 +175,10 @@ const rules = reactive({ unit: [required], introduction: [required], picUrl: [required], - sliderPicUrls: [required] + sliderPicUrls: [required], // deliveryTemplateId: [required], - // specType: [required], - // subCommissionType: [required], + specType: [required], + subCommissionType: [required] }) /** * 将传进来的值赋值给formData @@ -215,10 +214,7 @@ const validate = async () => { }) } defineExpose({ validate }) -// 选择规格 -const changeSpecType = (specType) => { - console.log(specType) -} + // 分销类型 const changeSubCommissionType = () => { // 默认为零,类型切换后也要重置为零 @@ -227,10 +223,7 @@ const changeSubCommissionType = () => { item.subCommissionSecondPrice = 0 } } -// 选择属性确认 -// const confirm = () => {} -// 添加规格 -// const addRule = () => {} + const categoryList = ref() // 分类树 onMounted(async () => { // 获得分类树 diff --git a/src/views/mall/product/management/components/ProductAttributes.vue b/src/views/mall/product/management/components/ProductAttributes.vue index 120ffd36..ea9b311a 100644 --- a/src/views/mall/product/management/components/ProductAttributes.vue +++ b/src/views/mall/product/management/components/ProductAttributes.vue @@ -49,10 +49,10 @@ const inputVisible = computed(() => (index) => { if (attributeIndex.value === index) return true }) const InputRef = ref() //标签输入框Ref -const attributeList = ref([]) +const attributeList = ref([]) // 商品属性列表 const props = defineProps({ attributeData: { - type: Object, + type: Array, default: () => {} } }) diff --git a/src/views/mall/product/management/components/ProductAttributesAddForm.vue b/src/views/mall/product/management/components/ProductAttributesAddForm.vue index f498b7dd..bd715dde 100644 --- a/src/views/mall/product/management/components/ProductAttributesAddForm.vue +++ b/src/views/mall/product/management/components/ProductAttributesAddForm.vue @@ -62,6 +62,9 @@ const submitForm = async () => { const propertyId = await PropertyApi.createProperty(data) emit('success', { id: propertyId, ...formData.value, values: [] }) } else { + if (res[0].values === null) { + res[0].values = [] + } emit('success', res[0]) // 因为只用一个 } message.success(t('common.createSuccess')) diff --git a/src/views/mall/product/management/components/SkuList/index.vue b/src/views/mall/product/management/components/SkuList/index.vue index fd148126..a3ecd9dd 100644 --- a/src/views/mall/product/management/components/SkuList/index.vue +++ b/src/views/mall/product/management/components/SkuList/index.vue @@ -1,10 +1,21 @@ - @@ -166,7 +191,8 @@ const headerNum = ref([ type: 5 } ]) -const imgViewVisible = ref(false) +const imgViewVisible = ref(false) // 商品图预览 +const imageViewerList = ref([]) // 商品图预览列表 const queryParams = reactive({ pageNo: 1, pageSize: 10 @@ -184,7 +210,21 @@ const getList = async () => { loading.value = false } } - +/** + * 更改SPU状态 + * @param row + */ +const changeStatus = (row) => { + console.log(row) +} +/** + * 商品图预览 + * @param imgUrl + */ +const imagePreview = (imgUrl: string) => { + imageViewerList.value = [imgUrl] + imgViewVisible.value = true +} /** 搜索按钮操作 */ const handleQuery = () => { getList() @@ -196,26 +236,18 @@ const resetQuery = () => { handleQuery() } +/** + * 新增或修改 + * @param id + */ const openForm = (id?: number) => { if (typeof id === 'number') { push('/product/productManagementAdd?id=' + id) + return } push('/product/productManagementAdd') } -/** 删除按钮操作 */ -// const handleDelete = async (id: number) => { -// try { -// // 删除的二次确认 -// await message.delConfirm() -// // 发起删除 -// await ProductBrandApi.deleteBrand(id) -// message.success(t('common.delSuccess')) -// // 刷新列表 -// await getList() -// } catch {} -// } - /** 初始化 **/ onMounted(() => { getList() From 0c6e3a39c95190bb54538d548c4df4f0ff4d57b4 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 4 May 2023 01:38:53 +0800 Subject: [PATCH 24/47] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E6=89=93=E9=80=9A=E6=89=80=E6=9C=89=E6=8E=A5=E5=8F=A3=EF=BC=88?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/management/spu.ts | 12 + src/utils/constants.ts | 17 ++ src/views/mall/product/management/addForm.vue | 9 +- .../components/OtherSettingsForm.vue | 1 + .../product/management/components/SkuList.vue | 3 - src/views/mall/product/management/index.vue | 234 +++++++++++++----- 6 files changed, 206 insertions(+), 70 deletions(-) diff --git a/src/api/mall/product/management/spu.ts b/src/api/mall/product/management/spu.ts index 007963bb..2aa83e7a 100644 --- a/src/api/mall/product/management/spu.ts +++ b/src/api/mall/product/management/spu.ts @@ -5,6 +5,10 @@ import type { SpuType } from './type/spuType' export const getSpuList = (params: any) => { return request.get({ url: '/product/spu/page', params }) } +// 获得spu列表tabsCount +export const getTabsCount = () => { + return request.get({ url: '/product/spu/tabsCount' }) +} // 创建商品spu export const createSpu = (data: SpuType) => { return request.post({ url: '/product/spu/create', data }) @@ -13,7 +17,15 @@ export const createSpu = (data: SpuType) => { export const updateSpu = (data: SpuType) => { return request.put({ url: '/product/spu/update', data }) } +// 更新商品spu status +export const updateStatus = (data: { id: number; status: number }) => { + return request.put({ url: '/product/spu/updateStatus', data }) +} // 获得商品spu export const getSpu = (id: number) => { return request.get({ url: `/product/spu/get-detail?id=${id}` }) } +// 删除商品Spu +export const deleteSpu = (id: number) => { + return request.delete({ url: `/product/spu/delete?id=${id}` }) +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 5cda391f..597064ee 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -220,3 +220,20 @@ export const PayRefundStatusEnum = { name: '退款关闭' } } +/** + * 商品SPU枚举类 + */ +export const ProductSpuStatusEnum = { + RECYCLE: { + status: -1, + name: '回收站' + }, + DISABLE: { + status: 0, + name: '下架' + }, + ENABLE: { + status: 1, + name: '上架' + } +} diff --git a/src/views/mall/product/management/addForm.vue b/src/views/mall/product/management/addForm.vue index 27f8a8ae..7f31871f 100644 --- a/src/views/mall/product/management/addForm.vue +++ b/src/views/mall/product/management/addForm.vue @@ -144,7 +144,7 @@ const getDetail = async () => { const submitForm = async () => { // 提交请求 formLoading.value = true - const newSkus = [...formData.value.skus] //复制一份skus保存失败时使用 + const newSkus = JSON.parse(JSON.stringify(formData.value.skus)) //深拷贝一份skus保存失败时使用 // TODO 三个表单逐一校验,如果有一个表单校验不通过则切换到对应表单,如果有两个及以上的情况则切换到最前面的一个并弹出提示消息 // 校验各表单 try { @@ -184,9 +184,12 @@ const submitForm = async () => { await managementApi.updateSpu(data) message.success(t('common.updateSuccess')) } + close() } catch (e) { - console.log(e) - console.log(newSkus) + // 如果是后端校验失败,恢复skus数据 + if (typeof e === 'string') { + formData.value.skus = newSkus + } } finally { formLoading.value = false } diff --git a/src/views/mall/product/management/components/OtherSettingsForm.vue b/src/views/mall/product/management/components/OtherSettingsForm.vue index 4469962d..bd0ca26d 100644 --- a/src/views/mall/product/management/components/OtherSettingsForm.vue +++ b/src/views/mall/product/management/components/OtherSettingsForm.vue @@ -117,6 +117,7 @@ watch( (data) => { if (!data) return copyValueToTarget(formData.value, data) + // TODO 如果先修改其他设置的值,再改变商品详情或是商品信息会重置其他设置页面中的相关值 下一个版本修复 checkboxGroup.value = [] formData.value.recommendHot ? checkboxGroup.value.push('recommendHot') : '' formData.value.recommendBenefit ? checkboxGroup.value.push('recommendBenefit') : '' diff --git a/src/views/mall/product/management/components/SkuList.vue b/src/views/mall/product/management/components/SkuList.vue index 2a7441cc..3311202a 100644 --- a/src/views/mall/product/management/components/SkuList.vue +++ b/src/views/mall/product/management/components/SkuList.vue @@ -206,9 +206,6 @@ const generateTableData = (data: any[]) => { } const buildList = build(propertiesItemList) // 如果构建后的组合数跟sku数量一样的话则不用处理,添加新属性没有属性值也不做处理 (解决编辑表单时或查看详情时数据回显问题) - console.log( - buildList.length === formData.value.skus.length || data.some((item) => item.values.length === 0) - ) if ( buildList.length === formData.value.skus.length || data.some((item) => item.values.length === 0) diff --git a/src/views/mall/product/management/index.vue b/src/views/mall/product/management/index.vue index f2e480f5..7b5fb0c1 100644 --- a/src/views/mall/product/management/index.vue +++ b/src/views/mall/product/management/index.vue @@ -57,39 +57,38 @@ - + - - - + + + + + + + + + + + + + + + + @@ -108,9 +107,9 @@ + + - From fbac522149c82db3c4a23691140b0370615a3329 Mon Sep 17 00:00:00 2001 From: Chika Date: Fri, 12 May 2023 16:10:14 +0800 Subject: [PATCH 27/47] =?UTF-8?q?Redis=E7=9B=91=E6=8E=A7=E7=94=A8Echart?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/redis/index.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/views/infra/redis/index.vue b/src/views/infra/redis/index.vue index 737d9ca2..0d68c88f 100644 --- a/src/views/infra/redis/index.vue +++ b/src/views/infra/redis/index.vue @@ -218,7 +218,6 @@ const getSummary = () => { usedMemoryInstance() } -<<<<<<< HEAD /** 命令使用情况 */ const initcommandStatsChart = async () => { usedmemoryEchartChika.series[0].data = [] @@ -257,6 +256,7 @@ const usedMemoryInstance = async () => { value: cache.value!.info.used_memory_human, name: '内存消耗' } + console.log(cache.value!.info) usedmemoryEchartChika.tooltip = { formatter: '{b}
{a} : ' + cache.value!.info.used_memory_human } @@ -265,10 +265,6 @@ const usedMemoryInstance = async () => { /** 初始化 **/ onMounted(() => { -======= -onBeforeMount(() => { - // TODO @hiiwbs 微信,优化使用 Echart 组件 ->>>>>>> e92361ed401771998c6abd6d9ba53801a6e0cfa6 readRedisInfo() // 加载数据 getSummary() From a788921d5159349b049ade57552c1fd67c8d4bf6 Mon Sep 17 00:00:00 2001 From: cxr01 <49431369+cxr01@users.noreply.github.com> Date: Sun, 14 May 2023 13:46:09 +0800 Subject: [PATCH 28/47] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E2=80=9D=E5=9C=A8=E7=BA=BF=E7=94=A8=E6=88=B7=E5=BC=BA=E9=80=80?= =?UTF-8?q?=E2=80=9C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/oauth2/token.ts | 2 +- src/views/system/oauth2/token/index.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/system/oauth2/token.ts b/src/api/system/oauth2/token.ts index 8e9dca1e..ac89ae89 100644 --- a/src/api/system/oauth2/token.ts +++ b/src/api/system/oauth2/token.ts @@ -17,6 +17,6 @@ export const getAccessTokenPage = (params: PageParam) => { } // 删除 token -export const deleteAccessToken = (accessToken: number) => { +export const deleteAccessToken = (accessToken: string) => { return request.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken }) } diff --git a/src/views/system/oauth2/token/index.vue b/src/views/system/oauth2/token/index.vue index 803cd7d1..b97506ff 100644 --- a/src/views/system/oauth2/token/index.vue +++ b/src/views/system/oauth2/token/index.vue @@ -80,7 +80,7 @@ 强退 @@ -142,12 +142,12 @@ const resetQuery = () => { } /** 强制退出操作 */ -const handleForceLogout = async (id: number) => { +const handleForceLogout = async (accessToken: string) => { try { // 删除的二次确认 await message.confirm('是否要强制退出用户') // 发起删除 - await OAuth2AccessTokenApi.deleteAccessToken(id) + await OAuth2AccessTokenApi.deleteAccessToken(accessToken) message.success(t('common.success')) // 刷新列表 await getList() From 3feb4828cd9bd62e4e365231cf71409bc91951a5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 15 May 2023 22:57:31 +0800 Subject: [PATCH 29/47] =?UTF-8?q?!148=20=E3=80=90=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E3=80=91Vue3=20=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=EF=BC=9A[?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86=20->=20Redis=E7=9B=91?= =?UTF-8?q?=E6=8E=A7]=20=E4=BD=BF=E7=94=A8Echart=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 22 ---------------------- src/views/infra/redis/index.vue | 15 ++++++++------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 6cc8746b..4f5a16bd 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -330,28 +330,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - { - path: '/infra', - component: Layout, - name: 'InfraRedis', - meta: { - hidden: true - }, - children: [ - { - path: '/infra/redis', - component: () => import('@/views/infra/redis/index.vue'), - name: 'InfraRedis', - meta: { - noCache: true, - hidden: true, - canTo: true, - title: 'REDIS测试测试测试', - activeMenu: 'infra/redis/index' - } - } - ] - }, { path: '/property', component: Layout, diff --git a/src/views/infra/redis/index.vue b/src/views/infra/redis/index.vue index 0d68c88f..011f8e59 100644 --- a/src/views/infra/redis/index.vue +++ b/src/views/infra/redis/index.vue @@ -68,8 +68,6 @@ import { GaugeChart } from 'echarts/charts' import { ToolboxComponent } from 'echarts/components' import * as RedisApi from '@/api/infra/redis' import { RedisMonitorInfoVO } from '@/api/infra/redis/types' -echarts.use([ToolboxComponent]) -echarts.use([GaugeChart]) const cache = ref() // 基本信息 @@ -145,14 +143,14 @@ const usedmemoryEchartChika = reactive({ fontSize: 15 }, pointer: { - //指针的大小 + // 指针的大小 width: 7, show: true }, detail: { textStyle: { fontWeight: 'normal', - //里面文字下的数值大小(50) + // 里面文字下的数值大小(50) fontSize: 15, color: '#FFFFFF' }, @@ -213,13 +211,13 @@ const commandStatsRefChika = reactive({ /** 加载数据 */ const getSummary = () => { - //初始化命令图表 - initcommandStatsChart() + // 初始化命令图表 + initCommandStatsChart() usedMemoryInstance() } /** 命令使用情况 */ -const initcommandStatsChart = async () => { +const initCommandStatsChart = async () => { usedmemoryEchartChika.series[0].data = [] // 发起请求 try { @@ -265,6 +263,9 @@ const usedMemoryInstance = async () => { /** 初始化 **/ onMounted(() => { + echarts.use([ToolboxComponent]) + echarts.use([GaugeChart]) + // 读取 redis 信息 readRedisInfo() // 加载数据 getSummary() From 43e541f9449e3474379b8bd7903666f783454963 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 16 May 2023 10:12:10 +0800 Subject: [PATCH 30/47] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8copyValueToTarge?= =?UTF-8?q?t=E6=96=B9=E6=B3=95=E5=88=B0utils/index=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.ts | 18 ++++++++++++++++++ src/utils/object.ts | 18 ------------------ .../product/spu/components/BasicInfoForm.vue | 9 +++++---- .../product/spu/components/DescriptionForm.vue | 2 +- .../spu/components/OtherSettingsForm.vue | 3 ++- .../mall/product/spu/components/SkuList.vue | 4 ++-- 6 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 src/utils/object.ts diff --git a/src/utils/index.ts b/src/utils/index.ts index e016c1e2..d74bbe99 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -155,3 +155,21 @@ export const fileSizeFormatter = (row, column, cellValue) => { const sizeStr = size.toFixed(2) //保留的小数位数 return sizeStr + ' ' + unitArr[index] } + +/** + * 将值复制到目标对象,且以目标对象属性为准,例:target: {a:1} source:{a:2,b:3} 结果为:{a:2} + * @param target 目标对象 + * @param source 源对象 + */ +export const copyValueToTarget = (target, source) => { + const newObj = Object.assign({}, target, source) + // 删除多余属性 + Object.keys(newObj).forEach((key) => { + // 如果不是target中的属性则删除 + if (Object.keys(target).indexOf(key) === -1) { + delete newObj[key] + } + }) + // 更新目标对象值 + Object.assign(target, newObj) +} diff --git a/src/utils/object.ts b/src/utils/object.ts deleted file mode 100644 index 6612da74..00000000 --- a/src/utils/object.ts +++ /dev/null @@ -1,18 +0,0 @@ -// TODO @puhui999:这个方法,可以考虑放到 index.js -/** - * 将值复制到目标对象,且以目标对象属性为准,例:target: {a:1} source:{a:2,b:3} 结果为:{a:2} - * @param target 目标对象 - * @param source 源对象 - */ -export const copyValueToTarget = (target, source) => { - const newObj = Object.assign({}, target, source) - // 删除多余属性 - Object.keys(newObj).forEach((key) => { - // 如果不是target中的属性则删除 - if (Object.keys(target).indexOf(key) === -1) { - delete newObj[key] - } - }) - // 更新目标对象值 - Object.assign(target, newObj) -} diff --git a/src/views/mall/product/spu/components/BasicInfoForm.vue b/src/views/mall/product/spu/components/BasicInfoForm.vue index 249a3830..222623a5 100644 --- a/src/views/mall/product/spu/components/BasicInfoForm.vue +++ b/src/views/mall/product/spu/components/BasicInfoForm.vue @@ -14,9 +14,9 @@ :data="categoryList" :props="defaultProps" check-strictly + class="w-1/1" node-key="id" placeholder="请选择商品分类" - class="w-1/1" /> @@ -27,7 +27,7 @@ - + - + @@ -112,10 +112,11 @@ import { defaultProps, handleTree } from '@/utils/tree' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import type { SpuType } from '@/api/mall/product/management/type/spuType' import { UploadImg, UploadImgs } from '@/components/UploadFile' -import { copyValueToTarget } from '@/utils/object' +import { copyValueToTarget } from '@/utils' import { ProductAttributes, ProductAttributesAddForm, SkuList } from './index' import * as ProductCategoryApi from '@/api/mall/product/category' import { propTypes } from '@/utils/propTypes' + const message = useMessage() // 消息弹窗 const props = defineProps({ diff --git a/src/views/mall/product/spu/components/DescriptionForm.vue b/src/views/mall/product/spu/components/DescriptionForm.vue index 0a7f522b..2a32e1af 100644 --- a/src/views/mall/product/spu/components/DescriptionForm.vue +++ b/src/views/mall/product/spu/components/DescriptionForm.vue @@ -10,7 +10,7 @@ import type { SpuType } from '@/api/mall/product/management/type/spuType' import { Editor } from '@/components/Editor' import { PropType } from 'vue' -import { copyValueToTarget } from '@/utils/object' +import { copyValueToTarget } from '@/utils' import { propTypes } from '@/utils/propTypes' const message = useMessage() // 消息弹窗 diff --git a/src/views/mall/product/spu/components/OtherSettingsForm.vue b/src/views/mall/product/spu/components/OtherSettingsForm.vue index c0fc5122..fb4facd7 100644 --- a/src/views/mall/product/spu/components/OtherSettingsForm.vue +++ b/src/views/mall/product/spu/components/OtherSettingsForm.vue @@ -53,8 +53,9 @@ + From 6ac8c78d570737194327958736adf05551ff4ac1 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 17 May 2023 01:37:21 +0800 Subject: [PATCH 33/47] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7=E5=8E=BB=E6=8E=89=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/spu/components/ProductAttributesAddForm.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/mall/product/spu/components/ProductAttributesAddForm.vue b/src/views/mall/product/spu/components/ProductAttributesAddForm.vue index bd715dde..002a1488 100644 --- a/src/views/mall/product/spu/components/ProductAttributesAddForm.vue +++ b/src/views/mall/product/spu/components/ProductAttributesAddForm.vue @@ -7,12 +7,9 @@ :rules="formRules" label-width="80px" > - + - - -