diff --git a/apps/web-antd/src/api/property/productManagement/index.ts b/apps/web-antd/src/api/property/productManagement/index.ts new file mode 100644 index 00000000..0ea10c5e --- /dev/null +++ b/apps/web-antd/src/api/property/productManagement/index.ts @@ -0,0 +1,61 @@ +import type { PropertyVO, PropertyForm, PropertyQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询绿植租赁-绿植产品列表 +* @param params +* @returns 绿植租赁-绿植产品列表 +*/ +export function plantsProductList(params?: PropertyQuery) { + return requestClient.get>('/property/plantsProduct/list', { params }); +} + +/** + * 导出绿植租赁-绿植产品列表 + * @param params + * @returns 绿植租赁-绿植产品列表 + */ +export function plantsProductExport(params?: PropertyQuery) { + return commonExport('/property/plantsProduct/export', params ?? {}); +} + +/** + * 查询绿植租赁-绿植产品详情 + * @param id id + * @returns 绿植租赁-绿植产品详情 + */ +export function plantsProductInfo(id: ID) { + return requestClient.get(`/property/plantsProduct/${id}`); +} + +/** + * 新增绿植租赁-绿植产品 + * @param data + * @returns void + */ +export function plantsProductAdd(data: PropertyForm) { + return requestClient.postWithMsg('/property/plantsProduct', data); +} + +/** + * 更新绿植租赁-绿植产品 + * @param data + * @returns void + */ +export function plantsProductUpdate(data: PropertyForm) { + return requestClient.putWithMsg('/property/plantsProduct', data); +} + +/** + * 删除绿植租赁-绿植产品 + * @param id id + * @returns void + */ +export function plantsProductRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/plantsProduct/${id}`); +} diff --git a/apps/web-antd/src/api/property/productManagement/model.d.ts b/apps/web-antd/src/api/property/productManagement/model.d.ts new file mode 100644 index 00000000..7f6f1bb4 --- /dev/null +++ b/apps/web-antd/src/api/property/productManagement/model.d.ts @@ -0,0 +1,154 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface PropertyVO { + /** + * 主键 + */ + id: string | number; + + /** + * 产品编号 + */ + plantCode: string; + + /** + * 产品名称 + */ + plantName: string; + + /** + * 产品分类 + */ + plantType: number; + + /** + * 产品图片 + */ + imgPath: string; + + /** + * 规格 + */ + specification: string; + + /** + * 租金 + */ + rent: number; + + /** + * 库存数量 + */ + inventory: number; + + /** + * 状态(0下架 1上架 ) + */ + state: number; + + /** + * 备注 + */ + remark: string; + +} + +export interface PropertyForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 产品编号 + */ + plantCode?: string; + + /** + * 产品名称 + */ + plantName?: string; + + /** + * 产品分类 + */ + plantType?: number; + + /** + * 产品图片 + */ + imgPath?: string; + + /** + * 规格 + */ + specification?: string; + + /** + * 租金 + */ + rent?: number; + + /** + * 库存数量 + */ + inventory?: number; + + /** + * 状态(0下架 1上架 ) + */ + state?: number; + + /** + * 备注 + */ + remark?: string; + +} + +export interface PropertyQuery extends PageQuery { + /** + * 产品编号 + */ + plantCode?: string; + + /** + * 产品名称 + */ + plantName?: string; + + /** + * 产品分类 + */ + plantType?: number; + + /** + * 产品图片 + */ + imgPath?: string; + + /** + * 规格 + */ + specification?: string; + + /** + * 租金 + */ + rent?: number; + + /** + * 库存数量 + */ + inventory?: number; + + /** + * 状态(0下架 1上架 ) + */ + state?: number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/data.ts b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/data.ts new file mode 100644 index 00000000..0364387f --- /dev/null +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/data.ts @@ -0,0 +1,163 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getDictOptions } from '#/utils/dict'; +import { renderDict } from '#/utils/render'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'plantName', + label: '产品名称:', + }, + { + component: 'Input', + fieldName: 'specification', + label: '规格:', + }, + { + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护 + options: getDictOptions('product_management_status'), + }, + fieldName: 'state', + label: '状态:', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '主键', + field: 'id', + }, + { + title: '产品编号', + field: 'plantCode', + }, + { + title: '产品名称', + field: 'plantName', + }, + { + title: '产品分类', + field: 'plantType', + }, + { + title: '图片', + field: 'imgPath', + }, + { + title: '规格', + field: 'specification', + }, + { + title: '租金', + field: 'rent', + }, + { + title: '库存数量', + field: 'inventory', + }, + { + title: '状态', + field: 'state', + slots: { + default: ({ row }) => { + // 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护 + return renderDict(row.state, 'product_management_status'); + }, + }, + }, + { + title: '备注', + field: 'remark', + }, + { + title: '创建时间', + field: 'createTime', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '产品编号', + fieldName: 'plantCode', + component: 'Input', + rules: 'required', + }, + { + label: '产品名称', + fieldName: 'plantName', + component: 'Input', + rules: 'required', + }, + { + label: '产品分类', + fieldName: 'plantType', + component: 'Input', + rules: 'required', + }, + { + label: '图片', + fieldName: 'imgPath', + component: 'Input', + }, + { + label: '规格', + fieldName: 'specification', + component: 'Input', + rules: 'required', + }, + { + label: '租金', + fieldName: 'rent', + component: 'Input', + rules: 'required', + }, + { + label: '库存数量', + fieldName: 'inventory', + component: 'Input', + rules: 'required', + }, + { + label: '状态', + fieldName: 'state', + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护 + options: getDictOptions('product_management_status'), + }, + rules: 'selectRequired', + }, + { + label: '备注', + fieldName: 'remark', + component: 'Input', + }, + // { + // label: '创建时间', + // fieldName: 'creatTime', + // component: 'Input', + // }, +]; diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/index.vue b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/index.vue index 39411578..1e8ee384 100644 --- a/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/index.vue +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/index.vue @@ -1,5 +1,176 @@ + + \ No newline at end of file + + + + + + + + diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/property-modal.vue b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/property-modal.vue new file mode 100644 index 00000000..fc0576f3 --- /dev/null +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/productManagement/property-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index 34c58658..a431183e 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -28,7 +28,7 @@ export default defineConfig(async () => { rewrite: (path) => path.replace(/^\/api/, ''), // mock代理目标地址 // target: 'http://by.missmoc.top:3010/', - target: 'http://127.0.0.1:8080/', + target: 'http://47.109.37.87:3010', ws: true, }, },