diff --git a/api/app/lib/controllers/workOrder/index.js b/api/app/lib/controllers/workOrder/index.js index 6002667..456b763 100644 --- a/api/app/lib/controllers/workOrder/index.js +++ b/api/app/lib/controllers/workOrder/index.js @@ -17,7 +17,7 @@ async function getEnabledWorkflowProcess (ctx) { workflow_process RIGHT JOIN workflow_group ON workflow_process.group_id = workflow_group.id - AND workflow_group.name = '销售' + AND workflow_group.name = '竞聘考核' WHERE workflow_process.deleted = 0 AND workflow_process.is_enable = 1 diff --git a/web/client/index.ejs b/web/client/index.ejs index 71b028e..a9a3659 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -6,12 +6,13 @@ - + - + diff --git a/web/client/index.html b/web/client/index.html index c6ebcf6..399bade 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -10,8 +10,8 @@ - + diff --git a/web/client/src/components/workflow/index.js b/web/client/src/components/workflow/index.jsx similarity index 91% rename from web/client/src/components/workflow/index.js rename to web/client/src/components/workflow/index.jsx index b3bbe29..e5f6044 100644 --- a/web/client/src/components/workflow/index.js +++ b/web/client/src/components/workflow/index.jsx @@ -14,7 +14,7 @@ import './index.less' const { confirm } = Modal; const WorkFlowModal = (props) => { - const { successCallBack = () => { }, title, visible, clientHeight, postData, processId, user, dispatch } = props; + const { successCallBack = () => { }, title, visible, clientHeight, postData, processId, user, dispatch, webEmis } = props; const [loading, setLoading] = useState(true); const [ifShowMessage, setIfShowMessage] = useState(true); const [webUrl, setWebUrl] = useState(null); @@ -65,14 +65,14 @@ const WorkFlowModal = (props) => { const handelDeny = () => { // dispatch(delDraft(draftId)).then(res => { // if (res.success) { - // Notification.success('删除草稿成功'); + // Notification.success({title:'删除草稿成功'}); // const { onCancel } = props; // onCancel && onCancel(); // setLoading(false); // setCustomVisible(false); // setDraftId(null); // } else { - // Notification.error('删除草稿失败,请联系管理员'); + // Notification.error({title:'删除草稿失败,请联系管理员'}); // } // }) } @@ -87,19 +87,19 @@ const WorkFlowModal = (props) => { let data = JSON.parse(event.data); const { type, isSaveDraft, setIntervalSave, draftId, msg } = data; if (msg) { - Notification.success(msg) + Notification.success({ title: msg }) } setDraftId(draftId); if (type == 'saveSuccess' && successCallBack) { if (ifShowMessage) { if (isSaveDraft) { if (setIntervalSave) { - Notification.success('60秒,表单暂存草稿成功'); + Notification.success({ title: '60秒,表单暂存草稿成功' }); } else { Notification.success(保存草稿成功,可在 handelApprovalCenter("save")}>【审批中心/保存待发】查看详情, 10); } } else { - Notification.success('提交成功,可在【审批中心/由我发起】查看详情'); + Notification.success({ title: '提交成功,可在【审批中心/由我发起】查看详情' }); successCallBack(); } //防止提示多次 @@ -189,9 +189,11 @@ const WorkFlowModal = (props) => { function mapStateToProps (state) { const { auth, global } = state; + console.log(global); return { user: auth.user, clientHeight: global.clientHeight, + webEmis: global.webEmis } } diff --git a/web/client/src/components/workflow/view.js b/web/client/src/components/workflow/view.jsx similarity index 100% rename from web/client/src/components/workflow/view.js rename to web/client/src/components/workflow/view.jsx diff --git a/web/client/src/layout/actions/global.js b/web/client/src/layout/actions/global.js index 267111a..b8bb3cd 100644 --- a/web/client/src/layout/actions/global.js +++ b/web/client/src/layout/actions/global.js @@ -48,6 +48,7 @@ export function initApiRoot () { pomsNotebook: res.pomsNotebook, dcWeb: res.dcWeb, qiniu: res.qiniu, + webEmis: res.webEmis, } }) }); @@ -60,7 +61,6 @@ export function pepProject (pepProjectId) { type: PEPPROJECTID, payload: { pepProjectId: pepProjectId, - } } } \ No newline at end of file diff --git a/web/client/src/sections/workOrder/containers/jobOrder.jsx b/web/client/src/sections/workOrder/containers/jobOrder.jsx index 34a8d4c..ddb69ab 100644 --- a/web/client/src/sections/workOrder/containers/jobOrder.jsx +++ b/web/client/src/sections/workOrder/containers/jobOrder.jsx @@ -2,7 +2,8 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import moment from 'moment'; import { WorkflowModal } from "$components" -import { Card, Typography, Space, Button } from '@douyinfe/semi-ui'; +import { EmisRequest, EmisApiTable } from "$utils" +import { Card, Notification, Space, Button } from '@douyinfe/semi-ui'; import { IconArticle } from '@douyinfe/semi-icons'; import '../style.less' @@ -34,8 +35,27 @@ const JobOrder = (props) => { `创建时间:${moment(p.createTime || p.updateTime).format('YYYY-MM-DD HH:mm:ss')}` } onClick={() => { - setLaunchProcessId(p.id) - setWorkflowModalVisible(true) + EmisRequest.get(EmisApiTable.getProcessByName, { + name: decodeURIComponent(p.name), + resource: p.id + }).then(res => { + console.log(res); + if (res) { + // if (res.deleted) { + // Notification.error({ title: '该表单流程已删除,请尝试退出账号重新登录或联系项企管理员' }) + // } else if (res.isEdited) { + // Notification.error({ title: '该表单流程已修改,请尝试退出账号重新登录或联系项企管理员' }) + // } else if (!res.isEnable) { + // Notification.error({ title: '该表单流程已停用,请尝试退出账号重新登录或联系项企管理员' }) + // } else + if (res.id) { + setLaunchProcessId(res.id) + setWorkflowModalVisible(true) + } + } else { + Notification.error({ title: `获取指定流程失败` }); + } + }) }} >
diff --git a/web/client/src/utils/index.js b/web/client/src/utils/index.js index 0084428..427e2b7 100644 --- a/web/client/src/utils/index.js +++ b/web/client/src/utils/index.js @@ -2,7 +2,7 @@ import { isAuthorized } from './func'; import { AuthorizationCode } from './authCode'; import { - ApiTable, RouteTable, + ApiTable, EmisApiTable, RouteTable, AxyRequest, EmisRequest, basicAction, RouteRequest } from './webapi' @@ -13,6 +13,7 @@ export { RouteTable, ApiTable, + EmisApiTable, AxyRequest, EmisRequest, basicAction, diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index e74df6d..2c3261a 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -1,11 +1,13 @@ "use strict"; import { ProxyRequest, customWebUtils } from "@peace/utils"; -export const AxyRequest = new ProxyRequest("_axy"); -export const EmisRequest = new ProxyRequest("_emis") +const userKey = "pomsUser"; + +export const AxyRequest = new ProxyRequest("_axy", userKey); +export const EmisRequest = new ProxyRequest("_emis", userKey); export const webUtils = new customWebUtils({ - userKey: 'pomsUser' + userKey: userKey }); const { basicAction, RouteRequest } = webUtils export { @@ -83,7 +85,7 @@ export const ApiTable = { // 项企的接口 export const EmisApiTable = { //通过流程名称查找指定流程 - getProcessByName: '/workflow/process/name', + getProcessByName: 'workflow/process/name', } export const RouteTable = { diff --git a/web/config.js b/web/config.js index 9f52985..356d192 100644 --- a/web/config.js +++ b/web/config.js @@ -15,6 +15,7 @@ args.option(['u', 'api-url'], 'webapi的URL'); args.option('apiPomsUrl', 'webapi的URL 外网可访问'); args.option('apiAnxinyunUrl', '安心云 api'); args.option('apiEmisUrl', '企业管理 api'); +args.option('webEmisUrl', '企业管理 web'); args.option('iotVcmpWeb', 'IOT 视频服务'); args.option('pomsMonitor', '运维监控 web'); args.option('pomsKubesphere', 'kubesphere web'); @@ -37,6 +38,7 @@ const flags = args.parse(process.argv); const API_URL = process.env.API_URL || flags.apiUrl; const API_POMS_URL = process.env.API_POMS_URL || flags.apiPomsUrl; const API_EMIS_URL = process.env.API_EMIS_URL || flags.apiEmisUrl; +const WEB_EMIS_URL = process.env.WEB_EMIS_URL || flags.webEmisUrl; const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl; const IOT_VIDEO_WEB = process.env.IOT_VIDEO_WEB || flags.iotVcmpWeb; const POMS_MONITOR = process.env.POMS_MONITOR || flags.pomsMonitor; @@ -57,6 +59,7 @@ const ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMA if ( !API_URL + || !API_EMIS_URL || !WEB_EMIS_URL || !API_ANXINYUN_URL || !POMS_MONITOR || !DC_WEB || !ANXINCLOUD_QINIU_AK || !ANXINCLOUD_QINIU_SK || !ANXINCLOUD_QINIU_BUCKET_RESOURCE || !ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || !IOT_VIDEO_WEB) { @@ -80,6 +83,12 @@ const product = { host: API_ANXINYUN_URL, match: /^\/_axy\//, } + }, { + entry: require('./middlewares/proxy').entry, + opts: { + host: API_EMIS_URL, + match: /^\/_emis\//, + } }, { entry: require('./middlewares/attachment').entry, opts: { @@ -92,16 +101,11 @@ const product = { maxSize: 20971520, // 20M uploadPath: 'other' } - }, { - entry: require('./middlewares/proxy').entry, - opts: { - host: API_EMIS_URL, - match: /^\/_emis\//, - } }, { entry: require('./routes').entry, opts: { apiUrl: API_POMS_URL, + webEmis: WEB_EMIS_URL, iotVcmpWeb: IOT_VIDEO_WEB, pomsMonitor: POMS_MONITOR, pomsKubesphere: POMS_KUBESPHERE, diff --git a/web/package.json b/web/package.json index bd74480..83f661d 100644 --- a/web/package.json +++ b/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.112:14000 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt anxinyun-test --qndmn http://test.resources.anxinyun.cn --iotVcmpWeb https://mediaconsole.ngaiot.com --pomsMonitor http://monitor.anxinyun.cn/goto/PaEDLE84z?orgId=1 --pomsKubesphere https://k8sadmin.anxinyun.cn/ --pomsAmbari https://ambari.anxinyun.cn/ --pomsKowl https://kafka.anxinyun.cn/ --pomsPghero https://pghero.anxinyun.cn/ --pomsEs https://esc.anxinyun.cn/ --pomsNotebook https://inotebook.anxinyun.cn/ --dcWeb https://fsiot-oamss.anxinyun.cn", + "start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.161:1111 --webEmisUrl http://10.8.30.161:1111 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt anxinyun-test --qndmn http://test.resources.anxinyun.cn --iotVcmpWeb https://mediaconsole.ngaiot.com --pomsMonitor http://monitor.anxinyun.cn/goto/PaEDLE84z?orgId=1 --pomsKubesphere https://k8sadmin.anxinyun.cn/ --pomsAmbari https://ambari.anxinyun.cn/ --pomsKowl https://kafka.anxinyun.cn/ --pomsPghero https://pghero.anxinyun.cn/ --pomsEs https://esc.anxinyun.cn/ --pomsNotebook https://inotebook.anxinyun.cn/ --dcWeb https://fsiot-oamss.anxinyun.cn", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js" @@ -83,4 +83,4 @@ "webpack-dev-server": "^3.11.2", "webpack-hot-middleware": "^2.25.0" } -} +} \ No newline at end of file diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index 6e8967e..48b16ef 100644 --- a/web/routes/attachment/index.js +++ b/web/routes/attachment/index.js @@ -19,7 +19,7 @@ module.exports = { entry: function (app, router, opts) { const getApiRoot = async function (ctx) { - const { apiUrl, iotVcmpWeb, pomsMonitor, pomsKubesphere, pomsAmbari, pomsKowl, pomsPghero, pomsEs, pomsNotebook, dcWeb, qiniu } = opts; + const { apiUrl, iotVcmpWeb, pomsMonitor, pomsKubesphere, pomsAmbari, pomsKowl, pomsPghero, pomsEs, pomsNotebook, dcWeb, qiniu, webEmis, } = opts; ctx.status = 200; ctx.body = { @@ -33,7 +33,8 @@ module.exports = { pomsMonitor: pomsMonitor, pomsNotebook: pomsNotebook, dcWeb: dcWeb, - qiniu: qiniu + qiniu: qiniu, + webEmis, }; };