diff --git a/api/app/lib/controllers/workOrder/index.js b/api/app/lib/controllers/workOrder/index.js index 456b763..16c65f4 100644 --- a/api/app/lib/controllers/workOrder/index.js +++ b/api/app/lib/controllers/workOrder/index.js @@ -34,6 +34,57 @@ async function getEnabledWorkflowProcess (ctx) { } } +async function basicDataAllProject (ctx) { + try { + const { models } = ctx.fs.dc; + + const proRes = await models.ProjectCorrelation.findAndCountAll({ + where: { + del: false, + }, + order: [['updateTime', 'desc']], + }) + + let pepProjectIds = new Set() + for (let p of proRes.rows) { + if (p.pepProjectId) { + pepProjectIds.add(p.pepProjectId) + } + } + + const pepProjectRes = pepProjectIds.size ? + await clickHouse.projectManage.query( + ` + SELECT + t_pim_project.id AS id, + t_pim_project.project_name AS project_name, + t_pim_project.isdelete AS isdelete + FROM t_pim_project + WHERE id IN (${[...pepProjectIds].join(',')}, -1) + ` + ).toPromise() : + [] + const list = proRes.map(p => { + const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) || {} + return { + value: p.id, + label: corPro.project_name || p.name, + disabled: corPro.isdelete == 1 + } + }) + + ctx.status = 200; + ctx.body = list + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: error`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + module.exports = { - getEnabledWorkflowProcess + getEnabledWorkflowProcess, + basicDataAllProject }; \ No newline at end of file diff --git a/api/app/lib/routes/workOrder/index.js b/api/app/lib/routes/workOrder/index.js index fc669e4..c7004d1 100644 --- a/api/app/lib/routes/workOrder/index.js +++ b/api/app/lib/routes/workOrder/index.js @@ -5,4 +5,8 @@ const workOrder = require('../../controllers/workOrder'); module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/workflow/process/enabled'] = { content: '获取工作流可用表单', visible: true }; router.get('/workflow/process/enabled', workOrder.getEnabledWorkflowProcess); + + // 单一数据源 + app.fs.api.logAttr['GET/basic-data/workflow/single/allProject'] = { content: '查询所有项目', visible: false }; + router.get('/basic-data/workflow/single/allProject', workOrder.basicDataAllProject); }; \ No newline at end of file diff --git a/web/client/assets/images/fs-logo.png b/web/client/assets/images/fs-logo.png new file mode 100644 index 0000000..44814f3 Binary files /dev/null and b/web/client/assets/images/fs-logo.png differ diff --git a/web/client/src/components/index.js b/web/client/src/components/index.js index 04b40ae..1815aaa 100644 --- a/web/client/src/components/index.js +++ b/web/client/src/components/index.js @@ -6,7 +6,7 @@ import { SkeletonScreen } from './skeletonScreen' import OutHidden from './outHidden' import Uploads from './Uploads/index' import WorkflowModal from './workflow'; - +import WorkFlowViewModal from './workflow/view' export { SimpleFileDownButton, ReminderBox, @@ -14,5 +14,6 @@ export { SkeletonScreen, OutHidden, Uploads, - WorkflowModal + WorkflowModal, + WorkFlowViewModal }; diff --git a/web/client/src/components/workflow/index.jsx b/web/client/src/components/workflow/index.jsx index e5f6044..12ad985 100644 --- a/web/client/src/components/workflow/index.jsx +++ b/web/client/src/components/workflow/index.jsx @@ -14,10 +14,9 @@ import './index.less' const { confirm } = Modal; const WorkFlowModal = (props) => { - const { successCallBack = () => { }, title, visible, clientHeight, postData, processId, user, dispatch, webEmis } = props; + const { successCallBack = () => { }, title, visible, clientHeight, postData, processId, user, dispatch, webEmis, webOa } = props; const [loading, setLoading] = useState(true); const [ifShowMessage, setIfShowMessage] = useState(true); - const [webUrl, setWebUrl] = useState(null); const [customVisible, setCustomVisible] = useState(false); const [draftId, setDraftId] = useState(); const iframeRef = React.createRef(); @@ -47,11 +46,9 @@ const WorkFlowModal = (props) => { } const handelApprovalCenter = (activeKey) => { - RouteRequest.get(RouteTable.getWebUrl + `?sys=emisWebUrl`).then(res => { - if (res.url) { - window.open(res.url + "/approval/center?activeKey=" + activeKey); - } - }); + if (webOa) { + window.open(webOa + "/approval/center?activeKey=" + activeKey); + } } const handelOk = () => { @@ -112,31 +109,22 @@ const WorkFlowModal = (props) => { } //监听message事件 window.addEventListener('message', receiveMessageFromIndex, false); - //获取企业统一认证管理平台web的URL - if (!webUrl) { - RouteRequest.get(RouteTable.getEmisWebUrl).then(res => { - if (res.url) { - setWebUrl(res.url); - } - }); - } + }, []) + console.log(webEmis, processId); return (