From ecdf3a4f4af8dbfc9768bc9900275a4b3c36e526 Mon Sep 17 00:00:00 2001 From: Dreamglade Date: Thu, 24 Jul 2025 17:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=82=E7=BA=A7=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/api/system/config/Factory.ts | 39 ++++++++ src/views/system/config/Factory/Factory.ts | 56 +++++++++++ .../system/config/Factory/FactoryModal.vue | 79 +++++++++++++++ src/views/system/config/Factory/index.vue | 95 +++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 src/api/system/config/Factory.ts create mode 100644 src/views/system/config/Factory/Factory.ts create mode 100644 src/views/system/config/Factory/FactoryModal.vue create mode 100644 src/views/system/config/Factory/index.vue diff --git a/src/api/system/config/Factory.ts b/src/api/system/config/Factory.ts new file mode 100644 index 0000000..fd20904 --- /dev/null +++ b/src/api/system/config/Factory.ts @@ -0,0 +1,39 @@ +import { defHttp } from '@/utils/http/axios' + +// 定义新增或修改时,需要发送给后端的数据结构 +export interface FactoryVO { + id?: number + name: string // 电厂名称 + shortName?: string // 电厂简称 + areaId: number // 所属集团编号 +} + +// 定义分页查询时的参数 +export interface FactoryPageReqVO { + name?: string +} + +// 查询厂级列表 +export function getFactoryPage(params: FactoryPageReqVO) { + return defHttp.get({ url: '/system/Factory/page', params }) +} + +// 查询厂级详情 +export function getFactory(id: number) { + return defHttp.get({ url: `/system/Factory/get?id=${id}` }) +} + +// 新增厂级 +export function createFactory(data: FactoryVO) { + return defHttp.post({ url: '/system/Factory/create', data }) +} + +// 修改厂级 +export function updateFactory(data: FactoryVO) { + return defHttp.put({ url: '/system/Factory/update', data }) +} + +// 删除厂级 +export function deleteFactory(id: number) { + return defHttp.delete({ url: `/system/Factory/delete?id=${id}` }) +} diff --git a/src/views/system/config/Factory/Factory.ts b/src/views/system/config/Factory/Factory.ts new file mode 100644 index 0000000..3d94031 --- /dev/null +++ b/src/views/system/config/Factory/Factory.ts @@ -0,0 +1,56 @@ +import type { BasicColumn, FormSchema } from '@/components/Table' + +// 表格列定义 (已按您要求移除“集团编号”) +export const columns: BasicColumn[] = [ + { + title: '电厂编号', + dataIndex: 'id', + width: 80, + }, + { + title: '集团名称', + dataIndex: 'areaName', + width: 180, + }, + { + title: '电厂名称', + dataIndex: 'name', + width: 180, + }, + { + title: '电厂简称', + dataIndex: 'shortName', + width: 150, + }, +] + +// 表单定义 +export const formSchema: FormSchema[] = [ + { + label: '电厂编号', + field: 'id', + show: false, + component: 'Input', + }, + { + label: '所属集团', + field: 'areaId', + required: true, + component: 'Select', + componentProps: { + options: [], + }, + }, + { + label: '电厂名称', + field: 'name', + required: true, + component: 'Input', + }, + { + label: '电厂简称', + field: 'shortName', + required: true, + component: 'Input', + }, +] \ No newline at end of file diff --git a/src/views/system/config/Factory/FactoryModal.vue b/src/views/system/config/Factory/FactoryModal.vue new file mode 100644 index 0000000..d24d5e5 --- /dev/null +++ b/src/views/system/config/Factory/FactoryModal.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/views/system/config/Factory/index.vue b/src/views/system/config/Factory/index.vue new file mode 100644 index 0000000..6ba3083 --- /dev/null +++ b/src/views/system/config/Factory/index.vue @@ -0,0 +1,95 @@ + + + + +