fix: build

This commit is contained in:
louis 2024-03-04 11:29:26 +08:00
parent a1084ee5ed
commit c7c774f801
7 changed files with 151 additions and 40 deletions

View File

@ -1,7 +1,4 @@
FROM nginx:alpine as production
EXPOSE 80
FROM node:20-slim as base FROM node:20-slim as base
ENV PROJECT_DIR=/huaxin-front \ ENV PROJECT_DIR=/huaxin-front \
PNPM_HOME="/pnpm" \ PNPM_HOME="/pnpm" \
@ -28,7 +25,10 @@ RUN pnpm run build
FROM base AS result FROM base AS result
COPY --from=prod-deps $PROJECT_DIR/node_modules $PROJECT_DIR/node_modules COPY --from=prod-deps $PROJECT_DIR/node_modules $PROJECT_DIR/node_modules
COPY --from=builder $PROJECT_DIR/dist $PROJECT_DIR/dist COPY --from=builder $PROJECT_DIR/dist $PROJECT_DIR/dist
COPY --from=builder $PROJECT_DIR/dist/ /usr/share/nginx/html
COPY --from=builder $PROJECT_DIR/nginx.conf /etc/nginx/nginx.conf
# 构建nginx,并且在result之后拷贝dist到nginx中其中包含了自定义nginx.conf
# 构建nginx,并且在result之后拷贝dist到nginx中其中包含了自定义nginx.conf,
FROM nginx:alpine as production
ENV PROJECT_DIR=/huaxin-front
COPY --from=result $PROJECT_DIR/dist/ /usr/share/nginx/html
COPY --from=result $PROJECT_DIR/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

View File

