From dd6087a2578e04df695223ba55362d3daa3e8670 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 7 Aug 2026 09:29:10 +0800 Subject: [PATCH] fix --- .../spec.json | 79 +++++++++++++++++++ .../type.d.ts | 24 ++++++ src/api/safetyEvalBusiness/index.js | 6 ++ .../EvalProjectMonitor/Detail/index.js | 4 +- src/pages/Container/WpsEditor/index.js | 3 + 5 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 .api/safetyEval-h5-wsp-doc-getDocByProjectId-get/spec.json create mode 100644 .api/safetyEval-h5-wsp-doc-getDocByProjectId-get/type.d.ts diff --git a/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/spec.json b/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/spec.json new file mode 100644 index 0000000..24083f5 --- /dev/null +++ b/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/spec.json @@ -0,0 +1,79 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "查询项目文档", + "description": "GET /safetyEval-h5/wsp/doc/getDocByProjectId", + "version": "1.0.0" + }, + "paths": { + "/safetyEval-h5/wsp/doc/getDocByProjectId": { + "get": { + "summary": "查询项目文档", + "tags": ["WPS回调接口"], + "parameters": [ + { + "name": "projectId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SingleResponseWpsDocOpenCO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SingleResponseWpsDocOpenCO": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "errCode": { + "type": "string" + }, + "errMessage": { + "type": "string" + }, + "traceId": { + "type": "string" + }, + "data": { + "$ref": "#/components/schemas/WpsDocOpenCO" + } + } + }, + "WpsDocOpenCO": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "WPS file_id,唯一" + }, + "name": { + "type": "string", + "description": "文档名称" + }, + "created": { + "type": "boolean", + "description": "是否本次新建" + } + } + } + } + } +} diff --git a/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/type.d.ts b/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/type.d.ts new file mode 100644 index 0000000..e3f3dc8 --- /dev/null +++ b/.api/safetyEval-h5-wsp-doc-getDocByProjectId-get/type.d.ts @@ -0,0 +1,24 @@ +// GET /safetyEval-h5/wsp/doc/getDocByProjectId +// 详见同目录 spec.json + +export interface Query { + /** 项目ID */ + projectId: string; +} + +export interface WpsDocOpenCO { + /** WPS file_id,唯一 */ + fileId: string; + /** 文档名称 */ + name: string; + /** 是否本次新建 */ + created: boolean; +} + +export interface SingleResponseWpsDocOpenCO { + success: boolean; + errCode: string; + errMessage: string; + traceId: string; + data: WpsDocOpenCO; +} diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index 967a1c7..b57e2fa 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -18,6 +18,12 @@ export const createWpsDoc = declareRequest( 'wpsDoc: {} | res.data || {}', ); +export const getDocByProjectId = declareRequest( + "getDocByProjectIdLoading", + "Get > /safetyEval-h5/wsp/doc/getDocByProjectId", + 'wpsDoc: {} | res.data || {}', +); + export const downloadWpsDoc = declareRequest( "downloadDocLoading", "Get > /safetyEval-h5/wsp/v3/3rd/files/{fileId}/download", diff --git a/src/pages/Container/MonitorManage/EvalProjectMonitor/Detail/index.js b/src/pages/Container/MonitorManage/EvalProjectMonitor/Detail/index.js index 63121a1..ac291be 100644 --- a/src/pages/Container/MonitorManage/EvalProjectMonitor/Detail/index.js +++ b/src/pages/Container/MonitorManage/EvalProjectMonitor/Detail/index.js @@ -352,7 +352,7 @@ const EvalProjectMonitorDetail = (props) => { evalSurveyList, evalSurveyPage, evalProjectDetail, - queryMyOrCreateDoc, + getDocByProjectId, } = props; const { contractLoading, @@ -407,7 +407,7 @@ const EvalProjectMonitorDetail = (props) => { useEffect(() => { if (projectId) { evalProjectDetail({ id: projectId }); - + getDocByProjectId({ projectId }); } fetchContract(); fetchTeam(); diff --git a/src/pages/Container/WpsEditor/index.js b/src/pages/Container/WpsEditor/index.js index c63beac..d403614 100644 --- a/src/pages/Container/WpsEditor/index.js +++ b/src/pages/Container/WpsEditor/index.js @@ -90,6 +90,9 @@ const App = (props) => { mount: document.getElementById("app-wps"), fileId: fileId, token: sessionStorage.getItem("token"), + customArgs: { + readOnly, + }, ...(readOnly ? { commonOptions: { isBrowserViewMode: true } } : {}), }); await instance.ready();