diff --git a/package.json b/package.json index 9b21939..65b0e32 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "path-to-regexp": "^6.2.1", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.0", + "pnpm": "^10.13.1", "print-js": "^1.6.0", "qs": "^6.11.2", "resize-observer-polyfill": "^1.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 213df9a..fc5e8fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,6 +77,9 @@ importers: pinia-plugin-persistedstate: specifier: ^3.2.0 version: 3.2.0(pinia@2.1.7(typescript@5.2.2)(vue@3.3.8(typescript@5.2.2))) + pnpm: + specifier: ^10.12.1 + version: 10.12.1 print-js: specifier: ^1.6.0 version: 1.6.0 @@ -4277,6 +4280,11 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + pnpm@10.12.1: + resolution: {integrity: sha512-8N2oWA8O6UgcXHmh2Se5Fk8sR46QmSrSaLuyRlpzaYQ5HWMz0sMnkTV4soBK8zR0ylVLopwEqLEwYKcXZ1rjrA==} + engines: {node: '>=18.12'} + hasBin: true + posix-character-classes@0.1.1: resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} engines: {node: '>=0.10.0'} @@ -10092,6 +10100,8 @@ snapshots: pluralize@8.0.0: {} + pnpm@10.12.1: {} + posix-character-classes@0.1.1: {} postcss-html@1.5.0: 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 @@ + + + + +