From 8b6f8b8f95d875ba92b6f4b35ab3b7ef84441551 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 31 May 2023 10:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=B3=BB=E5=88=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/workOrder/index.js | 16 ++++ .../sections/workOrder/actions/jobOrder.js | 14 ++++ .../workOrder/containers/jobOrder.jsx | 19 ++--- web/client/src/sections/workOrder/routes.js | 76 +++++++++---------- web/client/src/utils/webapi.js | 3 + web/package.json | 2 +- 6 files changed, 77 insertions(+), 53 deletions(-) create mode 100644 api/app/lib/controllers/workOrder/index.js create mode 100644 web/client/src/sections/workOrder/actions/jobOrder.js diff --git a/api/app/lib/controllers/workOrder/index.js b/api/app/lib/controllers/workOrder/index.js new file mode 100644 index 0000000..12aad4a --- /dev/null +++ b/api/app/lib/controllers/workOrder/index.js @@ -0,0 +1,16 @@ +'use strict'; +const moment = require('moment') + +async function getEnabledWorkflowProcess (ctx) { + try { + const { models } = ctx.fs.dc; + + ctx.status = 200; + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: error`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} \ No newline at end of file diff --git a/web/client/src/sections/workOrder/actions/jobOrder.js b/web/client/src/sections/workOrder/actions/jobOrder.js new file mode 100644 index 0000000..82bfac3 --- /dev/null +++ b/web/client/src/sections/workOrder/actions/jobOrder.js @@ -0,0 +1,14 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getEnabledWorkflowProcess () { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_MEMBERS', + url: `${ApiTable.getEnabledWorkflowProcess}`, + msg: { error: '获取可用表单失败' }, + reducer: { name: 'workflowProcess' } + }); +} diff --git a/web/client/src/sections/workOrder/containers/jobOrder.jsx b/web/client/src/sections/workOrder/containers/jobOrder.jsx index 27f758a..a9785f4 100644 --- a/web/client/src/sections/workOrder/containers/jobOrder.jsx +++ b/web/client/src/sections/workOrder/containers/jobOrder.jsx @@ -1,34 +1,25 @@ import React, { useEffect } from 'react'; import { connect } from 'react-redux'; - - -const Rest = (props) => { +const JobOrder = (props) => { const { dispatch, actions, user, loading, socket } = props useEffect(() => { }, []) - return ( - <> -
- -
- +
+ +
) } function mapStateToProps (state) { const { auth, global, members, webSocket } = state; return { - // loading: members.isRequesting, // user: auth.user, - // actions: global.actions, - // members: members.data, - // socket: webSocket.socket }; } -export default connect(mapStateToProps)(Rest); +export default connect(mapStateToProps)(JobOrder); \ No newline at end of file diff --git a/web/client/src/sections/workOrder/routes.js b/web/client/src/sections/workOrder/routes.js index 2605e8f..34fc747 100644 --- a/web/client/src/sections/workOrder/routes.js +++ b/web/client/src/sections/workOrder/routes.js @@ -1,42 +1,42 @@ import { JobOrder, StayDoWorkOrder, Initiated, Receipt, AboutMe } from './containers'; export default [{ - type: 'inner', - route: { - path: '/workOrder', - key: 'workOrder', - breadcrumb: '工单', - // 不设置 component 则面包屑禁止跳转 - childRoutes: [{ - path: '/jobOrder', - key: 'jobOrder', - breadcrumb: '创建工单', - component: JobOrder, - }, { - path: '/workOrderList', - key: 'workOrderList', - breadcrumb: '工单列表', - childRoutes: [{ - path: '/stayDoWorkOrder', - key: 'stayDoWorkOrder', - component: StayDoWorkOrder, - breadcrumb: '代办工单', - }, { - path: '/initiated', - key: 'initiated', - component: Initiated, - breadcrumb: '我发起的', - }, { - path: '/receipt', - key: 'receipt', - component: Receipt, - breadcrumb: '工单回执', - }, { - path: '/aboutMe', - key: 'aboutMe', - component: AboutMe, - breadcrumb: '与我有关的', - },] - }] - } + type: 'inner', + route: { + path: '/workOrder', + key: 'workOrder', + breadcrumb: '工单', + // 不设置 component 则面包屑禁止跳转 + childRoutes: [{ + path: '/jobOrder', + key: 'jobOrder', + breadcrumb: '创建工单', + component: JobOrder, + }, { + path: '/workOrderList', + key: 'workOrderList', + breadcrumb: '工单列表', + childRoutes: [{ + path: '/stayDoWorkOrder', + key: 'stayDoWorkOrder', + component: StayDoWorkOrder, + breadcrumb: '代办工单', + }, { + path: '/initiated', + key: 'initiated', + component: Initiated, + breadcrumb: '我发起的', + }, { + path: '/receipt', + key: 'receipt', + component: Receipt, + breadcrumb: '工单回执', + }, { + path: '/aboutMe', + key: 'aboutMe', + component: AboutMe, + breadcrumb: '与我有关的', + },] + }] + } }]; \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 529e6b2..83b4921 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -75,6 +75,9 @@ export const ApiTable = { delFile: 'file/del/{id}', //删除文件夹 file: 'file', delfolderFile: 'file/{id}', //删除文件 + + //工单 + getEnabledWorkflowProcess: 'workflow/process/enabled',//获取工作流可用表单 }; export const RouteTable = { apiRoot: "/api/root", diff --git a/web/package.json b/web/package.json index 50677c3..bd74480 100644 --- a/web/package.json +++ b/web/package.json @@ -83,4 +83,4 @@ "webpack-dev-server": "^3.11.2", "webpack-hot-middleware": "^2.25.0" } -} \ No newline at end of file +}