流程
This commit is contained in:
63
src/api/design/designChange/index.ts
Normal file
63
src/api/design/designChange/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DesignChangeVO, DesignChangeForm, DesignChangeQuery } from '@/api/design/designChange/types';
|
||||
|
||||
/**
|
||||
* 查询设计变更管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDesignChange = (query?: DesignChangeQuery): AxiosPromise<DesignChangeVO[]> => {
|
||||
return request({
|
||||
url: '/design/designChange/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询设计变更管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDesignChange = (id: string | number): AxiosPromise<DesignChangeVO> => {
|
||||
return request({
|
||||
url: '/design/designChange/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增设计变更管理
|
||||
* @param data
|
||||
*/
|
||||
export const addDesignChange = (data: DesignChangeForm) => {
|
||||
return request({
|
||||
url: '/design/designChange',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改设计变更管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateDesignChange = (data: DesignChangeForm) => {
|
||||
return request({
|
||||
url: '/design/designChange',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除设计变更管理
|
||||
* @param id
|
||||
*/
|
||||
export const delDesignChange = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/design/designChange/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
221
src/api/design/designChange/types.ts
Normal file
221
src/api/design/designChange/types.ts
Normal file
@ -0,0 +1,221 @@
|
||||
export interface DesignChangeVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
formNo: string;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
projectName: string;
|
||||
|
||||
/**
|
||||
* 提出单位
|
||||
*/
|
||||
submitUnit: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
specialty: string;
|
||||
|
||||
/**
|
||||
* 提出日期
|
||||
*/
|
||||
submitDate: string;
|
||||
|
||||
/**
|
||||
* 卷册名称
|
||||
*/
|
||||
volumeName: string;
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
volumeNo: string;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
changeReason: string;
|
||||
|
||||
/**
|
||||
* 变更内容
|
||||
*/
|
||||
changeContent: string;
|
||||
|
||||
/**
|
||||
* 变更费用估算
|
||||
*/
|
||||
costEstimation: string;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DesignChangeForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
formNo?: string;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
projectName?: string;
|
||||
|
||||
/**
|
||||
* 提出单位
|
||||
*/
|
||||
submitUnit?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
specialty?: string;
|
||||
|
||||
/**
|
||||
* 提出日期
|
||||
*/
|
||||
submitDate?: string;
|
||||
|
||||
/**
|
||||
* 卷册名称
|
||||
*/
|
||||
volumeName?: string;
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
volumeNo?: string;
|
||||
|
||||
/**
|
||||
* 附图
|
||||
*/
|
||||
attachmentPic?: string;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
changeReason?: string;
|
||||
|
||||
/**
|
||||
* 变更内容
|
||||
*/
|
||||
changeContent?: string;
|
||||
|
||||
/**
|
||||
* 变更费用估算
|
||||
*/
|
||||
costEstimation?: string;
|
||||
|
||||
/**
|
||||
* 变更费用估算计算表
|
||||
*/
|
||||
costEstimationFile?: string;
|
||||
|
||||
/**
|
||||
* 变更文件
|
||||
*/
|
||||
fileId?: string | number;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DesignChangeQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
formNo?: string;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
projectName?: string;
|
||||
|
||||
/**
|
||||
* 提出单位
|
||||
*/
|
||||
submitUnit?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
specialty?: string;
|
||||
|
||||
/**
|
||||
* 提出日期
|
||||
*/
|
||||
submitDate?: string;
|
||||
|
||||
/**
|
||||
* 卷册名称
|
||||
*/
|
||||
volumeName?: string;
|
||||
|
||||
/**
|
||||
* 卷册号
|
||||
*/
|
||||
volumeNo?: string;
|
||||
|
||||
/**
|
||||
* 变更原因
|
||||
*/
|
||||
changeReason?: string;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
63
src/api/design/drawing/index.ts
Normal file
63
src/api/design/drawing/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DrawingVO, DrawingForm, DrawingQuery } from '@/api/design/drawing/types';
|
||||
|
||||
/**
|
||||
* 查询图纸管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDrawing = (query?: DrawingQuery): AxiosPromise<DrawingVO[]> => {
|
||||
return request({
|
||||
url: '/design/drawing/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询图纸管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getDrawing = (id: string | number): AxiosPromise<DrawingVO> => {
|
||||
return request({
|
||||
url: '/design/drawing/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增图纸管理
|
||||
* @param data
|
||||
*/
|
||||
export const addDrawing = (data: DrawingForm) => {
|
||||
return request({
|
||||
url: '/design/drawing',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改图纸管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateDrawing = (data: DrawingForm) => {
|
||||
return request({
|
||||
url: '/design/drawing',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除图纸管理
|
||||
* @param id
|
||||
*/
|
||||
export const delDrawing = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/design/drawing/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
146
src/api/design/drawing/types.ts
Normal file
146
src/api/design/drawing/types.ts
Normal file
@ -0,0 +1,146 @@
|
||||
export interface DrawingVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
versionNumber: string;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1过程图纸 2蓝图 3变更图纸)
|
||||
*/
|
||||
fileType: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName: string;
|
||||
|
||||
/**
|
||||
* 是否最新(0否 1是)
|
||||
*/
|
||||
newest: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DrawingForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
versionNumber?: string;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl?: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1过程图纸 2蓝图 3变更图纸)
|
||||
*/
|
||||
fileType?: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix?: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DrawingQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1过程图纸 2蓝图 3变更图纸)
|
||||
*/
|
||||
fileType?: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1删除)
|
||||
*/
|
||||
fileStatus?: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName?: string;
|
||||
|
||||
/**
|
||||
* 是否最新(0否 1是)
|
||||
*/
|
||||
newest?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
63
src/api/design/specialScheme/index.ts
Normal file
63
src/api/design/specialScheme/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { SpecialSchemeVO, SpecialSchemeForm, SpecialSchemeQuery } from '@/api/design/specialScheme/types';
|
||||
|
||||
/**
|
||||
* 查询专项方案管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listSpecialScheme = (query?: SpecialSchemeQuery): AxiosPromise<SpecialSchemeVO[]> => {
|
||||
return request({
|
||||
url: '/design/specialScheme/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询专项方案管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getSpecialScheme = (id: string | number): AxiosPromise<SpecialSchemeVO> => {
|
||||
return request({
|
||||
url: '/design/specialScheme/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增专项方案管理
|
||||
* @param data
|
||||
*/
|
||||
export const addSpecialScheme = (data: SpecialSchemeForm) => {
|
||||
return request({
|
||||
url: '/design/specialScheme',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改专项方案管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateSpecialScheme = (data: SpecialSchemeForm) => {
|
||||
return request({
|
||||
url: '/design/specialScheme',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除专项方案管理
|
||||
* @param id
|
||||
*/
|
||||
export const delSpecialScheme = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/design/specialScheme/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
126
src/api/design/specialScheme/types.ts
Normal file
126
src/api/design/specialScheme/types.ts
Normal file
@ -0,0 +1,126 @@
|
||||
export interface SpecialSchemeVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
versionNumber: string;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName: string;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
}
|
||||
|
||||
export interface SpecialSchemeForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
versionNumber?: string;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl?: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface SpecialSchemeQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
versionNumber?: string;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName?: string;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
136
src/api/design/technicalStandard/index.ts
Normal file
136
src/api/design/technicalStandard/index.ts
Normal file
@ -0,0 +1,136 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
KnowledgeDocumentVO,
|
||||
KnowledgeDocumentForm,
|
||||
KnowledgeDocumentQuery,
|
||||
KnowledgeDocumentPutFileNameQuery
|
||||
} from '@/api/design/technicalStandard/types';
|
||||
|
||||
/**
|
||||
* 查询安全知识库列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listKnowledgeDocument = (query?: any): AxiosPromise<KnowledgeDocumentVO[]> => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询安全知识库详细
|
||||
* @param id
|
||||
*/
|
||||
export const getKnowledgeDocument = (id: string | number): AxiosPromise<KnowledgeDocumentVO> => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增安全知识库
|
||||
* @param data
|
||||
*/
|
||||
export const addKnowledgeDocument = (data: { file: string }, query: { projectId: string; pid: string }) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file',
|
||||
method: 'post',
|
||||
data: data,
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改安全知识库
|
||||
* @param data
|
||||
*/
|
||||
export const updateKnowledgeDocument = (data: KnowledgeDocumentForm) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除安全知识库
|
||||
* @param id
|
||||
*/
|
||||
export const delKnowledgeDocument = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询安全知识库文件树列表
|
||||
* @param id
|
||||
*/
|
||||
export const treeStructureData = (projectId: string | number): AxiosPromise<KnowledgeDocumentVO> => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/folder/tree/list',
|
||||
method: 'get',
|
||||
params: { projectId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改安全知识库
|
||||
* @param data
|
||||
*/
|
||||
export const documentDataEdit = (data: KnowledgeDocumentPutFileNameQuery) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
//查询质量知识库文件下载列表
|
||||
export const getUniFolderDownloadList = (id: string): AxiosPromise<KnowledgeDocumentVO> => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file/list/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
//查询安全知识库回收站文件列表
|
||||
export const documentDataAllList = (query: any) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/recycleBin/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据主键id批量恢复
|
||||
* @param data
|
||||
*/
|
||||
export const dataRecyclingStation = (ids: string) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/recovery/' + ids,
|
||||
method: 'post'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据主键id批量删除
|
||||
* @param data
|
||||
*/
|
||||
export const templateRecycleBin = (ids: string) => {
|
||||
return request({
|
||||
url: '/design/technicalStandard/file/recycleBin/' + ids,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
export const getProfileDetail = (data: any): AxiosPromise<KnowledgeDocumentVO> => {
|
||||
return request({});
|
||||
};
|
175
src/api/design/technicalStandard/types.ts
Normal file
175
src/api/design/technicalStandard/types.ts
Normal file
@ -0,0 +1,175 @@
|
||||
export interface KnowledgeDocumentVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 父级(0代表顶级)
|
||||
*/
|
||||
pid: string | number;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
filePath: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1文件夹 2文件 3图片)
|
||||
*/
|
||||
fileType: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1删除)
|
||||
*/
|
||||
fileStatus: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 子对象
|
||||
*/
|
||||
children: KnowledgeDocumentVO[];
|
||||
}
|
||||
|
||||
export interface KnowledgeDocumentForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 父级(0代表顶级)
|
||||
*/
|
||||
pid?: string | number;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
filePath?: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl?: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1文件夹 2文件 3图片)
|
||||
*/
|
||||
fileType?: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1删除)
|
||||
*/
|
||||
fileStatus?: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface KnowledgeDocumentPutFileNameQuery {
|
||||
id: string | number;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export interface KnowledgeDocumentQuery {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 父级(0代表顶级)
|
||||
*/
|
||||
pid?: string | number;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
fileName?: string;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
filePath?: string;
|
||||
|
||||
/**
|
||||
* 文件访问路径
|
||||
*/
|
||||
fileUrl?: string;
|
||||
|
||||
/**
|
||||
* 文件类型(1文件夹 2文件 3图片)
|
||||
*/
|
||||
fileType?: string;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
fileSuffix?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1删除)
|
||||
*/
|
||||
fileStatus?: string;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
originalName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -21,7 +21,7 @@ const iframeUrl = ref('');
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
|
||||
onMounted(async () => {
|
||||
const url = baseUrl + `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart&t=${Date.now()}`;
|
||||
const url = `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart&t=${Date.now()}`;
|
||||
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||
});
|
||||
</script>
|
||||
|
BIN
src/components/wordDetial/icon/down.png
Normal file
BIN
src/components/wordDetial/icon/down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 922 B |
273
src/components/wordDetial/index.vue
Normal file
273
src/components/wordDetial/index.vue
Normal file
@ -0,0 +1,273 @@
|
||||
|
||||
import { click } from 'ol/events/condition';
|
||||
import { includes } from 'lodash'; import { map } from 'lodash';
|
||||
<template>
|
||||
<el-dialog v-model="isShowDialog" title="变更单详情" draggable width="60vw" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<el-card :body-style="{ padding: '20px' }" style="border: none; box-shadow: none">
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="onLoad">
|
||||
<img src="./icon/down.png" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" id="formContent" style="width: 75%; margin-left: 10%">
|
||||
<div class="table-content" id="table-content">
|
||||
<el-row class="mb20" style="display: flex; justify-content: center">
|
||||
<h2>设计变更申请单(总承包)</h2>
|
||||
</el-row>
|
||||
<el-row class="mb10" style="display: flex; justify-content: space-between">
|
||||
<div class="head-text">
|
||||
<span>NO:</span>
|
||||
<span>{{ formData.formNo }}</span>
|
||||
</div>
|
||||
<!-- <div class="head-text">
|
||||
<span>填报时间:</span>
|
||||
<span>{{ formData.createdAt }}</span>
|
||||
</div> -->
|
||||
</el-row>
|
||||
<table style="width: 100%" border="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">工程名称</th>
|
||||
<td class="th-bg">{{ formData.projectName }}</td>
|
||||
<th width="150">提出单位</th>
|
||||
<td class="th-bg">{{ formData.submitUnit }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150">专业</th>
|
||||
<td class="th-bg">{{ formData.specialty }}</td>
|
||||
<th width="150">提出日期</th>
|
||||
<td class="th-bg">{{ parseTime(formData.submitDate, '{y}-{m}-{d}') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">卷册名称</th>
|
||||
<td class="th-bg">{{ formData.volumeName }}</td>
|
||||
<th width="150">附图</th>
|
||||
<td class="th-bg">
|
||||
<el-image
|
||||
v-for="(item, i) of formData.attachmentPicList"
|
||||
:key="i"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="item.url"
|
||||
fit="cover"
|
||||
:preview-src-list="[item.url]"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150">卷册号</th>
|
||||
<td colspan="3">{{ formData.volumeNo }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">变更原因</th>
|
||||
<td colspan="3">{{ formData.changeReason }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150">变更内容</th>
|
||||
<td colspan="3">{{ formData.changeContent }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150">变更费用估算(附计算表)</th>
|
||||
<td colspan="3">
|
||||
<div>
|
||||
<span
|
||||
v-for="(item, i) of formData.costEstimationFileList"
|
||||
:key="i"
|
||||
style="color: rgb(41 145 255);cursor: pointer"
|
||||
@click="onOpen(item.url)"
|
||||
>{{item.originalName}}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue';
|
||||
import { listDesignChange, getDesignChange, delDesignChange, addDesignChange, updateDesignChange } from '@/api/design/designChange';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { downLoadOss } from '@/api/system/oss';
|
||||
// 响应式状态
|
||||
const isShowDialog = ref(false);
|
||||
const initFormData: DesignChangeForm = {
|
||||
id: undefined,
|
||||
formNo: undefined,
|
||||
projectName: undefined,
|
||||
submitUnit: undefined,
|
||||
specialty: undefined,
|
||||
submitDate: undefined,
|
||||
volumeName: undefined,
|
||||
volumeNo: undefined,
|
||||
attachmentPic: undefined,
|
||||
changeReason: [],
|
||||
changeContent: undefined,
|
||||
costEstimation: undefined,
|
||||
costEstimationFile: undefined,
|
||||
fileId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<DesignChangeForm, DesignChangeQuery>>({
|
||||
formData: { ...initFormData }
|
||||
});
|
||||
const design_change_reason_type = ref([]);
|
||||
const { formData } = toRefs(data);
|
||||
// 打开弹窗
|
||||
const openDialog = (row?: any, types) => {
|
||||
resetForm();
|
||||
design_change_reason_type.value = types;
|
||||
if (row?.id) {
|
||||
getInfos(row.id, types);
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
// 获取详情数据
|
||||
const getInfos = async (id: string, types) => {
|
||||
const res = await getDesignChange(id);
|
||||
Object.assign(formData.value, res.data);
|
||||
// 数据处理
|
||||
if (formData.value.changeReason) {
|
||||
let arr = formData.value.changeReason.split(',');
|
||||
var changeReason = types.filter((item) => arr.includes(item.value.toString())).map((item) => item.label);
|
||||
formData.value.changeReason = changeReason.join(',');
|
||||
}
|
||||
};
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.keys(formData.value).forEach((key) => {
|
||||
formData[key] = undefined;
|
||||
});
|
||||
};
|
||||
// 下载文件
|
||||
const onOpen = (path: string) => {
|
||||
window.open(path, '_blank');
|
||||
};
|
||||
// 导出
|
||||
const onLoad = async () => {
|
||||
await downLoadOss({ id: formData.value.id }, '/design/designChange/export/word', '设计变更单.zip');
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
openDialog,
|
||||
closeDialog
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pic-block {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.file-block {
|
||||
width: 100%;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
margin-bottom: 5px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
::v-deep .el-icon svg {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
::v-deep .el-step__icon-inner {
|
||||
font-size: 14px !important;
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
.dialog-footer {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 10%;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
> span {
|
||||
padding-top: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse; //合并为一个单一的边框
|
||||
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
||||
}
|
||||
thead {
|
||||
tr {
|
||||
th {
|
||||
background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
td {
|
||||
text-align: left;
|
||||
height: 35px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
.th-bg {
|
||||
background-color: rgba(247, 247, 247, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
tr {
|
||||
td {
|
||||
text-align: left;
|
||||
height: 40px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
th {
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-content {
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
344
src/views/design/designChange/index.vue
Normal file
344
src/views/design/designChange/index.vue
Normal file
@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
||||
<el-form-item label="申请单编号" prop="formNo">
|
||||
<el-input v-model="queryParams.formNo" placeholder="请输入申请单编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工程名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入工程名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="提出单位" prop="submitUnit">
|
||||
<el-input v-model="queryParams.submitUnit" placeholder="请输入提出单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专业" prop="specialty">
|
||||
<el-input v-model="queryParams.specialty" placeholder="请输入专业" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="提出日期" prop="submitDate">
|
||||
<el-date-picker clearable v-model="queryParams.submitDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择提出日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卷册名称" prop="volumeName">
|
||||
<el-input v-model="queryParams.volumeName" placeholder="请输入卷册名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卷册号" prop="volumeNo">
|
||||
<el-input v-model="queryParams.volumeNo" placeholder="请输入卷册号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:designChange:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['design:designChange:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="designChangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="申请单编号" align="center" prop="formNo" />
|
||||
<el-table-column label="工程名称" align="center" prop="projectName" />
|
||||
<el-table-column label="提出单位" align="center" prop="submitUnit" />
|
||||
<el-table-column label="专业" align="center" prop="specialty" />
|
||||
<el-table-column label="提出日期" align="center" prop="submitDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卷册名称" align="center" prop="volumeName" />
|
||||
<el-table-column label="卷册号" align="center" prop="volumeNo" />
|
||||
<el-table-column label="变更原因" align="center" prop="changeReason">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="design_change_reason_type" :value="scope.row.changeReason ? scope.row.changeReason.split(',') : []" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变更内容" align="center" prop="changeContent" />
|
||||
<!-- <el-table-column label="变更费用估算" align="center" prop="costEstimation" /> -->
|
||||
<el-table-column label="变更文件" align="center" prop="fileId">
|
||||
<template #default="scope">
|
||||
<span style="color: rgb(41 145 255);cursor: pointer" @click="onOpen(scope.row.file.originalName)"> {{ scope.row.file.originalName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:designChange:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['design:designChange:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<el-dialog
|
||||
:title="dialog.title"
|
||||
v-model="dialog.visible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="800px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="designChangeFormRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请单编号" prop="formNo">
|
||||
<el-input v-model="form.formNo" placeholder="请输入申请单编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工程名称" prop="projectName"> <el-input v-model="form.projectName" placeholder="请输入工程名称" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提出单位" prop="submitUnit">
|
||||
<el-input v-model="form.submitUnit" placeholder="请输入提出单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="specialty">
|
||||
<el-input v-model="form.specialty" placeholder="请输入专业" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提出日期" prop="submitDate">
|
||||
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
||||
</el-date-picker> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="卷册名称" prop="volumeName"> <el-input v-model="form.volumeName" placeholder="请输入卷册名称" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="卷册号" prop="volumeNo"> <el-input v-model="form.volumeNo" placeholder="请输入卷册号" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附图" prop="attachmentPic"> <image-upload v-model="form.attachmentPic" :fileSize="100" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更原因" prop="changeReason">
|
||||
<el-checkbox-group v-model="form.changeReason">
|
||||
<el-checkbox v-for="dict in design_change_reason_type" :key="dict.value" :label="dict.value">
|
||||
{{ dict.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item></el-col
|
||||
>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更内容" prop="changeContent">
|
||||
<el-input v-model="form.changeContent" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="变更费用估算" prop="costEstimation">
|
||||
<el-input v-model="form.costEstimation" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col> -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更费用估算表" label-width="110px" prop="costEstimationFile">
|
||||
<file-upload v-model="form.costEstimationFile" :fileSize="100" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="变更文件" prop="fileId"> <file-upload v-model="form.fileId" :fileSize="100" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="24"
|
||||
><el-form-item label="备注" prop="remark"> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<wordDetial ref="wordDetialRef"></wordDetial>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DesignChange" lang="ts">
|
||||
import { listDesignChange, getDesignChange, delDesignChange, addDesignChange, updateDesignChange } from '@/api/design/designChange';
|
||||
import { DesignChangeVO, DesignChangeQuery, DesignChangeForm } from '@/api/design/designChange/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import wordDetial from '@/components/wordDetial/index';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const designChangeList = ref<DesignChangeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const wordDetialRef = ref<InstanceType<typeof wordDetial>>();
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const designChangeFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DesignChangeForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
formNo: undefined,
|
||||
projectName: undefined,
|
||||
submitUnit: undefined,
|
||||
specialty: undefined,
|
||||
submitDate: undefined,
|
||||
volumeName: undefined,
|
||||
volumeNo: undefined,
|
||||
attachmentPic: undefined,
|
||||
changeReason: [],
|
||||
changeContent: undefined,
|
||||
costEstimation: undefined,
|
||||
costEstimationFile: undefined,
|
||||
fileId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<DesignChangeForm, DesignChangeQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
formNo: undefined,
|
||||
projectName: undefined,
|
||||
submitUnit: undefined,
|
||||
specialty: undefined,
|
||||
submitDate: undefined,
|
||||
volumeName: undefined,
|
||||
volumeNo: undefined,
|
||||
changeReason: undefined,
|
||||
status: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设计变更管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDesignChange(queryParams.value);
|
||||
designChangeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
designChangeFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DesignChangeVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加设计变更';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DesignChangeVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDesignChange(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
form.value.changeReason = form.value.changeReason.split(',');
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改设计变更';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
designChangeFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.changeReason = form.value.changeReason.join(',');
|
||||
if (form.value.id) {
|
||||
await updateDesignChange({ ...form.value }).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDesignChange(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DesignChangeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设计变更管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delDesignChange(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
const handleView = (row) => {
|
||||
// 查看详情
|
||||
wordDetialRef.value?.openDialog(row,design_change_reason_type.value);
|
||||
};
|
||||
// 预览
|
||||
const onOpen = (path: string) => {
|
||||
window.open(path, '_blank');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
282
src/views/design/drawing/index.vue
Normal file
282
src/views/design/drawing/index.vue
Normal file
@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型" prop="fileType">
|
||||
<el-select v-model="queryParams.fileType" placeholder="请选择文件类型" clearable>
|
||||
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原文件名" prop="originalName">
|
||||
<el-input v-model="queryParams.originalName" placeholder="请输入原文件名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否最新" prop="newest">
|
||||
<el-select v-model="queryParams.newest" placeholder="请选择" clearable>
|
||||
<el-option label="是" :value="1" />
|
||||
<el-option label="否" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:drawing:add']">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="版本号" align="center" prop="versionNumber" width="100" />
|
||||
<el-table-column label="文件名称" align="center" prop="fileName">
|
||||
<template #default="scope">
|
||||
<span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图纸类型" align="center" prop="fileType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="drawing_file_type" :value="scope.row.fileType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原文件名" align="center" prop="originalName" />
|
||||
<el-table-column label="是否最新" align="center" prop="newest">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-tag type="primary" v-if="scope.row.newest == '1'">是</el-tag>
|
||||
<el-tag type="success" v-else>否</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="流程状态" min-width="70">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding " width="240">
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['design:drawing:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Drawing" lang="ts">
|
||||
import { listDrawing, getDrawing, delDrawing, addDrawing, updateDrawing } from '@/api/design/drawing';
|
||||
import { DrawingVO, DrawingQuery, DrawingForm } from '@/api/design/drawing/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { cancelProcessApply } from '@/api/workflow/instance';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { drawing_file_type, wf_business_status } = toRefs<any>(proxy?.useDict('drawing_file_type', 'wf_business_status'));
|
||||
const drawingList = ref<DrawingVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const fileList = ref([]); // 存储上传的文件列表
|
||||
const selectedFile = ref(null); // 当前选中的文件
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const drawingFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const initFormData: DrawingForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
versionNumber: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
originalName: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<DrawingForm, DrawingQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
fileName: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
newest: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||
fileType: [{ required: true, message: '文件类型不能为空', trigger: 'change' }],
|
||||
file: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
console.log(dialog.isEdit);
|
||||
console.log(fileList.value);
|
||||
|
||||
// 新增时必须上传文件
|
||||
if (!dialog.isEdit && !fileList.value.length) {
|
||||
callback(new Error('请上传图纸文件'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询图纸管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listDrawing(queryParams.value);
|
||||
drawingList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
drawingFormRef.value?.resetFields();
|
||||
fileList.value = [];
|
||||
selectedFile.value = null;
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DrawingVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DrawingVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DrawingVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除图纸管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delDrawing(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
const handleView = (row) => {
|
||||
var url= row.file.url
|
||||
window.open(url, '_blank');
|
||||
};
|
||||
/** 查看按钮操作 */
|
||||
const handleViewInfo = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/drawing/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 撤销按钮操作 */
|
||||
const handleCancelProcessApply = async (id: string) => {
|
||||
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
||||
loading.value = true;
|
||||
const data = {
|
||||
businessId: id,
|
||||
message: '申请人撤销流程!'
|
||||
};
|
||||
await cancelProcessApply(data).finally(() => (loading.value = false));
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('撤销成功');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
279
src/views/design/drawing/indexEdit.vue
Normal file
279
src/views/design/drawing/indexEdit.vue
Normal file
@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-card shadow="never">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<el-card shadow="never" style="height: 78vh; overflow-y: auto; margin-top: 10px">
|
||||
<div style="width: 400px">
|
||||
<el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="图纸类型" prop="fileType">
|
||||
<el-select v-model="form.fileType" placeholder="请选择图纸类型">
|
||||
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="versionNumber">
|
||||
<el-input v-model="form.versionNumber" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="form.fileName" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图纸文件" prop="fileUrl">
|
||||
<file-upload :limit="1" :fileType="['pdf']" :fileSize="100" v-model="form.fileUrl" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<!-- 审批记录 -->
|
||||
<approvalRecord ref="approvalRecordRef" />
|
||||
<el-dialog draggable v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose" width="500">
|
||||
<el-select v-model="flowCode" placeholder="Select" style="width: 240px">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submitFlow()"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { DrawingForm } from '@/api/design/drawing/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { updateDrawing, getDrawing, addDrawing } from '@/api/design/drawing';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { drawing_file_type } = toRefs<any>(proxy?.useDict('drawing_file_type'));
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value:currentProject.value?.id+ '_changedrawing',
|
||||
label: '变更图纸审批'
|
||||
},
|
||||
{
|
||||
value: currentProject.value?.id+ '_blueprintdrawing',
|
||||
label: '蓝图审批'
|
||||
},
|
||||
{
|
||||
value: currentProject.value?.id+ '_processdrawing',
|
||||
label: '过程图纸审批'
|
||||
}
|
||||
];
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData: DrawingForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
versionNumber: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
originalName: undefined,
|
||||
remark: undefined,
|
||||
file: undefined
|
||||
};
|
||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
fileName: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
newest: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||
fileType: [{ required: true, message: '文件类型不能为空', trigger: 'change' }],
|
||||
file: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 新增时必须上传文件
|
||||
if (!form.value.fileUrl) {
|
||||
callback(new Error('请上传图纸文件'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getDrawing(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
var res;
|
||||
if (form.value.id) {
|
||||
res = await updateDrawing(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
res = await addDrawing(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
if (res.code == 200) {
|
||||
dialog.visible = false;
|
||||
submit(status.value, res.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
console.log(data);
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
267
src/views/design/specialScheme/index.vue
Normal file
267
src/views/design/specialScheme/index.vue
Normal file
@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="版本号" prop="versionNumber">
|
||||
<el-input v-model="queryParams.versionNumber" placeholder="请输入版本号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="queryParams.fileName" placeholder="请输入文件名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原文件名" prop="originalName">
|
||||
<el-input v-model="queryParams.originalName" placeholder="请输入原文件名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable >
|
||||
<el-option v-for="dict in wf_business_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:specialScheme:add']">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="specialSchemeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="版本号" align="center" prop="versionNumber" />
|
||||
<el-table-column label="文件名称" align="center" prop="fileName">
|
||||
<template #default="scope">
|
||||
<span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原文件名" align="center" prop="originalName" />
|
||||
<el-table-column label="流程状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding">
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['design:drawing:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['design:drawing:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SpecialScheme" lang="ts">
|
||||
import { listSpecialScheme, getSpecialScheme, delSpecialScheme, addSpecialScheme, updateSpecialScheme } from '@/api/design/specialScheme';
|
||||
import { SpecialSchemeVO, SpecialSchemeQuery, SpecialSchemeForm } from '@/api/design/specialScheme/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { cancelProcessApply } from '@/api/workflow/instance';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const specialSchemeList = ref<SpecialSchemeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const specialSchemeFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: SpecialSchemeForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
versionNumber: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
fileSuffix: undefined,
|
||||
remark: undefined,
|
||||
}
|
||||
const data = reactive<PageData<SpecialSchemeForm, SpecialSchemeQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
versionNumber: undefined,
|
||||
fileName: undefined,
|
||||
originalName: undefined,
|
||||
status: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
versionNumber: [
|
||||
{ required: true, message: "版本号不能为空", trigger: "blur" }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: "文件名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询专项方案管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listSpecialScheme(queryParams.value);
|
||||
specialSchemeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
specialSchemeFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: SpecialSchemeVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: SpecialSchemeVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
specialSchemeFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateSpecialScheme(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addSpecialScheme(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: SpecialSchemeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除专项方案管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await delSpecialScheme(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
const handleView = (row) => {
|
||||
var url= row.file.url
|
||||
window.open(url, '_blank');
|
||||
};
|
||||
/** 查看按钮操作 */
|
||||
const handleViewInfo = (row) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/workflow/specialScheme/indexEdit`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 撤销按钮操作 */
|
||||
const handleCancelProcessApply = async (id: string) => {
|
||||
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
||||
loading.value = true;
|
||||
const data = {
|
||||
businessId: id,
|
||||
message: '申请人撤销流程!'
|
||||
};
|
||||
await cancelProcessApply(data).finally(() => (loading.value = false));
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('撤销成功');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
261
src/views/design/specialScheme/indexEdit.vue
Normal file
261
src/views/design/specialScheme/indexEdit.vue
Normal file
@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-card shadow="never">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<el-card shadow="never" style="height: 78vh; overflow-y: auto; margin-top: 10px">
|
||||
<div style="width: 400px">
|
||||
<el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="版本号" prop="versionNumber">
|
||||
<el-input v-model="form.versionNumber" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="form.fileName" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="专项方案" prop="fileUrl">
|
||||
<file-upload :limit="1" :fileType="['pdf']" :fileSize="100" v-model="form.fileUrl" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<!-- 审批记录 -->
|
||||
<approvalRecord ref="approvalRecordRef" />
|
||||
<el-dialog draggable v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose" width="500">
|
||||
<el-select v-model="flowCode" placeholder="Select" style="width: 240px">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submitFlow()"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { DrawingForm } from '@/api/design/drawing/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { getSpecialScheme, addSpecialScheme, updateSpecialScheme } from '@/api/design/specialScheme';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id+ '_specialScheme',
|
||||
label: '专项方案审批'
|
||||
}
|
||||
];
|
||||
const initFormData: DrawingForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
versionNumber: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
originalName: undefined,
|
||||
remark: undefined,
|
||||
file: undefined
|
||||
};
|
||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
fileName: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
newest: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||
fileType: [{ required: true, message: '文件类型不能为空', trigger: 'change' }],
|
||||
fileUrl: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 新增时必须上传文件
|
||||
if (!form.value.fileUrl) {
|
||||
callback(new Error('请上传图纸文件'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getSpecialScheme(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
var res;
|
||||
if (form.value.id) {
|
||||
res = await updateSpecialScheme(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
res = await addSpecialScheme(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
if (res.code == 200) {
|
||||
dialog.visible = false;
|
||||
submit(status.value, res.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
console.log(data);
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
console.log(1111111111);
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
console.log(routeParams.value);
|
||||
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
137
src/views/design/technicalStandard/component/bookFile.vue
Normal file
137
src/views/design/technicalStandard/component/bookFile.vue
Normal file
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div class="book_file">
|
||||
<!-- 添加或修改公司对话框 -->
|
||||
<el-dialog v-model="isShowDialog" width="80vw" custom-class="book_file_loading" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<template #header>
|
||||
<div>查看资料文件</div>
|
||||
</template>
|
||||
<el-form ref="queryRef" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8" class="colBlock">
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="formData.fileName" placeholder="请输入文件名称搜索" clearable @keyup.enter.native="getDataFileQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getDataFileQuery">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery" type="danger">
|
||||
<el-icon><Refresh /></el-icon>清空
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="content">
|
||||
<div class="left_box" :style="treeList.length ? 'width: 70%' : 'width: 100%'">
|
||||
<el-table v-loading="loading" :data="tableData" border height="63vh" :empty-text="emptyText">
|
||||
<el-table-column label="序号" align="center" type="index" width="80px" />
|
||||
<el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" />
|
||||
<el-table-column label="文件类型" align="center" prop="fileSuffix" width="100px" />
|
||||
|
||||
<el-table-column label="文件路径" align="center" min-width="100px">
|
||||
<template #default="scope">
|
||||
<span>{{ filterfilenPath(scope.row.filePath) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding" width="250px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="success" link @click="onExport(scope.row)">
|
||||
<el-icon><Download /></el-icon>下载
|
||||
</el-button>
|
||||
<el-button type="primary" link @click="onBook(scope.row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="formData.pageNum" v-model:limit="formData.pageSize" @pagination="getDataFileQuery" />
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { listKnowledgeDocument } from '@/api/design/technicalStandard';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const emit = defineEmits(['onExport', 'onExportView', 'onBook']);
|
||||
const stores = useUserStoreHook();
|
||||
const loading = ref(false);
|
||||
const tableData = ref<any[]>([]);
|
||||
const isShowDialog = ref(false);
|
||||
const formData = reactive({
|
||||
fileName: '',
|
||||
projectId: stores.selectedProject.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
const total = ref(0);
|
||||
const emptyText = ref('暂无数据');
|
||||
const treeList = ref<any[]>([]);
|
||||
|
||||
const openDialog = () => {
|
||||
isShowDialog.value = true;
|
||||
getDataFileQuery();
|
||||
emptyText.value = '请输入文件名称进行搜索!';
|
||||
resetForm();
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
tableData.value = [];
|
||||
formData.fileName = '';
|
||||
treeList.value = [];
|
||||
emptyText.value = '暂无数据';
|
||||
};
|
||||
|
||||
const getDataFileQuery = () => {
|
||||
loading.value = true;
|
||||
emptyText.value = '数据加载中……';
|
||||
listKnowledgeDocument(formData).then((res: any) => {
|
||||
loading.value = false;
|
||||
tableData.value = [];
|
||||
if (res.code == 200 && res.rows?.length) {
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total;
|
||||
} else {
|
||||
emptyText.value = '没有查询到数据,请重新输入搜索';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const onBook = (row: any) => {
|
||||
emit('onBook', row);
|
||||
};
|
||||
|
||||
const onExport = (row: any) => {
|
||||
emit('onExportView', row);
|
||||
};
|
||||
|
||||
const resetQuery = () => {
|
||||
tableData.value = [];
|
||||
formData.fileName = '';
|
||||
loading.value = false;
|
||||
emptyText.value = '暂无数据';
|
||||
};
|
||||
|
||||
const filterfilenPath = (val: string): string => {
|
||||
return val.replace(/^.*?知识库\//, '知识库/');
|
||||
};
|
||||
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.book_file {
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
190
src/views/design/technicalStandard/component/documentsDeails.vue
Normal file
190
src/views/design/technicalStandard/component/documentsDeails.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="document_detail" id="document_detail">
|
||||
<div class="move_pop" id="detial_pop">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_app" id="box_app"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { setMove } from '@/utils/moveDiv';
|
||||
declare const CXO_API: any;
|
||||
|
||||
export default defineComponent({
|
||||
name: 'index',
|
||||
setup(props, { emit }) {
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const state = reactive({
|
||||
title: '',
|
||||
type: 2
|
||||
});
|
||||
onMounted(() => {
|
||||
setMove('detial_pop', 'document_detail');
|
||||
});
|
||||
// 打开弹窗
|
||||
const openDialog = (obj) => {
|
||||
state.title = obj.fileName;
|
||||
init(obj);
|
||||
};
|
||||
const onError = function (event) {
|
||||
//举例,强制保存后,判断文档内容是否保存成功
|
||||
if (event.data) {
|
||||
if (event.data.errorCode == 'forcesave') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//保存成功
|
||||
} else {
|
||||
//保存失败或异常
|
||||
}
|
||||
} else if (event.data.errorCode == 'setallcellvalue') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//填充成功
|
||||
} else if (desc.error == -1) {
|
||||
//当前文档正处于协同编辑中
|
||||
} else {
|
||||
//填充异常
|
||||
}
|
||||
} else if (event.data.errorCode == 'clearsheet') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//清除成功
|
||||
} else if (desc.error == -1) {
|
||||
//当前文档正处于协同编辑中
|
||||
} else {
|
||||
//清除异常
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const onDocumentReady = function () {
|
||||
// console.log('文档加载完成');
|
||||
};
|
||||
const init = (obj) => {
|
||||
let documentKey = obj.id.toString() + new Date().getTime();
|
||||
console.log('🚀 ~ init ~ url:', obj.fileUrl);
|
||||
let type = obj.fileSuffix;
|
||||
if (obj.fileSuffix.includes('.')) {
|
||||
type = obj.fileSuffix.substring(1);
|
||||
}
|
||||
let documentType = 'word'; // docx doc
|
||||
if (type == 'xlsx' || type == 'xls') {
|
||||
documentType = 'cell'; //电子表格
|
||||
} else if (type == 'ppt' || type == 'pptx') {
|
||||
documentType = 'slide'; //演示文档文件
|
||||
}
|
||||
new CXO_API.CXEditor('box_app', {
|
||||
document: {
|
||||
fileType: type,
|
||||
key: documentKey,
|
||||
title: obj.fileName,
|
||||
url: obj.fileUrl
|
||||
},
|
||||
documentType,
|
||||
editorConfig: {
|
||||
mode: 'view',
|
||||
callbackUrl: ''
|
||||
},
|
||||
height: '100%',
|
||||
events: {
|
||||
onDocumentReady: onDocumentReady,
|
||||
onError: onError
|
||||
},
|
||||
zoom: -1
|
||||
});
|
||||
};
|
||||
const onClose = () => {
|
||||
emit('onClose', false);
|
||||
};
|
||||
const onFull = (type) => {
|
||||
// 全屏
|
||||
let document_detail = document.getElementById('document_detail');
|
||||
state.type = type;
|
||||
if (type == 2) {
|
||||
document_detail.style.width = '100%';
|
||||
document_detail.style.height = '100%';
|
||||
} else {
|
||||
document_detail.style.width = '1200px';
|
||||
document_detail.style.height = '80vh';
|
||||
}
|
||||
};
|
||||
return {
|
||||
proxy,
|
||||
openDialog,
|
||||
onClose,
|
||||
onFull,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.document_detail {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 999999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #9f9f9f;
|
||||
.box_app {
|
||||
// width: 1300px !important;
|
||||
// height: 80vh !important;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.move_pop {
|
||||
width: 100%;
|
||||
// position: absolute;
|
||||
// top: 0;
|
||||
// right: 0%;
|
||||
height: 24px;
|
||||
// background: linear-gradient(#2a5095, #213f7b, #111e48);
|
||||
background-color: #f4f5f6;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
> span {
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.box {
|
||||
display: flex;
|
||||
width: 60px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 10px;
|
||||
// height: 100%;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 22px;
|
||||
margin-top: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
/* top: -8px; */
|
||||
color: #8d8d8d;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font-size: 20px;
|
||||
//border: 2px solid #0ff;
|
||||
border-radius: 50%;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
203
src/views/design/technicalStandard/component/documentsEdit.vue
Normal file
203
src/views/design/technicalStandard/component/documentsEdit.vue
Normal file
@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="document_detail_eidt" id="document_detail_eidt">
|
||||
<div class="move_pop" id="detial_edit">
|
||||
<!-- <span>{{ title }}</span> -->
|
||||
<div class="box">
|
||||
<img v-if="type == 2" src="../icon/full.png" @click="onFull(1)" />
|
||||
<img v-else src="../icon/suo.png" @click="onFull(2)" />
|
||||
<span class="close" @click="onClose">✖</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_app" id="box_app_edit"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { toRefs, reactive, onMounted, ref, defineComponent, watch, getCurrentInstance } from 'vue';
|
||||
import { setMove } from '@/utils/moveDiv';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
// Ensure CXO_API is available globally or import it if it's a module
|
||||
// Example for global usage (e.g., included via script tag in index.html):
|
||||
declare const CXO_API: any;
|
||||
|
||||
export default defineComponent({
|
||||
name: 'index',
|
||||
setup(props, { emit }) {
|
||||
const stores = useUserStoreHook();
|
||||
const { proxy } = <any>getCurrentInstance();
|
||||
const state = reactive({
|
||||
title: '',
|
||||
projectId: stores.selectedProject.id,
|
||||
type: 2,
|
||||
postUrl: ''
|
||||
});
|
||||
onMounted(() => {
|
||||
setMove('detial_edit', 'document_detail_eidt');
|
||||
});
|
||||
// 打开弹窗
|
||||
const openDialog = (obj, url) => {
|
||||
state.postUrl = url;
|
||||
|
||||
state.title = obj.name;
|
||||
init(obj);
|
||||
};
|
||||
const onError = function (event) {
|
||||
console.log('编辑器错误: code ' + event.data.errorCode + ', 描述' + event.data.errorDescription);
|
||||
//举例,强制保存后,判断文档内容是否保存成功
|
||||
if (event.data) {
|
||||
if (event.data.errorCode == 'forcesave') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//保存成功
|
||||
} else {
|
||||
//保存失败或异常
|
||||
}
|
||||
} else if (event.data.errorCode == 'setallcellvalue') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//填充成功
|
||||
} else if (desc.error == -1) {
|
||||
//当前文档正处于协同编辑中
|
||||
} else {
|
||||
//填充异常
|
||||
}
|
||||
} else if (event.data.errorCode == 'clearsheet') {
|
||||
var desc = event.data.errorDescription;
|
||||
desc = JSON.parse(desc);
|
||||
if (desc.error == 0) {
|
||||
//清除成功
|
||||
} else if (desc.error == -1) {
|
||||
//当前文档正处于协同编辑中
|
||||
} else {
|
||||
//清除异常
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const onDocumentReady = function () {
|
||||
console.log('文档加载完成');
|
||||
};
|
||||
const init = (obj) => {
|
||||
let documentKey = obj.id.toString() + new Date().getTime();
|
||||
let baseURL = import.meta.env.VITE_APP_BASE_API;
|
||||
let type = obj.fileSuffix;
|
||||
if (obj.fileSuffix.includes('.')) {
|
||||
type = obj.fileSuffix.substring(1);
|
||||
}
|
||||
let documentType = 'word'; // docx doc
|
||||
if (type == 'xlsx' || type == 'xls') {
|
||||
documentType = 'cell'; //电子表格
|
||||
} else if (type == 'ppt' || type == 'pptx') {
|
||||
documentType = 'slide'; //演示文档文件
|
||||
}
|
||||
console.log(baseURL + state.postUrl + '?path=' + obj.filePath + '&id=' + obj.id);
|
||||
new CXO_API.CXEditor('box_app_edit', {
|
||||
document: {
|
||||
fileType: obj.fileSuffix,
|
||||
key: documentKey,
|
||||
title: obj.fileName,
|
||||
url: obj.fileUrl
|
||||
},
|
||||
documentType,
|
||||
token: stores.token,
|
||||
editorConfig: {
|
||||
callbackUrl: baseURL + state.postUrl + obj.id + '?path=' + obj.filePath
|
||||
},
|
||||
events: {
|
||||
onDocumentReady: onDocumentReady,
|
||||
onError: onError
|
||||
}
|
||||
});
|
||||
};
|
||||
const onClose = () => {
|
||||
emit('onClose', false);
|
||||
};
|
||||
const onFull = (type) => {
|
||||
// 全屏
|
||||
let document_detail = document.getElementById('document_detail_eidt');
|
||||
state.type = type;
|
||||
if (type == 2) {
|
||||
// 弹框放大
|
||||
document_detail.style.width = '100%';
|
||||
document_detail.style.height = '100%';
|
||||
} else {
|
||||
// 弹框缩小
|
||||
document_detail.style.width = '1200px';
|
||||
document_detail.style.height = '80vh';
|
||||
}
|
||||
};
|
||||
return {
|
||||
proxy,
|
||||
onFull,
|
||||
openDialog,
|
||||
onClose,
|
||||
...toRefs(state)
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.document_detail_eidt {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 999999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #9f9f9f;
|
||||
.box_app {
|
||||
width: 1200px !important;
|
||||
height: 80vh !important;
|
||||
background-color: #f1f1f1;
|
||||
margin-top: 100px;
|
||||
}
|
||||
.move_pop {
|
||||
width: 100%;
|
||||
// position: absolute;
|
||||
// top: 0;
|
||||
// right: 0%;
|
||||
height: 24px;
|
||||
// background: linear-gradient(#2a5095, #213f7b, #111e48);
|
||||
background-color: #f4f5f6;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
> span {
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.box {
|
||||
display: flex;
|
||||
width: 60px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 10px;
|
||||
// height: 100%;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 22px;
|
||||
margin-top: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
/* top: -8px; */
|
||||
color: #8d8d8d;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font-size: 20px;
|
||||
//border: 2px solid #0ff;
|
||||
border-radius: 50%;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="system-document-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-document-search mb-5">
|
||||
<el-form :model="param" ref="queryRef" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<el-button type="success" :disabled="multiple" @click="onRecyclingStation(null, true)">
|
||||
<el-icon><RefreshRight /></el-icon>批量恢复
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="danger" :disabled="multiple" @click="onRecyclingStation(null, false)">
|
||||
<el-icon><DeleteFilled /></el-icon>批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" min-width="30px" />
|
||||
<el-table-column label="文件名称" align="center" prop="fileName" min-width="100px" />
|
||||
<el-table-column label="文件路径" align="center" min-width="100px">
|
||||
<template #default="scope">
|
||||
<span>{{ filterfilenPath(scope.row.filePath) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="删除时间" align="center" prop="createTime" min-width="100px" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding" min-width="80px" fixed="right">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button type="success" link @click="onRecyclingStation(scope.row, true)">
|
||||
<el-icon><RefreshRight /></el-icon>恢复
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="param.pageNum" v-model:limit="param.pageSize" @pagination="getDocumentDataList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, getCurrentInstance, computed } from 'vue';
|
||||
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus';
|
||||
import { documentDataAllList, templateRecycleBin, dataRecyclingStation } from '@/api/design/technicalStandard';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
const loading = ref(false);
|
||||
const queryRef = ref();
|
||||
const multiple = ref(true);
|
||||
|
||||
const ids = ref<string>('');
|
||||
const tableData = ref<any[]>([]);
|
||||
const param = reactive({
|
||||
type: 2,
|
||||
projectId: currentProject.value.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
const total = ref(0);
|
||||
const value = ref('2');
|
||||
|
||||
const getDocumentDataList = () => {
|
||||
loading.value = true;
|
||||
tableData.value = [];
|
||||
value.value = '2';
|
||||
documentDataAllList(param).then((res: any) => {
|
||||
tableData.value = res.rows ?? [];
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
ids.value = selection.map((item) => item.id).join(',');
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
const onRecyclingStation = (row: any, flag: boolean) => {
|
||||
let type = 2;
|
||||
let selectedIds: string = '';
|
||||
let title = '删除';
|
||||
let msg = '你确定要删除所选文件或文件夹?';
|
||||
|
||||
if (row) {
|
||||
selectedIds = row.id;
|
||||
} else {
|
||||
selectedIds = ids.value;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
type = 1;
|
||||
title = '恢复';
|
||||
msg = '你确定要恢复所选文件或文件夹?';
|
||||
}
|
||||
ElMessageBox.confirm(msg, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
const loadingInstance = ElLoading.service({
|
||||
lock: true,
|
||||
text: `正在${title}中……`,
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
if (flag) {
|
||||
dataRecyclingStation(selectedIds).then((res) => {
|
||||
loadingInstance.close();
|
||||
if (res.code == 200) {
|
||||
getDocumentDataList();
|
||||
ElMessage.success('操作成功');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
templateRecycleBin(selectedIds).then((res) => {
|
||||
loadingInstance.close();
|
||||
if (res.code == 200) {
|
||||
getDocumentDataList();
|
||||
ElMessage.success('操作成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
const filterfilenPath = (val: string): string => {
|
||||
return val.replace(/^.*?知识库\//, '知识库/');
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
getDocumentDataList
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.colBlock {
|
||||
display: block;
|
||||
}
|
||||
.colNone {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
BIN
src/views/design/technicalStandard/icon/full.png
Normal file
BIN
src/views/design/technicalStandard/icon/full.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
src/views/design/technicalStandard/icon/suo.png
Normal file
BIN
src/views/design/technicalStandard/icon/suo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
554
src/views/design/technicalStandard/index.vue
Normal file
554
src/views/design/technicalStandard/index.vue
Normal file
@ -0,0 +1,554 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="demo-tabs p5" @tab-click="handleCheckMian">
|
||||
<el-tab-pane label="资料" name="first">
|
||||
<div class="profile_engin">
|
||||
<div class="box_info">
|
||||
<div class="tree_left1" id="tree_left1">
|
||||
<div class="file_upload check_select">
|
||||
<div class="box_btn">
|
||||
<file-upload
|
||||
v-model="state.paramsQuery.file"
|
||||
:limit="100"
|
||||
:uploadUrl="uploadUrl"
|
||||
:params="uploadParams"
|
||||
:on-upload-success="uploadFile"
|
||||
:fileType="[]"
|
||||
>
|
||||
<el-button type="primary" style="float: left" :disabled="!state.parentPid">
|
||||
<el-icon size="small"><Plus /></el-icon>上传文件
|
||||
</el-button>
|
||||
</file-upload>
|
||||
</div>
|
||||
<el-button type="primary" :disabled="!state.parentPid" @click="onExport"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
<el-button type="primary" @click="onBook"
|
||||
><el-icon><View /></el-icon>查看全项目文件</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="file_upload check_select">
|
||||
<el-input class="input_left" v-model="filterText" size="small" placeholder="请输入文件名称" />
|
||||
</div>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
highlight-current
|
||||
:default-expand-all="state.checked"
|
||||
:filter-node-method="filterFolder"
|
||||
:data="state.treeList"
|
||||
node-key="id"
|
||||
accordion
|
||||
:expand-on-click-node="false"
|
||||
@node-click="handleNodeClick"
|
||||
:current-node-key="state.selectedNodeId"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<span class="custom-tree-node">
|
||||
<el-icon color="#f1a81a"><FolderOpened /></el-icon>
|
||||
<span>{{ node.label }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
<div class="resize-handle resize-handle-right right"></div>
|
||||
</div>
|
||||
<div class="list_right" id="list_right1">
|
||||
<div>
|
||||
<el-form :model="state.paramsQuery" ref="queryRef" :inline="true" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="7" class="colBlock">
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input
|
||||
v-model="state.paramsQuery.fileName"
|
||||
placeholder="请输入文件名称"
|
||||
clearable
|
||||
@keyup.enter.native="getdocumentDataList"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" class="m-l10">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchInfo"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
>
|
||||
<el-button @click="resetQuery"
|
||||
><el-icon><Refresh /></el-icon>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table v-loading="state.loading" :data="state.infoList" height="67vh" border>
|
||||
<el-table-column label="序号" align="center" type="index" min-width="50px" />
|
||||
<el-table-column label="文件名称" align="center" prop="fileName"></el-table-column>
|
||||
<el-table-column label="文件类型" align="center" prop="fileSuffix" width="100px" />
|
||||
|
||||
<el-table-column label="上传时间" align="center" prop="createTime"> </el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="handleView(scope.row)" v-if="acceptType.includes(scope.row.fileSuffix)"
|
||||
><el-icon><View /></el-icon>查看</el-button
|
||||
>
|
||||
<el-button type="primary" v-if="state.wordType.includes(scope.row.fileSuffix)" link @click="updataView(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改文件</el-button
|
||||
>
|
||||
<el-button type="primary" link @click="onExportView(scope.row)"
|
||||
><el-icon><Download /></el-icon>下载</el-button
|
||||
>
|
||||
<el-button type="success" link @click="updateName(scope.row)"
|
||||
><el-icon><EditPen /></el-icon>修改名称</el-button
|
||||
>
|
||||
<el-button type="danger" link @click="handleDelete(scope.row)"
|
||||
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:total="state.total"
|
||||
v-model:page="state.paramsQuery.pageNum"
|
||||
v-model:limit="state.paramsQuery.pageSize"
|
||||
@pagination="getdocumentDataList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"></documentsDeailsVue>
|
||||
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"></documentsEdit>
|
||||
<bookFile ref="bookFileRef" @onExportView="onExportView" @onBook="handleView" @onExport="onExport"></bookFile>
|
||||
<el-dialog draggable title="上传文件" v-model="uploadFileder" width="30%">
|
||||
<file-upload v-model="state.paramsQuery.file"></file-upload>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="uploadFileder = false">取消</el-button>
|
||||
<el-button type="primary" @click="subMitUpload">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-image-viewer
|
||||
ref="imageRef"
|
||||
style="width: 100%; height: 100%"
|
||||
:url-list="[imgUrl]"
|
||||
v-if="imgUrl"
|
||||
show-progress
|
||||
fit="cover"
|
||||
@close="imgUrl = ''"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回收站" name="second">
|
||||
<RecyclingStation ref="recylingRef"></RecyclingStation>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup name="KnowledgeDocument" lang="ts">
|
||||
import {
|
||||
listKnowledgeDocument,
|
||||
delKnowledgeDocument,
|
||||
addKnowledgeDocument,
|
||||
getUniFolderDownloadList,
|
||||
treeStructureData,
|
||||
documentDataEdit
|
||||
} from '@/api/design/technicalStandard';
|
||||
|
||||
import documentsEdit from './component/documentsEdit.vue';
|
||||
import documentsDeailsVue from './component/documentsDeails.vue';
|
||||
import RecyclingStation from './component/recyclingStation.vue';
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import bookFile from './component/bookFile.vue';
|
||||
const activeName = ref('first');
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const uploadUrl = computed(() => {
|
||||
return `/design/technicalStandard/file`;
|
||||
});
|
||||
const uploadParams = computed(() => {
|
||||
return {
|
||||
pid: state.paramsQuery.folderId,
|
||||
projectId: state.projectId
|
||||
};
|
||||
});
|
||||
|
||||
const imgUrl = ref<string>('');
|
||||
const filterText = ref('');
|
||||
const treeRef = ref();
|
||||
const documentDetailRef = ref();
|
||||
const documentDataEditRef = ref();
|
||||
const uploadFileder = ref(false);
|
||||
const imageRef = ref();
|
||||
const recylingRef = ref();
|
||||
const bookFileRef = ref();
|
||||
const state = reactive({
|
||||
treeList: [] as any,
|
||||
arrayList: [] as any,
|
||||
infoMap: new Map(),
|
||||
infoList: [] as any,
|
||||
total: 0,
|
||||
paramsQuery: {
|
||||
folderId: '',
|
||||
fileName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
projectId: currentProject.value?.id,
|
||||
file: null,
|
||||
pid: null
|
||||
},
|
||||
loading: false,
|
||||
checked: true,
|
||||
showDocumentDetail: false,
|
||||
showdocumentDataEdit: false,
|
||||
showUploadFileder: false,
|
||||
parentRow: null,
|
||||
parentPid: null,
|
||||
parentName: '',
|
||||
selectedNodeId: null,
|
||||
projectId: currentProject.value?.id || '',
|
||||
imgType: ['jpg', 'png', 'jpeg', 'gif', 'svg'],
|
||||
wordType: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
|
||||
browserViewableType: ['html', 'htm', 'txt', 'log', 'md', 'json', 'xml', 'css', 'js'],
|
||||
|
||||
draggableCheck: true
|
||||
});
|
||||
|
||||
const acceptType = computed(() => [...state.imgType, ...state.wordType, ...state.browserViewableType]);
|
||||
|
||||
watch(filterText, (val: any) => {
|
||||
treeRef.value!.filter(val);
|
||||
});
|
||||
|
||||
// 上传文件
|
||||
const uploadFile = (files: any[]) => {
|
||||
proxy.$modal.success('上传成功');
|
||||
state.paramsQuery.file = null;
|
||||
getdocumentDataList();
|
||||
// uploadFileder.value = true;
|
||||
};
|
||||
|
||||
// 提交上传文件
|
||||
const subMitUpload = () => {
|
||||
if (!state.paramsQuery.file) {
|
||||
ElMessage.warning('请选择文件!');
|
||||
return;
|
||||
}
|
||||
addKnowledgeDocument(state.paramsQuery, { projectId: state.projectId, pid: state.parentPid }).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('上传成功');
|
||||
uploadFileder.value = false;
|
||||
state.paramsQuery.file = null; //清空文件
|
||||
getdocumentDataList();
|
||||
} else {
|
||||
ElMessage.error(res.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const searchInfo = () => {
|
||||
// 搜索
|
||||
getdocumentDataList();
|
||||
};
|
||||
const resetQuery = () => {
|
||||
// 重置
|
||||
state.paramsQuery.fileName = '';
|
||||
getdocumentDataList();
|
||||
};
|
||||
// 获取树形结构文件夹目录
|
||||
const gettreeStructureData = () => {
|
||||
state.parentPid = null;
|
||||
activeName.value = 'first';
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载中……',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
target: '.tree_left1'
|
||||
});
|
||||
treeStructureData(state.projectId).then((res: any) => {
|
||||
loading.close();
|
||||
if (res.code == 200 && res.data && res.data.length) {
|
||||
state.selectedNodeId = '';
|
||||
state.treeList = res.data;
|
||||
state.paramsQuery.folderId = res.data[0].id;
|
||||
getdocumentDataList();
|
||||
// setInfo(res.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
// 处理数据
|
||||
const setInfo = (arr) => {
|
||||
arr.forEach((element) => {
|
||||
state.arrayList.push(element);
|
||||
state.infoMap.set(element.folderId, element.id);
|
||||
if (element.treeStructureDataRes && element.treeStructureDataRes.length) {
|
||||
setInfo(element.treeStructureDataRes);
|
||||
}
|
||||
});
|
||||
};
|
||||
// 选择目录文件
|
||||
const handleNodeClick = (row) => {
|
||||
state.parentRow = row;
|
||||
state.parentPid = row.parentId;
|
||||
console.log('🚀 ~ handleNodeClick ~ state.parentPid:', state.parentPid);
|
||||
state.parentName = row.label;
|
||||
state.paramsQuery.folderId = row.id;
|
||||
getdocumentDataList();
|
||||
if (row.id === state.selectedNodeId) {
|
||||
// 如果当前节点已经选中,则取消选中
|
||||
state.selectedNodeId = null;
|
||||
state.parentPid = null; //关闭父级选择的id
|
||||
state.parentRow = null; //获取父级对象
|
||||
state.parentName = ''; //获取父级对应的名称
|
||||
state.paramsQuery.folderId = ''; //
|
||||
} else {
|
||||
// 否则选中当前节点 重新赋值
|
||||
state.selectedNodeId = row.id;
|
||||
}
|
||||
};
|
||||
// 获取文档列表数据
|
||||
const getdocumentDataList = () => {
|
||||
if (!state.paramsQuery.folderId) {
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
listKnowledgeDocument(state.paramsQuery).then((res: any) => {
|
||||
state.loading = false;
|
||||
if (res.code == 200) {
|
||||
state.infoList = res.rows;
|
||||
state.total = res.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
// 查询tree树形结构数据
|
||||
const filterFolder = (value: string, data: any) => {
|
||||
if (!value) return true;
|
||||
return data.name.includes(value);
|
||||
};
|
||||
const handleDelete = (row) => {
|
||||
// 删除文档
|
||||
let msg = '你确定要删除所选文件?';
|
||||
delFile(msg, row, () => {
|
||||
getdocumentDataList();
|
||||
});
|
||||
};
|
||||
|
||||
//切换tab
|
||||
const handleCheckMian = (tab, event) => {
|
||||
activeName.value = tab.name;
|
||||
if (activeName.value === 'first') {
|
||||
gettreeStructureData();
|
||||
} else {
|
||||
// 回收站
|
||||
recylingRef.value.getDocumentDataList();
|
||||
}
|
||||
};
|
||||
|
||||
const onExportView = (row) => {
|
||||
console.log(row);
|
||||
proxy.$download.direct(row.fileUrl, row.originalName);
|
||||
};
|
||||
const updateName = (row) => {
|
||||
// 修改名称
|
||||
editName(row, '请输入文件名称', 1);
|
||||
};
|
||||
const handleView = (row) => {
|
||||
if (state.imgType.includes(row.fileSuffix)) {
|
||||
imgUrl.value = row.fileUrl;
|
||||
return;
|
||||
} else if (state.wordType.includes(row.fileSuffix)) {
|
||||
state.showDocumentDetail = true;
|
||||
nextTick(() => {
|
||||
documentDetailRef.value.openDialog(row);
|
||||
});
|
||||
} else {
|
||||
window.open(row.fileUrl);
|
||||
}
|
||||
};
|
||||
// 关闭在线编辑弹框
|
||||
const onClose = () => {
|
||||
state.showDocumentDetail = false;
|
||||
};
|
||||
// 关闭修改的在线文档弹框
|
||||
const onCloseEdit = () => {
|
||||
state.showdocumentDataEdit = false;
|
||||
};
|
||||
const updataView = (row) => {
|
||||
// 修改文档
|
||||
state.showdocumentDataEdit = true;
|
||||
nextTick(() => {
|
||||
documentDataEditRef.value.openDialog(row, '/design/technicalStandard/changxie/callback/');
|
||||
});
|
||||
};
|
||||
// 删除文件及文件夹
|
||||
const delFile = (msg, data, cb) => {
|
||||
ElMessageBox.confirm(msg, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
delKnowledgeDocument([data.id]).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('删除成功');
|
||||
cb();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
const editName = (data, title, type) => {
|
||||
ElMessageBox.prompt(title, '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputErrorMessage: title,
|
||||
inputValue: data.fileName
|
||||
})
|
||||
.then(({ value }) => {
|
||||
documentDataEdit({ id: data.id, fileName: value }).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '修改成功'
|
||||
});
|
||||
// 数据重新刷新
|
||||
if (type == 2) {
|
||||
gettreeStructureData();
|
||||
} else {
|
||||
getdocumentDataList();
|
||||
}
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
const onExport = () => {
|
||||
getUniFolderDownloadList(state.paramsQuery.folderId).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
console.log(state.paramsQuery.fileName);
|
||||
proxy.$download.downloadFilesAsZip(res.data, { urlKey: 'fileUrl', nameKey: 'originalName', zipName: state.parentName + '.zip' });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查看所有资料
|
||||
const onBook = () => {
|
||||
bookFileRef.value.openDialog();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
gettreeStructureData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.profile_engin {
|
||||
height: 80vh;
|
||||
.set-tool {
|
||||
display: none;
|
||||
}
|
||||
.el-tree-node__content:hover,
|
||||
.el-tree-node__content:active {
|
||||
.set-tool {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||
background-color: #354e67 !important;
|
||||
color: #fff;
|
||||
}
|
||||
.box_info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.pagination-container {
|
||||
padding: 10px 0 !important;
|
||||
}
|
||||
> div {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.tree_left1 {
|
||||
width: 30%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 6px;
|
||||
padding: 6px 0px;
|
||||
position: relative;
|
||||
min-width: 26%;
|
||||
border-right: 6px solid;
|
||||
border-right-color: rgba(204, 230, 255, 0);
|
||||
.resize-handle-right {
|
||||
top: 0;
|
||||
width: 6px;
|
||||
height: 100%;
|
||||
right: -10px;
|
||||
cursor: ew-resize;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
}
|
||||
.check_select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
// justify-content: space-between;
|
||||
padding: 4px;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
.box_btn {
|
||||
margin: 0 10px 0 20px;
|
||||
position: relative;
|
||||
> span {
|
||||
padding: 4px 10px;
|
||||
background: #67c23a;
|
||||
color: #fff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.btn {
|
||||
position: absolute;
|
||||
left: 20%;
|
||||
display: none;
|
||||
top: -2px;
|
||||
width: 220px;
|
||||
.el-button {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
.box_btn:hover,
|
||||
.box_btn:active {
|
||||
cursor: pointer;
|
||||
.btn {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
.file_upload {
|
||||
margin: 2px 0;
|
||||
}
|
||||
.input_left {
|
||||
padding: 6px;
|
||||
box-sizing: border-box;
|
||||
// border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
}
|
||||
.list_right {
|
||||
width: 69.5%;
|
||||
background: white;
|
||||
border: 1px solid #ededed;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.el-tree {
|
||||
height: calc(80vh - 160px);
|
||||
width: 100%;
|
||||
overflow: auto !important;
|
||||
}
|
||||
// .el-tree-node__children {
|
||||
// overflow: visible !important;
|
||||
// }
|
||||
}
|
||||
</style>
|
@ -283,6 +283,8 @@ const approvalVerifyOpen = async () => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
console.log(proxy.$route.query);
|
||||
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
|
@ -23,8 +23,9 @@ const iframeLoaded = () => {
|
||||
}
|
||||
};
|
||||
};
|
||||
//baseUrl +
|
||||
const open = async (definitionId, disabled) => {
|
||||
const url = baseUrl + `/warm-flow-ui/index.html?id=${definitionId}&disabled=${disabled}`;
|
||||
const url = `/warm-flow-ui/index.html?id=${definitionId}&disabled=${disabled}`;
|
||||
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||
};
|
||||
/** 关闭按钮 */
|
||||
|
@ -173,7 +173,9 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程编码" prop="flowCode">
|
||||
<el-input v-model="form.flowCode" placeholder="请输入流程编码" maxlength="40" show-word-limit />
|
||||
<el-input v-model="form.flowCode" placeholder="请输入流程编码" maxlength="20" show-word-limit>
|
||||
<template #prepend >{{ currentProject.id }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
<el-input v-model="form.flowName" placeholder="请输入流程名称" maxlength="100" show-word-limit />
|
||||
@ -198,9 +200,13 @@ import { CategoryTreeVO } from '@/api/workflow/category/types';
|
||||
import { FlowDefinitionQuery, FlowDefinitionVo, FlowDefinitionForm } from '@/api/workflow/definition/types';
|
||||
import { UploadRequestOptions, TabsPaneContext } from 'element-plus';
|
||||
import { ElMessageBoxOptions } from 'element-plus/es/components/message-box/src/message-box.type';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const categoryTreeRef = ref<ElTreeInstance>();
|
||||
|
||||
@ -240,7 +246,8 @@ const queryParams = ref<FlowDefinitionQuery>({
|
||||
pageSize: 10,
|
||||
flowName: undefined,
|
||||
flowCode: undefined,
|
||||
category: undefined
|
||||
category: undefined,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
const rules = {
|
||||
category: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
|
||||
@ -252,7 +259,8 @@ const initFormData: FlowDefinitionForm = {
|
||||
flowName: '',
|
||||
flowCode: '',
|
||||
category: '',
|
||||
formPath: ''
|
||||
formPath: '',
|
||||
projectId: currentProject.value?.id
|
||||
};
|
||||
//流程定义参数
|
||||
const form = ref<FlowDefinitionForm>({
|
||||
@ -260,7 +268,8 @@ const form = ref<FlowDefinitionForm>({
|
||||
flowName: '',
|
||||
flowCode: '',
|
||||
category: '',
|
||||
formPath: ''
|
||||
formPath: '',
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
onMounted(() => {
|
||||
getPageList();
|
||||
@ -478,6 +487,7 @@ const handleUpdate = async (row?: FlowDefinitionVo) => {
|
||||
const id = row?.id || ids.value[0];
|
||||
const res = await getInfo(id);
|
||||
Object.assign(form.value, res.data);
|
||||
form.value.flowCode = form.value.flowCode.split('_')[1];
|
||||
modelDialog.visible = true;
|
||||
modelDialog.title = '修改流程';
|
||||
};
|
||||
@ -486,6 +496,7 @@ const handleSubmit = async () => {
|
||||
defFormRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
form.value.flowCode = currentProject.value.id + '_' + form.value.flowCode;
|
||||
if (form.value.id) {
|
||||
await edit(form.value).finally(() => (loading.value = false));
|
||||
} else {
|
||||
|
@ -32,7 +32,6 @@
|
||||
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
|
||||
@ -155,6 +154,7 @@ const getWaitingList = () => {
|
||||
};
|
||||
//办理
|
||||
const handleOpen = async (row: FlowTaskVO) => {
|
||||
console.log(row);
|
||||
const routerJumpVo = reactive<RouterJumpVo>({
|
||||
businessId: row.businessId,
|
||||
taskId: row.id,
|
||||
|
@ -29,6 +29,22 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
},"/warm-flow-ui": {
|
||||
target: 'http://192.168.110.119:8899',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
},"/warm-flow": {
|
||||
target: 'http://192.168.110.119:8899',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
},
|
||||
"/workflow": {
|
||||
target: 'http://192.168.110.119:8899',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user