Browse Source

工单系列文件夹

dev
巴林闲侠 2 years ago
parent
commit
8b6f8b8f95
  1. 16
      api/app/lib/controllers/workOrder/index.js
  2. 14
      web/client/src/sections/workOrder/actions/jobOrder.js
  3. 19
      web/client/src/sections/workOrder/containers/jobOrder.jsx
  4. 76
      web/client/src/sections/workOrder/routes.js
  5. 3
      web/client/src/utils/webapi.js
  6. 2
      web/package.json

16
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
}
}
}

14
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' }
});
}

19
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 (
<>
<div>
<img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} />
</div>
</>
<div>
</div>
)
}
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);

76
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: '与我有关的',
},]
}]
}
}];

3
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",

2
web/package.json

@ -83,4 +83,4 @@
"webpack-dev-server": "^3.11.2",
"webpack-hot-middleware": "^2.25.0"
}
}
}

Loading…
Cancel
Save