@ -26,6 +26,8 @@ import * as netDiskManage from './netDiskManage';
import * as netDiskOverview from './netDiskOverview'; import * as netDiskOverview from './netDiskOverview';
import * as businessTodo from './businessTodo'; import * as businessTodo from './businessTodo';
import * as contract from './contract'; import * as contract from './contract';
import * as materialsInventory from './materialsInventory';
export default { export default {
auth, auth,
account, account,
@ -51,4 +53,5 @@ export default {
netDiskOverview, netDiskOverview,
businessTodo, businessTodo,
contract, contract,
materialsInventory
}; };

View File

@ -1,9 +1,12 @@
import { request, type RequestOptions } from '@/utils/request'; import { request, type RequestOptions } from '@/utils/request';
/** 获取原材料盘点列表 GET /api/contract */ /** 获取原材料盘点列表 GET /api/materials-inventory */
export async function materialsInventoryList(params: API.MaterialsInventoryListParams, options?: RequestOptions) { export async function materialsInventoryList(
params: API.MaterialsInventoryListParams,
options?: RequestOptions,
) {
return request<{ return request<{
items?: API.ContractEntity[]; items?: API.MaterialsInventoryEntity[];
meta?: { meta?: {
itemCount?: number; itemCount?: number;
totalItems?: number; totalItems?: number;
@ -11,7 +14,7 @@ export async function materialsInventoryList(params: API.MaterialsInventoryListP
totalPages?: number; totalPages?: number;
currentPage?: number; currentPage?: number;
}; };
}>('/api/contract', { }>('/api/materials-inventory', {
method: 'GET', method: 'GET',
params: { params: {
// page has a default value: 1 // page has a default value: 1
@ -25,9 +28,12 @@ export async function materialsInventoryList(params: API.MaterialsInventoryListP
}); });
} }
/** 新增原材料盘点 POST /api/contract */ /** 新增原材料盘点 POST /api/materials-inventory */
export async function contractCreate(body: API.ContractDto, options?: RequestOptions) { export async function materialsInventoryCreate(
return request<any>('/api/contract', { body: API.MaterialsInventoryDto,
options?: RequestOptions,
) {
return request<any>('/api/materials-inventory', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -37,29 +43,29 @@ export async function contractCreate(body: API.ContractDto, options?: RequestOpt
}); });
} }
/** 获取原材料盘点信息 GET /api/contract/${param0} */ /** 获取原材料盘点信息 GET /api/materials-inventory/${param0} */
export async function contractInfo( export async function materialsInventoryInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ContractInfoParams, params: API.MaterialsInventoryInfoParams,
options?: RequestOptions, options?: RequestOptions,
) { ) {
const { id: param0, ...queryParams } = params; const { id: param0, ...queryParams } = params;
return request<API.ContractEntity>(`/api/contract/${param0}`, { return request<API.MaterialsInventoryEntity>(`/api/contract/${param0}`, {
method: 'GET', method: 'GET',
params: { ...queryParams }, params: { ...queryParams },
...(options || {}), ...(options || {}),
}); });
} }
/** 解除原材料盘点和附件关联 PUT /api/contract/unlink-attachments/${param0} */ /** 解除原材料盘点和附件关联 PUT /api/materials-inventory/unlink-attachments/${param0} */
export async function unlinkAttachments( export async function unlinkAttachments(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ContractUpdateParams, params: API.MaterialsInventoryUpdateParams,
body: API.ContractUpdateDto, body: API.MaterialsInventoryDto,
options?: RequestOptions, options?: RequestOptions,
) { ) {
const { id: param0, ...queryParams } = params; const { id: param0, ...queryParams } = params;
return request<any>(`/api/contract/unlink-attachments/${param0}`, { return request<any>(`/api/materials-inventory/unlink-attachments/${param0}`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -70,15 +76,15 @@ export async function unlinkAttachments(
}); });
} }
/** 更新原材料盘点 PUT /api/contract/${param0} */ /** 更新原材料盘点 PUT /api/materials-inventory/${param0} */
export async function contractUpdate( export async function MaterialsInventoryUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ContractUpdateParams, params: API.MaterialsInventoryUpdateParams,
body: API.ContractUpdateDto, body: API.MaterialsInventoryUpdateDto,
options?: RequestOptions, options?: RequestOptions,
) { ) {
const { id: param0, ...queryParams } = params; const { id: param0, ...queryParams } = params;
return request<any>(`/api/contract/${param0}`, { return request<any>(`/api/materials-inventory/${param0}`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -89,14 +95,14 @@ export async function contractUpdate(
}); });
} }
/** 删除原材料盘点 DELETE /api/contract/${param0} */ /** 删除原材料盘点 DELETE /api/materials-inventory/${param0} */
export async function contractDelete( export async function materialsInventoryDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ContractDeleteParams, params: API.MaterialsInventoryDeleteParams,
options?: RequestOptions, options?: RequestOptions,
) { ) {
const { id: param0, ...queryParams } = params; const { id: param0, ...queryParams } = params;
return request<any>(`/api/contract/${param0}`, { return request<any>(`/api/materials-inventory/${param0}`, {
method: 'DELETE', method: 'DELETE',
params: { ...queryParams }, params: { ...queryParams },
...(options || { successMsg: '删除成功' }), ...(options || { successMsg: '删除成功' }),

View File

@ -90,9 +90,9 @@ export async function dictTypeDelete(
}); });
} }
/** 一次性获取所有的字典类型(不分页) GET /api/system/dict-type/select-options */ /** 一次性获取所有的字典类型(不分页) GET /api/system/dict-type/all*/
export async function dictTypeGetAll(options?: RequestOptions) { export async function dictTypeGetAll(options?: RequestOptions) {
return request<API.DictTypeEntity[]>('/api/system/dict-type/select-options', { return request<API.DictTypeEntity[]>('/api/system/dict-type/all', {
method: 'GET', method: 'GET',
...(options || {}), ...(options || {}),
}); });

View File

@ -1353,6 +1353,14 @@ declare namespace API {
id: number; id: number;
}; };
type MaterialsInventoryUpdateParams = {
id: number;
};
type MaterialsInventoryInfoParams = {
id: number;
};
type MaterialsInventoryListParams = { type MaterialsInventoryListParams = {
page?: number; page?: number;
pageSize?: number; pageSize?: number;
@ -1361,7 +1369,7 @@ declare namespace API {
_t?: number; _t?: number;
}; };
type ContractEntity = { type MaterialsInventoryEntity = {
/** 公司名称 */ /** 公司名称 */
companyName: string; companyName: string;
/** 产品名称(字典) */ /** 产品名称(字典) */
@ -1398,10 +1406,105 @@ declare namespace API {
currentAmount: number; currentAmount: number;
/** 经办人 */ /** 经办人 */
agent: string; agent: string;
/** 领料单号 */
issuanceNumber?: number;
/** 备注 */
remark: string;
/** 附件 */ /** 附件 */
files?: any[]; files: number[];
id: number; id: number;
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
}; };
type MaterialsInventoryDto = {
/** 公司名称 */
companyName: string;
/** 产品名称(字典) */
product: number;
/** 单位(字典) */
unit: number;
/** 之前的库存数量 */
previousInventoryQuantity: number;
/** 之前的单价 */
previousUnitPrice: number;
/** 之前的金额 */
previousAmount: number;
/** 入库时间 */
inventoryTime: Date;
/** 入库数量 */
inventoryQuantity: number;
/** 入库单价*/
inventoryUnitPrice: number;
/** 入库金额 */
inventoryAmount: number;
/** 出库时间 */
outime: Date;
/** 出库数量 */
outQuantity: number;
/** 出库单价 */
outUnitPrice: number;
/** 出库金额 */
outAmount: number;
/** 现在的结存数量 */
currentInventoryQuantity: number;
/** 现在的单价 */
currentUnitPrice: number;
/** 现在的金额 */
currentAmount: number;
/** 经办人 */
agent: string;
/** 领料单号 */
issuanceNumber?: number;
/** 备注 */
remark: string;
/** 附件 */
files: number[];
};
type MaterialsInventoryUpdateDto = {
/** 公司名称 */
companyName: string;
/** 产品名称(字典) */
product: number;
/** 单位(字典) */
unit: number;
/** 之前的库存数量 */
previousInventoryQuantity: number;
/** 之前的单价 */
previousUnitPrice: number;
/** 之前的金额 */
previousAmount: number;
/** 入库时间 */
inventoryTime: Date;
/** 入库数量 */
inventoryQuantity: number;
/** 入库单价*/
inventoryUnitPrice: number;
/** 入库金额 */
inventoryAmount: number;
/** 出库时间 */
outime: Date;
/** 出库数量 */
outQuantity: number;
/** 出库单价 */
outUnitPrice: number;
/** 出库金额 */
outAmount: number;
/** 现在的结存数量 */
currentInventoryQuantity: number;
/** 现在的单价 */
currentUnitPrice: number;
/** 现在的金额 */
currentAmount: number;
/** 经办人 */
agent: string;
/** 领料单号 */
issuanceNumber?: number;
/** 备注 */
remark: string;
/** 附件 */
files: number[];
};
type MaterialsInventoryDeleteParams = {
id: number;
};
} }

View File

@ -2,10 +2,9 @@ import { ref } from 'vue';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import Api from '@/api'; import Api from '@/api';
import { store } from '@/store'; import { store } from '@/store';
// interface DictState { const needCachedKey = [
// /** 需要缓存的路由组件名称列表 */ 'contract_type', // 合同类型
// list: API.DictItemDto[]; ];
// }
export const useDictStore = defineStore('dict', () => { export const useDictStore = defineStore('dict', () => {
const dictTypes = ref<API.DictTypeDto[]>([]); const dictTypes = ref<API.DictTypeDto[]>([]);

View File

@ -3,9 +3,9 @@
<div v-if="columns?.length"> <div v-if="columns?.length">
<DynamicTable <DynamicTable
row-key="id" row-key="id"
header-title="合同管理" header-title="原材料盘点"
title-tooltip="" title-tooltip=""
:data-request="Api.contract.contractList" :data-request="Api.materialsInventory.materialsInventoryList"
:columns="columns" :columns="columns"
bordered bordered
:scroll="{ x: 1920 }" :scroll="{ x: 1920 }"