From e0b57b805590939b750e2a250069fad596019fff Mon Sep 17 00:00:00 2001 From: yj441106 Date: Sun, 26 Mar 2023 20:21:31 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E9=87=8D?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/oauth2/client/form.vue | 3 +- src/views/system/oauth2/client/index.vue | 350 +++++++++++------------ 2 files changed, 162 insertions(+), 191 deletions(-) diff --git a/src/views/system/oauth2/client/form.vue b/src/views/system/oauth2/client/form.vue index 0822e59f..2800bd1f 100644 --- a/src/views/system/oauth2/client/form.vue +++ b/src/views/system/oauth2/client/form.vue @@ -17,7 +17,7 @@ - + @@ -147,7 +147,6 @@ From b8ce330c12700f9de73013308656964e80e2739b Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Tue, 28 Mar 2023 20:35:31 +0800 Subject: [PATCH 02/26] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=88=86=E7=B1=BB=E6=A8=A1=E5=9D=97=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?&api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/category.ts | 60 +++++++++ src/views/mall/product/category/form.vue | 149 ++++++++++++++++++++++ src/views/mall/product/category/index.vue | 137 ++++++++++++++++++++ src/views/mall/product/category/utils.ts | 44 +++++++ 4 files changed, 390 insertions(+) create mode 100644 src/api/mall/product/category.ts create mode 100644 src/views/mall/product/category/form.vue create mode 100644 src/views/mall/product/category/index.vue create mode 100644 src/views/mall/product/category/utils.ts diff --git a/src/api/mall/product/category.ts b/src/api/mall/product/category.ts new file mode 100644 index 00000000..7ae81285 --- /dev/null +++ b/src/api/mall/product/category.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +/** + * 产品分类 + */ +export interface CategoryVO { + /** + * 分类编号 + */ + id?: number + /** + * 父分类编号 + */ + parentId?: number + /** + * 分类名称 + */ + name: string + /** + * 分类图片 + */ + picUrl: string + /** + * 分类排序 + */ + sort?: number + /** + * 分类描述 + */ + description?: string + /** + * 开启状态 + */ + status: number +} + +// 创建商品分类 +export const createCategory = (data: CategoryVO) => { + return request.post({ url: '/product/category/create', data }) +} + +// 更新商品分类 +export const updateCategory = (data: CategoryVO) => { + return request.put({ url: '/product/category/update', data }) +} + +// 删除商品分类 +export const deleteCategory = (id: number) => { + return request.delete({ url: `/product/category/delete?id=${id}` }) +} + +// 获得商品分类 +export const getCategory = (id: number) => { + return request.get({ url: `/product/category/get?id=${id}` }) +} + +// 获得商品分类列表 +export const getCategoryList = (params: any) => { + return request.get({ url: '/product/category/list', params }) +} diff --git a/src/views/mall/product/category/form.vue b/src/views/mall/product/category/form.vue new file mode 100644 index 00000000..e2b6f62a --- /dev/null +++ b/src/views/mall/product/category/form.vue @@ -0,0 +1,149 @@ + + diff --git a/src/views/mall/product/category/index.vue b/src/views/mall/product/category/index.vue new file mode 100644 index 00000000..12f51cff --- /dev/null +++ b/src/views/mall/product/category/index.vue @@ -0,0 +1,137 @@ + + diff --git a/src/views/mall/product/category/utils.ts b/src/views/mall/product/category/utils.ts new file mode 100644 index 00000000..a3774f22 --- /dev/null +++ b/src/views/mall/product/category/utils.ts @@ -0,0 +1,44 @@ +export const parseTime = (time) => { + if (!time) { + return null + } + const format = '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if (typeof time === 'string' && /^[0-9]+$/.test(time)) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time + .replace(new RegExp(/-/gm), '/') + .replace('T', ' ') + .replace(new RegExp(/\.[\d]{3}/gm), '') + } + if (typeof time === 'number' && time.toString().length === 10) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} From 4906cecd142534a912108aa04a71a4fe12bf9281 Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:57:27 +0800 Subject: [PATCH 03/26] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/property.ts | 103 +++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/api/mall/product/property.ts diff --git a/src/api/mall/product/property.ts b/src/api/mall/product/property.ts new file mode 100644 index 00000000..dd693c5c --- /dev/null +++ b/src/api/mall/product/property.ts @@ -0,0 +1,103 @@ +import request from '@/config/axios' + +/** + * 商品属性 + */ +export interface PropertyVO { + id?: number + /** 名称 */ + name: string + /** 备注 */ + remark?: string +} + +/** + * 属性值 + */ +export interface PropertyValueVO { + id?: number + /** 属性项的编号 */ + propertyId?: number + /** 名称 */ + name: string + /** 备注 */ + remark?: string +} + +/** + * 商品属性值的明细 + */ +export interface PropertyValueDetailVO { + /** 属性项的编号 */ + propertyId: number // 属性的编号 + /** 属性的名称 */ + propertyName: string + /** 属性值的编号 */ + valueId: number + /** 属性值的名称 */ + valueName: string +} + +// ------------------------ 属性项 ------------------- + +// 创建属性项 +export const createProperty = (data: PropertyVO) => { + return request.post({ url: '/product/property/create', data }) +} + +// 更新属性项 +export const updateProperty = (data: PropertyVO) => { + return request.put({ url: '/product/property/update', data }) +} + +// 删除属性项 +export const deleteProperty = (id: number) => { + return request.delete({ url: `/product/property/delete?id=${id}` }) +} + +// 获得属性项 +export const getProperty = (id: number): Promise => { + return request.get({ url: `/product/property/get?id=${id}` }) +} + +// 获得属性项分页 +export const getPropertyPage = (params: PageParam & any) => { + return request.get({ url: '/product/property/page', params }) +} + +// 获得属性项列表 +export const getPropertyList = (params: any) => { + return request.get({ url: '/product/property/list', params }) +} + +// 获得属性项列表 +export const getPropertyListAndValue = (params: any) => { + return request.get({ url: '/product/property/get-value-list', params }) +} + +// ------------------------ 属性值 ------------------- + +// 获得属性值分页 +export const getPropertyValuePage = (params: PageParam & any) => { + return request.get({ url: '/product/property/value/page', params }) +} + +// 获得属性值 +export const getPropertyValue = (id: number): Promise => { + return request.get({ url: `/product/property/value/get?id=${id}` }) +} + +// 创建属性值 +export const createPropertyValue = (data: PropertyValueVO) => { + return request.post({ url: '/product/property/value/create', data }) +} + +// 更新属性值 +export const updatePropertyValue = (data: PropertyValueVO) => { + return request.put({ url: '/product/property/value/update', data }) +} + +// 删除属性值 +export const deletePropertyValue = (id: number) => { + return request.delete({ url: `/product/property/value/delete?id=${id}` }) +} From fdbae2dd37c345173d3166231d7f4712d8c0aaf3 Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:57:48 +0800 Subject: [PATCH 04/26] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7=E5=80=BC=E8=B7=AF=E7=94=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 43375961..d768f217 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -294,6 +294,22 @@ const remainingRouter: AppRouteRecordRaw[] = [ } } ] + }, + { + path: '/property', + component: Layout, + name: 'property', + meta: { + hidden: true + }, + children: [ + { + path: 'value/:propertyId(\\d+)', + component: () => import('@/views/mall/product/property/value/index.vue'), + name: 'PropertyValue', + meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } + } + ] } ] From 1724f2c674d7d902953fbfe03a5b8840a525038f Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:58:06 +0800 Subject: [PATCH 05/26] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7(=E5=80=BC)=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/product/property/form.vue | 94 ++++++++++ src/views/mall/product/property/index.vue | 149 ++++++++++++++++ .../mall/product/property/value/form.vue | 101 +++++++++++ .../mall/product/property/value/index.vue | 162 ++++++++++++++++++ 4 files changed, 506 insertions(+) create mode 100644 src/views/mall/product/property/form.vue create mode 100644 src/views/mall/product/property/index.vue create mode 100644 src/views/mall/product/property/value/form.vue create mode 100644 src/views/mall/product/property/value/index.vue diff --git a/src/views/mall/product/property/form.vue b/src/views/mall/product/property/form.vue new file mode 100644 index 00000000..360af99b --- /dev/null +++ b/src/views/mall/product/property/form.vue @@ -0,0 +1,94 @@ + + diff --git a/src/views/mall/product/property/index.vue b/src/views/mall/product/property/index.vue new file mode 100644 index 00000000..36cb5a11 --- /dev/null +++ b/src/views/mall/product/property/index.vue @@ -0,0 +1,149 @@ + + diff --git a/src/views/mall/product/property/value/form.vue b/src/views/mall/product/property/value/form.vue new file mode 100644 index 00000000..51224986 --- /dev/null +++ b/src/views/mall/product/property/value/form.vue @@ -0,0 +1,101 @@ + + diff --git a/src/views/mall/product/property/value/index.vue b/src/views/mall/product/property/value/index.vue new file mode 100644 index 00000000..03b021ab --- /dev/null +++ b/src/views/mall/product/property/value/index.vue @@ -0,0 +1,162 @@ + + From 854bf851e899c8175b6efadfcf4196be3c1e5bda Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 30 Mar 2023 21:38:46 +0800 Subject: [PATCH 06/26] =?UTF-8?q?REVIEW=20=E7=A7=9F=E6=88=B7=E5=A5=97?= =?UTF-8?q?=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/auto-components.d.ts | 9 +++++++++ .../tenantPackage/TenantPackageForm.vue | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index a04c98b3..480691fc 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -52,13 +52,16 @@ 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'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElLink: typeof import('element-plus/es')['ElLink'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] @@ -69,7 +72,13 @@ declare module '@vue/runtime-core' { ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] 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'] + ElTransfer: typeof import('element-plus/es')['ElTransfer'] + ElTree: typeof import('element-plus/es')['ElTree'] + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] diff --git a/src/views/system/tenantPackage/TenantPackageForm.vue b/src/views/system/tenantPackage/TenantPackageForm.vue index 82fc351f..a713deea 100644 --- a/src/views/system/tenantPackage/TenantPackageForm.vue +++ b/src/views/system/tenantPackage/TenantPackageForm.vue @@ -69,7 +69,6 @@ import * as TenantPackageApi from '@/api/system/tenantPackage' import * as MenuApi from '@/api/system/menu' import { ElTree } from 'element-plus' import { handleTree } from '@/utils/tree' - const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -92,7 +91,7 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref const menuOptions = ref([]) // 树形结构数据 const menuExpand = ref(false) // 展开/折叠 -const treeRef = ref>() // 树组件Ref +const treeRef = ref() // 树组件 Ref const treeNodeAll = ref(false) // 全选/全不选 /** 打开弹窗 */ @@ -133,8 +132,8 @@ const submitForm = async () => { try { const data = formData.value as unknown as TenantPackageApi.TenantPackageVO data.menuIds = [ - ...(treeRef.value!.getCheckedKeys(false) as unknown as Array), // 获得当前选中节点 - ...(treeRef.value!.getHalfCheckedKeys() as unknown as Array) // 获得半选中的父节点 + ...(treeRef.value.getCheckedKeys(false) as unknown as Array), // 获得当前选中节点 + ...(treeRef.value.getHalfCheckedKeys() as unknown as Array) // 获得半选中的父节点 ] if (formType.value === 'create') { await TenantPackageApi.createTenantPackage(data) @@ -168,17 +167,19 @@ const resetForm = () => { formRef.value?.resetFields() } -// 全选/全不选 +/** 全选/全不选 */ const handleCheckedTreeNodeAll = () => { - treeRef.value!.setCheckedNodes(treeNodeAll.value ? menuOptions.value : []) + treeRef.value.setCheckedNodes(treeNodeAll.value ? menuOptions.value : []) } -// 全部(展开/折叠)TODO:for循环全部展开和折叠树组件数据 +/** 展开/折叠全部 */ const handleCheckedTreeExpand = () => { const nodes = treeRef.value?.store.nodesMap for (let node in nodes) { - if (nodes[node].expanded === menuExpand.value) continue - nodes[node].expanded = !nodes[node].expanded + if (nodes[node].expanded === menuExpand.value) { + continue + } + nodes[node].expanded = menuExpand.value } } From e0469bf64e236fbf2d2bba5e32e19545b736ba69 Mon Sep 17 00:00:00 2001 From: admin <> Date: Thu, 30 Mar 2023 21:42:42 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E9=87=8D=E5=86=99=E5=95=86=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/auto-components.d.ts | 2 - src/views/pay/merchant/form.vue | 110 ++++++++ src/views/pay/merchant/index.vue | 348 +++++++++++++++--------- src/views/pay/merchant/merchant.data.ts | 70 ----- 4 files changed, 327 insertions(+), 203 deletions(-) create mode 100644 src/views/pay/merchant/form.vue delete mode 100644 src/views/pay/merchant/merchant.data.ts diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index a04c98b3..dfa7c415 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -58,8 +58,6 @@ declare module '@vue/runtime-core' { ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] - ElRadio: typeof import('element-plus/es')['ElRadio'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] diff --git a/src/views/pay/merchant/form.vue b/src/views/pay/merchant/form.vue new file mode 100644 index 00000000..d89fc7a3 --- /dev/null +++ b/src/views/pay/merchant/form.vue @@ -0,0 +1,110 @@ + + diff --git a/src/views/pay/merchant/index.vue b/src/views/pay/merchant/index.vue index 1ea460ec..e9a9ff30 100644 --- a/src/views/pay/merchant/index.vue +++ b/src/views/pay/merchant/index.vue @@ -1,153 +1,239 @@ + diff --git a/src/views/pay/merchant/merchant.data.ts b/src/views/pay/merchant/merchant.data.ts deleted file mode 100644 index e0e0727d..00000000 --- a/src/views/pay/merchant/merchant.data.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - no: [required], - name: [required], - shortName: [required], - status: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - primaryTitle: '商户编号', - action: true, - columns: [ - { - title: '商户号', - field: 'no', - isSearch: true - }, - { - title: '商户全称', - field: 'code', - isSearch: true - }, - { - title: '商户简称', - field: 'shortName', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: t('form.remark'), - field: 'remark', - isTable: false, - form: { - component: 'Input', - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) From 1434cdabe0f43fc3786216e85eeb56dbdab58c7e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 30 Mar 2023 22:59:29 +0800 Subject: [PATCH 08/26] =?UTF-8?q?REVIEW=20=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=88=E8=B0=83=E6=95=B4=E5=B8=83=E5=B1=80=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenantPackage/TenantPackageForm.vue | 2 +- src/views/system/user/index.vue | 437 +++++++++--------- 2 files changed, 215 insertions(+), 224 deletions(-) diff --git a/src/views/system/tenantPackage/TenantPackageForm.vue b/src/views/system/tenantPackage/TenantPackageForm.vue index a713deea..f5e5343d 100644 --- a/src/views/system/tenantPackage/TenantPackageForm.vue +++ b/src/views/system/tenantPackage/TenantPackageForm.vue @@ -91,7 +91,7 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref const menuOptions = ref([]) // 树形结构数据 const menuExpand = ref(false) // 展开/折叠 -const treeRef = ref() // 树组件 Ref +const treeRef = ref>() // 树组件 Ref const treeNodeAll = ref(false) // 全选/全不选 /** 打开弹窗 */ diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1c36d376..aeeaced7 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -1,231 +1,220 @@ diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index aeeaced7..cdd47436 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -1,20 +1,19 @@ - diff --git a/src/views/system/user/components/UserImportForm.vue b/src/views/system/user/components/UserImportForm.vue deleted file mode 100644 index f63936e2..00000000 --- a/src/views/system/user/components/UserImportForm.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index aa2d2566..19990ca9 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -194,7 +194,7 @@ import download from '@/utils/download' import { CommonStatusEnum } from '@/utils/constants' import * as UserApi from '@/api/system/user' import UserForm from './UserForm.vue' -import UserImportForm from './components/UserImportForm.vue' +import UserImportForm from './UserImportForm.vue' import UserAssignRoleForm from './UserAssignRoleForm.vue' import DeptTree from './DeptTree.vue' const message = useMessage() // 消息弹窗 @@ -250,10 +250,10 @@ const openForm = (type: string, id?: number) => { formRef.value.open(type, id) } -// 用户导入 +/** 用户导入 */ const importFormRef = ref() const handleImport = () => { - importFormRef.value?.openForm() + importFormRef.value.open() } /** 修改用户状态 */ From f8878f7a76497d4db10f56c1c6d7ed38d090eda3 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 1 Apr 2023 09:14:59 +0800 Subject: [PATCH 13/26] =?UTF-8?q?REVIEW=20=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=88=E5=88=97=E8=A1=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/auto-components.d.ts | 2 + src/views/infra/job/form.vue | 4 +- src/views/infra/job/index.vue | 209 +++++++++++++-------------- src/views/infra/job/utils.ts | 44 ------ src/views/infra/job/view.vue | 2 +- src/views/system/errorCode/index.vue | 3 +- src/views/system/user/index.vue | 40 ++--- 7 files changed, 131 insertions(+), 173 deletions(-) delete mode 100644 src/views/infra/job/utils.ts diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 480691fc..80a5900f 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -23,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'] + ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] @@ -70,6 +71,7 @@ declare module '@vue/runtime-core' { 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'] diff --git a/src/views/infra/job/form.vue b/src/views/infra/job/form.vue index 24488fd7..b50bcacb 100644 --- a/src/views/infra/job/form.vue +++ b/src/views/infra/job/form.vue @@ -107,7 +107,7 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref /** 打开弹窗 */ -const openModal = async (type: string, id?: number) => { +const open = async (type: string, id?: number) => { modelVisible.value = true modelTitle.value = t('action.' + type) formType.value = type @@ -122,7 +122,7 @@ const openModal = async (type: string, id?: number) => { } } } -defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗 +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** cron表达式按钮操作 */ const handleShowCron = () => { diff --git a/src/views/infra/job/index.vue b/src/views/infra/job/index.vue index 702b31fe..bc4dfebc 100644 --- a/src/views/infra/job/index.vue +++ b/src/views/infra/job/index.vue @@ -1,19 +1,31 @@ + - + From 8810cb953ebd9579208b2b298a60ca76243e806a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 1 Apr 2023 14:26:29 +0800 Subject: [PATCH 17/26] =?UTF-8?q?REVIEW=20=E5=AE=9A=E6=97=B6=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/job/index.ts | 28 ++----- src/api/infra/jobLog/index.ts | 22 +---- src/router/modules/remaining.ts | 2 +- src/views/infra/job/JobDetail.vue | 4 +- src/views/infra/job/JobForm.vue | 6 +- src/views/infra/job/JobLogView.vue | 74 ----------------- src/views/infra/job/index.vue | 16 ++-- src/views/infra/job/logger/JobLogDetail.vue | 57 +++++++++++++ .../job/{JobLog.vue => logger/index.vue} | 80 +++++++++++-------- 9 files changed, 129 insertions(+), 160 deletions(-) delete mode 100644 src/views/infra/job/JobLogView.vue create mode 100644 src/views/infra/job/logger/JobLogDetail.vue rename src/views/infra/job/{JobLog.vue => logger/index.vue} (74%) diff --git a/src/api/infra/job/index.ts b/src/api/infra/job/index.ts index 63f15da0..c1398d07 100644 --- a/src/api/infra/job/index.ts +++ b/src/api/infra/job/index.ts @@ -13,50 +13,38 @@ export interface JobVO { createTime: Date } -export interface JobPageReqVO extends PageParam { - name?: string - status?: number - handlerName?: string -} - -export interface JobExportReqVO { - name?: string - status?: number - handlerName?: string -} - // 任务列表 -export const getJobPageApi = (params: JobPageReqVO) => { +export const getJobPage = (params: PageParam) => { return request.get({ url: '/infra/job/page', params }) } // 任务详情 -export const getJobApi = (id: number) => { +export const getJob = (id: number) => { return request.get({ url: '/infra/job/get?id=' + id }) } // 新增任务 -export const createJobApi = (data: JobVO) => { +export const createJob = (data: JobVO) => { return request.post({ url: '/infra/job/create', data }) } // 修改定时任务调度 -export const updateJobApi = (data: JobVO) => { +export const updateJob = (data: JobVO) => { return request.put({ url: '/infra/job/update', data }) } // 删除定时任务调度 -export const deleteJobApi = (id: number) => { +export const deleteJob = (id: number) => { return request.delete({ url: '/infra/job/delete?id=' + id }) } // 导出定时任务调度 -export const exportJobApi = (params: JobExportReqVO) => { +export const exportJob = (params) => { return request.download({ url: '/infra/job/export-excel', params }) } // 任务状态修改 -export const updateJobStatusApi = (id: number, status: number) => { +export const updateJobStatus = (id: number, status: number) => { const params = { id, status @@ -70,6 +58,6 @@ export const runJobApi = (id: number) => { } // 获得定时任务的下 n 次执行时间 -export const getJobNextTimesApi = (id: number) => { +export const getJobNextTimes = (id: number) => { return request.get({ url: '/infra/job/get_next_times?id=' + id }) } diff --git a/src/api/infra/jobLog/index.ts b/src/api/infra/jobLog/index.ts index 84b74fbd..f429cd9e 100644 --- a/src/api/infra/jobLog/index.ts +++ b/src/api/infra/jobLog/index.ts @@ -14,34 +14,18 @@ export interface JobLogVO { createTime: string } -export interface JobLogPageReqVO extends PageParam { - jobId?: number - handlerName?: string - beginTime?: string - endTime?: string - status?: number -} - -export interface JobLogExportReqVO { - jobId?: number - handlerName?: string - beginTime?: string - endTime?: string - status?: number -} - // 任务日志列表 -export const getJobLogPageApi = (params: JobLogPageReqVO) => { +export const getJobLogPage = (params: PageParam) => { return request.get({ url: '/infra/job-log/page', params }) } // 任务日志详情 -export const getJobLogApi = (id: number) => { +export const getJobLog = (id: number) => { return request.get({ url: '/infra/job-log/get?id=' + id }) } // 导出定时任务日志 -export const exportJobLogApi = (params: JobLogExportReqVO) => { +export const exportJobLog = (params) => { return request.download({ url: '/infra/job-log/export-excel', params diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 4d8c3dac..d8b5db64 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -162,7 +162,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'job-log', - component: () => import('@/views/infra/job/JobLog.vue'), + component: () => import('@/views/infra/job/logger/index.vue'), name: 'JobLog', meta: { noCache: true, diff --git a/src/views/infra/job/JobDetail.vue b/src/views/infra/job/JobDetail.vue index b8b01584..081c50de 100644 --- a/src/views/infra/job/JobDetail.vue +++ b/src/views/infra/job/JobDetail.vue @@ -59,9 +59,9 @@ const open = async (id: number) => { if (id) { detailLoading.value = true try { - detailData.value = await JobApi.getJobApi(id) + detailData.value = await JobApi.getJob(id) // 获取下一次执行时间 - nextTimes.value = await JobApi.getJobNextTimesApi(id) + nextTimes.value = await JobApi.getJobNextTimes(id) } finally { detailLoading.value = false } diff --git a/src/views/infra/job/JobForm.vue b/src/views/infra/job/JobForm.vue index 585370bf..5148d181 100644 --- a/src/views/infra/job/JobForm.vue +++ b/src/views/infra/job/JobForm.vue @@ -80,7 +80,7 @@ const open = async (type: string, id?: number) => { if (id) { formLoading.value = true try { - formData.value = await JobApi.getJobApi(id) + formData.value = await JobApi.getJob(id) } finally { formLoading.value = false } @@ -100,10 +100,10 @@ const submitForm = async () => { try { const data = formData.value as unknown as JobApi.JobVO if (formType.value === 'create') { - await JobApi.createJobApi(data) + await JobApi.createJob(data) message.success(t('common.createSuccess')) } else { - await JobApi.updateJobApi(data) + await JobApi.updateJob(data) message.success(t('common.updateSuccess')) } modelVisible.value = false diff --git a/src/views/infra/job/JobLogView.vue b/src/views/infra/job/JobLogView.vue deleted file mode 100644 index c66e0d80..00000000 --- a/src/views/infra/job/JobLogView.vue +++ /dev/null @@ -1,74 +0,0 @@ - - diff --git a/src/views/infra/job/index.vue b/src/views/infra/job/index.vue index 13a8ccd5..72f6b95b 100644 --- a/src/views/infra/job/index.vue +++ b/src/views/infra/job/index.vue @@ -172,7 +172,7 @@ const exportLoading = ref(false) // 导出的加载中 const getList = async () => { loading.value = true try { - const data = await JobApi.getJobPageApi(queryParams) + const data = await JobApi.getJobPage(queryParams) list.value = data.list total.value = data.total } finally { @@ -199,7 +199,7 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await JobApi.exportJobApi(queryParams) + const data = await JobApi.exportJob(queryParams) download.excel(data, '定时任务.xls') } catch { } finally { @@ -224,7 +224,7 @@ const handleChangeStatus = async (row: JobApi.JobVO) => { ) const status = row.status === InfraJobStatusEnum.STOP ? InfraJobStatusEnum.NORMAL : InfraJobStatusEnum.STOP - await JobApi.updateJobStatusApi(row.id, status) + await JobApi.updateJobStatus(row.id, status) message.success(text + '成功') // 刷新列表 await getList() @@ -241,7 +241,7 @@ const handleDelete = async (id: number) => { // 删除的二次确认 await message.delConfirm() // 发起删除 - await JobApi.deleteJobApi(id) + await JobApi.deleteJob(id) message.success(t('common.delSuccess')) // 刷新列表 await getList() @@ -284,10 +284,10 @@ const openDetail = (id: number) => { detailRef.value.open(id) } -// 执行日志 -const handleJobLog = (rowId?: number) => { - if (rowId) { - push('/job/job-log?id=' + rowId) +/** 跳转执行日志 */ +const handleJobLog = (id: number) => { + if (id) { + push('/job/job-log?id=' + id) } else { push('/job/job-log') } diff --git a/src/views/infra/job/logger/JobLogDetail.vue b/src/views/infra/job/logger/JobLogDetail.vue new file mode 100644 index 00000000..7c4bab2b --- /dev/null +++ b/src/views/infra/job/logger/JobLogDetail.vue @@ -0,0 +1,57 @@ + + diff --git a/src/views/infra/job/JobLog.vue b/src/views/infra/job/logger/index.vue similarity index 74% rename from src/views/infra/job/JobLog.vue rename to src/views/infra/job/logger/index.vue index daa20046..ab28b285 100644 --- a/src/views/infra/job/JobLog.vue +++ b/src/views/infra/job/logger/index.vue @@ -1,37 +1,52 @@ - + - - + + - + - diff --git a/src/views/system/role/RoleAssignMenuForm.vue b/src/views/system/role/RoleAssignMenuForm.vue new file mode 100644 index 00000000..c016a51f --- /dev/null +++ b/src/views/system/role/RoleAssignMenuForm.vue @@ -0,0 +1,161 @@ + + + diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 4be8e48c..65330fcb 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -108,7 +108,7 @@ preIcon="ep:basketball" title="菜单权限" v-hasPermi="['system:permission:assign-role-menu']" - @click="handleScope('menu', scope.row)" + @click="openAssignMenuForm(scope.row)" > 菜单权限 @@ -145,18 +145,18 @@ - + diff --git a/src/views/system/role/RoleAssignMenuForm.vue b/src/views/system/role/RoleAssignMenuForm.vue index c016a51f..db33811e 100644 --- a/src/views/system/role/RoleAssignMenuForm.vue +++ b/src/views/system/role/RoleAssignMenuForm.vue @@ -1,12 +1,6 @@ diff --git a/src/views/mall/product/category/index.vue b/src/views/mall/product/category/index.vue index 12f51cff..f91e1450 100644 --- a/src/views/mall/product/category/index.vue +++ b/src/views/mall/product/category/index.vue @@ -1,7 +1,13 @@ - + - + - diff --git a/src/views/mall/product/property/index.vue b/src/views/mall/product/property/index.vue index 36cb5a11..ea992923 100644 --- a/src/views/mall/product/property/index.vue +++ b/src/views/mall/product/property/index.vue @@ -1,13 +1,20 @@ diff --git a/src/views/mall/product/property/value/index.vue b/src/views/mall/product/property/value/index.vue index 03b021ab..85383e63 100644 --- a/src/views/mall/product/property/value/index.vue +++ b/src/views/mall/product/property/value/index.vue @@ -1,9 +1,15 @@ From a319d090bbcecaf21f60715bc4382107ab9737c8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Apr 2023 10:24:03 +0800 Subject: [PATCH 23/26] =?UTF-8?q?REVIEW=20=E6=94=AF=E4=BB=98=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/pay/merchant/index.ts | 17 +- .../merchant/{form.vue => MerchantForm.vue} | 34 ++-- src/views/pay/merchant/index.vue | 175 +++++++++--------- src/views/system/notice/index.vue | 6 +- 4 files changed, 118 insertions(+), 114 deletions(-) rename src/views/pay/merchant/{form.vue => MerchantForm.vue} (73%) diff --git a/src/api/pay/merchant/index.ts b/src/api/pay/merchant/index.ts index b4b6ba51..bfb8f5e4 100644 --- a/src/api/pay/merchant/index.ts +++ b/src/api/pay/merchant/index.ts @@ -29,17 +29,17 @@ export interface MerchantExportReqVO { } // 查询列表支付商户 -export const getMerchantPageApi = (params: MerchantPageReqVO) => { +export const getMerchantPage = (params: MerchantPageReqVO) => { return request.get({ url: '/pay/merchant/page', params }) } // 查询详情支付商户 -export const getMerchantApi = (id: number) => { +export const getMerchant = (id: number) => { return request.get({ url: '/pay/merchant/get?id=' + id }) } // 根据商户名称搜索商户列表 -export const getMerchantListByNameApi = (name: string) => { +export const getMerchantListByName = (name: string) => { return request.get({ url: '/pay/merchant/list-by-name?id=', params: { @@ -49,26 +49,27 @@ export const getMerchantListByNameApi = (name: string) => { } // 新增支付商户 -export const createMerchantApi = (data: MerchantVO) => { +export const createMerchant = (data: MerchantVO) => { return request.post({ url: '/pay/merchant/create', data }) } // 修改支付商户 -export const updateMerchantApi = (data: MerchantVO) => { +export const updateMerchant = (data: MerchantVO) => { return request.put({ url: '/pay/merchant/update', data }) } // 删除支付商户 -export const deleteMerchantApi = (id: number) => { +export const deleteMerchant = (id: number) => { return request.delete({ url: '/pay/merchant/delete?id=' + id }) } // 导出支付商户 -export const exportMerchantApi = (params: MerchantExportReqVO) => { +export const exportMerchant = (params: MerchantExportReqVO) => { return request.download({ url: '/pay/merchant/export-excel', params }) } + // 支付商户状态修改 -export const changeMerchantStatusApi = (id: number, status: number) => { +export const updateMerchantStatus = (id: number, status: number) => { const data = { id, status diff --git a/src/views/pay/merchant/form.vue b/src/views/pay/merchant/MerchantForm.vue similarity index 73% rename from src/views/pay/merchant/form.vue rename to src/views/pay/merchant/MerchantForm.vue index d89fc7a3..1e09fb8c 100644 --- a/src/views/pay/merchant/form.vue +++ b/src/views/pay/merchant/MerchantForm.vue @@ -1,15 +1,14 @@