diff --git a/.env.development b/.env.development index aecb34d..3f301b4 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,6 @@ ENV = 'development' # 本地环境接口地址 -VITE_API_URL = 'http://192.168.3.200:8808/' +# VITE_API_URL = 'http://192.168.3.200:8808/' +VITE_API_URL = 'http://192.168.3.11:8808/' + diff --git a/src/api/assets/asset/index.ts b/src/api/assets/asset/index.ts new file mode 100644 index 0000000..03e927a --- /dev/null +++ b/src/api/assets/asset/index.ts @@ -0,0 +1,78 @@ +import { newService } from '/@/utils/request'; + +// 资产列表查询参数 +export interface AssetQueryParams { + name?: string; + type?: string; + status?: number; + page?: number; + pageSize?: number; +} + +// 获取资产列表 +export function listAssets(params?: AssetQueryParams) { + return newService({ + url: '/assets/asset/listAssets', + method: 'get', + params, + }); +} + +// 更新资产状态 +export function updateAssetStatus(id: string, status: number) { + return newService({ + url: '/assets/asset/updateAssetStatus', + method: 'put', + data: { id, status }, + }); +} + +// 删除资产 +export function deleteAsset(id: string) { + return newService({ + url: '/assets/asset/deleteAsset', + method: 'delete', + params: { id }, + }); +} + +// 获取资产详情 +export function getAsset(id: string) { + return newService({ + url: '/assets/asset/getAsset', + method: 'get', + params: { id }, + }); +} + +// 获取分类选项 +export function getAssetCategories() { + return newService({ + url: '/assets/asset/getAsset', + method: 'get', + }); +} + +// 新增资产(支持文件上传) +export function createAsset(data: FormData) { + return newService({ + url: '/assets/asset/createAsset', + method: 'post', + data, + headers: { + 'Content-Type': 'multipart/form-data', + }, + }); +} + +// 修改资产(支持文件上传) +export function updateAsset(data: FormData) { + return newService({ + url: '/assets/asset/updateAsset', + method: 'put', + data, + headers: { + 'Content-Type': 'multipart/form-data', + }, + }); +} diff --git a/src/api/assets/category/index.ts b/src/api/assets/category/index.ts index f9f491b..b8f7316 100644 --- a/src/api/assets/category/index.ts +++ b/src/api/assets/category/index.ts @@ -20,6 +20,14 @@ export function getCategory(id: string) { }); } +// 获取属性类型选项 +export function getCategoryAttrTypeOptions() { + return newService({ + url: '/assets/category/getCategoryAttrTypeOptions', + method: 'get', + }); +} + // 新增分类 export function addCategory(data: object) { return newService({ diff --git a/src/utils/request.ts b/src/utils/request.ts index 19de1e4..00d70fd 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -22,7 +22,8 @@ const service: AxiosInstance = axios.create({ const newService: AxiosInstance = axios.create({ // baseURL: 'http://192.168.3.95:8000/', // baseURL: 'http://192.168.3.49:8000/', - baseURL: 'http://192.168.3.200:8000/', + baseURL: 'http://192.168.3.11:8000/', + // baseURL: 'http://192.168.3.200:8000/', timeout: 50000, headers: { 'Content-Type': 'application/json' }, paramsSerializer: { diff --git a/src/views/assets/asset/component/editAsset.vue b/src/views/assets/asset/component/editAsset.vue new file mode 100644 index 0000000..b929a98 --- /dev/null +++ b/src/views/assets/asset/component/editAsset.vue @@ -0,0 +1,853 @@ + + + + + + 基础信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 分类属性 + + + + + + + + + + + + + + + + + + + + + + 上传图片 + + + + + + + + 资产描述 + + + + + + + + 图片信息 + + + + + + + + + + + + + + + + + + + + + 实物资产配置 + + + + + + + + + + + + + + + + + + 小时 + + + + + + + + 虚拟资产配置 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 服务资产配置 + + + + + + + 分钟 + + + + + + 分钟 + + + + + + 分钟 + + + + + + 0=无限 + + + + + + + + + + + + + - + + + + + 添加时间段 + + + + + + + + + + + + + + + + + + + + + + + 添加例外 + + + + + + + 取 消 + {{ isEdit ? '修 改' : '添 加' }} + + + + + + + + + + + + + + + + diff --git a/src/views/assets/asset/index.vue b/src/views/assets/asset/index.vue new file mode 100644 index 0000000..bb0b360 --- /dev/null +++ b/src/views/assets/asset/index.vue @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + 重置 + + + + 新增 + + + + + + + + + + {{ getTypeLabel(scope.row.type) }} + + + + + + + + + + + + + + 修改 + 添加SKU + 删除 + + + + + + + + + + + + + + + + + + diff --git a/src/views/assets/category/component/editCategory.vue b/src/views/assets/category/component/editCategory.vue index 390f850..0f9ae7a 100644 --- a/src/views/assets/category/component/editCategory.vue +++ b/src/views/assets/category/component/editCategory.vue @@ -1,6 +1,6 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + 属性名称 + 属性类型 + 字典 + 字典值 + 操作 + + + + + + {{ attr.description || '请选择字典' }} + + + + + + + + + + + + + + + + - + + + + + + + + - 添加属性 @@ -105,10 +116,10 @@ export default {