From 4bb3239161e0de082f471737ea9cb4f72f6bea8a Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Fri, 25 Jul 2025 16:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A8=A1=E7=89=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/template/index.ts | 48 ++++ src/utils/dict.ts | 4 +- src/views/system/template/TemplateForm.vue | 133 +++++++++ src/views/system/template/index.vue | 300 +++++++++++++++++++++ 4 files changed, 484 insertions(+), 1 deletion(-) create mode 100644 src/api/system/template/index.ts create mode 100644 src/views/system/template/TemplateForm.vue create mode 100644 src/views/system/template/index.vue diff --git a/src/api/system/template/index.ts b/src/api/system/template/index.ts new file mode 100644 index 0000000..6a81c01 --- /dev/null +++ b/src/api/system/template/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +// 模板 VO +export interface TemplateVO { + id: number // 主键ID + type: string // 类型 + orgid: number // 组织ID + content: string // 内容 + createtime: Date // 创建时间 + updatetime: Date // 更新时间 +} + +// 模板 API +export const TemplateApi = { + // 查询模板分页 + getTemplatePage: async (params: any) => { + return await request.get({ url: `/system/template/page`, params }) + }, + + // 查询模板详情 + getTemplate: async (id: number) => { + return await request.get({ url: `/system/template/get?id=` + id }) + }, + // 查询模板列表 + getTemplateList: async (type: string, orgid: number) => { + return await request.get({ url: `/system/template/list?type=` + type + `&orgid=` + orgid }) + }, + + // 新增模板 + createTemplate: async (data: TemplateVO) => { + return await request.post({ url: `/system/template/create`, data }) + }, + + // 修改模板 + updateTemplate: async (data: TemplateVO) => { + return await request.put({ url: `/system/template/update`, data }) + }, + + // 删除模板 + deleteTemplate: async (id: number) => { + return await request.delete({ url: `/system/template/delete?id=` + id }) + }, + + // 导出模板 Excel + exportTemplate: async (params) => { + return await request.download({ url: `/system/template/export-excel`, params }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 947f9f3..2ee3b1d 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -244,5 +244,7 @@ export enum DICT_TYPE { IOT_PLUGIN_STATUS = 'iot_plugin_status', // IOT 插件状态 IOT_PLUGIN_TYPE = 'iot_plugin_type', // IOT 插件类型 IOT_DATA_BRIDGE_DIRECTION_ENUM = 'iot_data_bridge_direction_enum', // 桥梁方向 - IOT_DATA_BRIDGE_TYPE_ENUM = 'iot_data_bridge_type_enum' // 桥梁类型 + IOT_DATA_BRIDGE_TYPE_ENUM = 'iot_data_bridge_type_enum', // 桥梁类型 + //=================TEMPLATE_TYPE================= + TEMPLATE_TYPE = 'template_type' // 模板类型 } diff --git a/src/views/system/template/TemplateForm.vue b/src/views/system/template/TemplateForm.vue new file mode 100644 index 0000000..b8466af --- /dev/null +++ b/src/views/system/template/TemplateForm.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/views/system/template/index.vue b/src/views/system/template/index.vue new file mode 100644 index 0000000..411e196 --- /dev/null +++ b/src/views/system/template/index.vue @@ -0,0 +1,300 @@ + + + + +