From 3f92f3843b31fd9e639ff7a37234af6be333ef2d Mon Sep 17 00:00:00 2001 From: chenfang Date: Sun, 7 Apr 2024 10:14:19 +0800 Subject: [PATCH] =?UTF-8?q?app=E5=8D=87=E7=BA=A7=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/systemInstallPackage/index.ts | 57 ++++++ .../system/systemInstallPackage/index.vue | 183 ++++++++++++++++++ .../systemInstallPackage.data.ts | 84 ++++++++ 3 files changed, 324 insertions(+) create mode 100644 src/api/wms/systemInstallPackage/index.ts create mode 100644 src/views/system/systemInstallPackage/index.vue create mode 100644 src/views/system/systemInstallPackage/systemInstallPackage.data.ts diff --git a/src/api/wms/systemInstallPackage/index.ts b/src/api/wms/systemInstallPackage/index.ts new file mode 100644 index 000000000..b92b09604 --- /dev/null +++ b/src/api/wms/systemInstallPackage/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface SystemInstallPackageVO { + id: number + installPackageName: string + installPackageVersion: number + installPackageUrl: string + isForcedUpdate: string + updateContent: string + remark: string +} + +// 查询安装包信息列表 +export const getSystemInstallPackagePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/system-install-package/senior', data }) + } else { + return await request.get({ url: `/wms/system-install-package/page`, params }) + } +} + +// 查询安装包信息详情 +export const getSystemInstallPackage = async (id: number) => { + return await request.get({ url: `/wms/system-install-package/get?id=` + id }) +} + +// 新增安装包信息 +export const createSystemInstallPackage = async (data: SystemInstallPackageVO) => { + return await request.post({ url: `/wms/system-install-package/create`, data }) +} + +// 修改安装包信息 +export const updateSystemInstallPackage = async (data: SystemInstallPackageVO) => { + return await request.put({ url: `/wms/system-install-package/update`, data }) +} + +// 删除安装包信息 +export const deleteSystemInstallPackage = async (id: number) => { + return await request.delete({ url: `/wms/system-install-package/delete?id=` + id }) +} + +// 导出安装包信息 Excel +export const exportSystemInstallPackage = async (params) => { + return await request.download({ url: `/wms/system-install-package/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/system-install-package/get-import-template' }) +} + +// 返回最新版本安装包信息 +export const returnNewFileSystemInstallPackage = async (data: SystemInstallPackageVO) => { + return await request.post({ url: `/wms/system-install-package/returnNewFile`, data }) +} \ No newline at end of file diff --git a/src/views/system/systemInstallPackage/index.vue b/src/views/system/systemInstallPackage/index.vue new file mode 100644 index 000000000..f6b9543ac --- /dev/null +++ b/src/views/system/systemInstallPackage/index.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/views/system/systemInstallPackage/systemInstallPackage.data.ts b/src/views/system/systemInstallPackage/systemInstallPackage.data.ts new file mode 100644 index 000000000..5af715118 --- /dev/null +++ b/src/views/system/systemInstallPackage/systemInstallPackage.data.ts @@ -0,0 +1,84 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const SystemInstallPackageRules = reactive({ + installPackageName: [required], + installPackageVersion: [required], + installPackageUrl: [required], + isForcedUpdate: [required], +}) + +export const SystemInstallPackage = useCrudSchemas(reactive([ + { + label: '安装包名称', + field: 'installPackageName', + sort: 'custom', + isSearch: true, + }, + { + label: '安装包版本', + field: 'installPackageVersion', + sort: 'custom', + }, + { + label: '安装路径', + field: 'installPackageUrl', + sort: 'custom', + }, + { + label: '是否强制更新', + field: 'isForcedUpdate', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '更新内容', + field: 'updateContent', + sort: 'custom', + + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))