From 726bb3c163d33974665cabad4740c6548efb8807 Mon Sep 17 00:00:00 2001 From: gxwebsoft Date: Sun, 25 Feb 2024 15:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=9A=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E7=BB=B4=E4=BF=9D=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/tower/security/model/index.ts | 5 + src/api/tower/security2/index.ts | 105 +++ src/api/tower/security2/model/index.ts | 31 + .../accessory/components/accessory-edit.vue | 673 +++++++++--------- .../tower/maintenance/security/index.vue | 76 +- .../security2/components/category-edit.vue | 249 +++++++ .../security2/components/security-edit.vue | 279 ++++++++ .../security2/components/security-record.vue | 169 +++++ .../tower/maintenance/security2/index.vue | 300 ++++++++ 10 files changed, 1525 insertions(+), 366 deletions(-) create mode 100644 src/api/tower/security2/index.ts create mode 100644 src/api/tower/security2/model/index.ts create mode 100644 src/views/tower/maintenance/security2/components/category-edit.vue create mode 100644 src/views/tower/maintenance/security2/components/security-edit.vue create mode 100644 src/views/tower/maintenance/security2/components/security-record.vue create mode 100644 src/views/tower/maintenance/security2/index.vue diff --git a/.env.development b/.env.development index 1af570f..537e29b 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ VITE_APP_NAME=后台管理系统 -VITE_API_URL=http://127.0.0.1:10041/api -#VITE_API_URL=http://1.14.159.185:10041/api +#VITE_API_URL=http://127.0.0.1:10041/api +VITE_API_URL=http://1.14.159.185:10041/api diff --git a/src/api/tower/security/model/index.ts b/src/api/tower/security/model/index.ts index 7c75c16..727166f 100644 --- a/src/api/tower/security/model/index.ts +++ b/src/api/tower/security/model/index.ts @@ -1,6 +1,7 @@ import type { PageParam } from '@/api'; export interface Security { + type: number; securityId?: number; projectName?: string; projectId?: number; @@ -13,6 +14,10 @@ export interface Security { city?: string; region?: string; address?: string; + problem?: string; + processingMethod?: string; + files?: string; + replaceAccessories?: number; status?: number; userId?: number; comments?: string; diff --git a/src/api/tower/security2/index.ts b/src/api/tower/security2/index.ts new file mode 100644 index 0000000..7bfffba --- /dev/null +++ b/src/api/tower/security2/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { Security, SecurityParam } from '@/api/tower/security/model'; +/** + * 分页查询仓库 + */ +export async function pageSecurity(params: SecurityParam) { + const res = await request.get>>( + '/tower/tower-security/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询仓库列表 + */ +export async function listSecurity(params?: SecurityParam) { + const res = await request.get>( + '/tower/tower-security', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加仓库 + */ +export async function addSecurity(data: Security) { + const res = await request.post>( + '/tower/tower-security', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改仓库 + */ +export async function updateSecurity(data: Security) { + const res = await request.put>( + '/tower/tower-security', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 绑定仓库 + */ +export async function bindSecurity(data: Security) { + const res = await request.put>( + '/tower/tower-security/bind', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除仓库 + */ +export async function removeSecurity(id?: number) { + const res = await request.delete>( + '/tower/tower-security/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除仓库 + */ +export async function removeBatchSecurity(data: (number | undefined)[]) { + const res = await request.delete>( + '/tower/tower-security/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/tower/security2/model/index.ts b/src/api/tower/security2/model/index.ts new file mode 100644 index 0000000..7c75c16 --- /dev/null +++ b/src/api/tower/security2/model/index.ts @@ -0,0 +1,31 @@ +import type { PageParam } from '@/api'; + +export interface Security { + securityId?: number; + projectName?: string; + projectId?: number; + securityCode?: string; + regionName?: string; + longitude?: string; + latitude?: string; + country?: string; + province?: string; + city?: string; + region?: string; + address?: string; + status?: number; + userId?: number; + comments?: string; + sortNumber?: number; +} + +/** + * 搜索条件 + */ +export interface SecurityParam extends PageParam { + securityId?: number; + projectId?: number; + projectName?: string; + status?: number; + keywords?: string; +} diff --git a/src/views/tower/accessory/components/accessory-edit.vue b/src/views/tower/accessory/components/accessory-edit.vue index 9584427..f1c2c33 100644 --- a/src/views/tower/accessory/components/accessory-edit.vue +++ b/src/views/tower/accessory/components/accessory-edit.vue @@ -1,219 +1,219 @@ diff --git a/src/views/tower/maintenance/security/index.vue b/src/views/tower/maintenance/security/index.vue index d6831ad..4080463 100644 --- a/src/views/tower/maintenance/security/index.vue +++ b/src/views/tower/maintenance/security/index.vue @@ -1,6 +1,6 @@