巴林闲侠 2 years ago
parent
commit
758af5a47c
  1. 70
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx
  2. 4
      web/client/src/utils/webapi.js

70
web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { ApiTable, EmisApiTable, EmisRequest } from '$utils' import { ApiTable, EmisApiTable, EmisRequest } from '$utils'
import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons'; import { IconSearch } from '@douyinfe/semi-icons';
import { SkeletonScreen, } from "$components"; import { SkeletonScreen, WorkflowModal } from "$components";
import moment from "moment"; import moment from "moment";
@ -27,6 +27,10 @@ const Rest = (props) => {
const [projectStatus, setProjectStatus] = useState([]); // const [projectStatus, setProjectStatus] = useState([]); //
const [tableData, setTableData] = useState([]); // const [tableData, setTableData] = useState([]); //
const [loading, setLoading] = useState(true); // const [loading, setLoading] = useState(true); //
const [workflowModalVisible, setWorkflowModalVisible] = useState(false)
const [processInstanceId, setProcessInstanceId] = useState(null)
useEffect(() => { useEffect(() => {
backlogData() backlogData()
@ -35,17 +39,13 @@ const Rest = (props) => {
let backlogData = () => { let backlogData = () => {
setLoading(true) setLoading(true)
EmisRequest.get(EmisApiTable.processInstancemMyAuditList, EmisRequest.get(EmisApiTable.processInstancemMyAuditList,
{ userId: 1, offset: 0, limit: 10, businessType: '' }) { userId: user?.id, businessType: '运维中台表单', })
.then(res => { .then(res => {
console.log(111, res); console.log(111, res);
setTableData(res) setTableData(res)
setLimits(res.length || 0) setLimits(res.length || 0)
setLoading(false) setLoading(false)
// sessionStorage.setItem('pomsUser', JSON.stringify(user));
// return dispatch({
// type: LOGIN_SUCCESS,
// payload: { user: user },
// });
}, error => { }, error => {
Toast.error({ content: '待办工单请求失败', duration: 1, }) Toast.error({ content: '待办工单请求失败', duration: 1, })
setLoading(false) setLoading(false)
@ -79,6 +79,11 @@ const Rest = (props) => {
}, { }, {
title: '操作', title: '操作',
dataIndex: 'hadle', dataIndex: 'hadle',
render: (text, record, index) => <div style={{ width: 60, color: "#1890ff", cursor: "pointer" }} onClick={() => {
setProcessInstanceId(record.processInstanceId)
setWorkflowModalVisible(true)
}}>查看详情</div>
}] }]
return ( return (
@ -92,10 +97,12 @@ const Rest = (props) => {
</div> </div>
<div style={{ marginRight: 20, display: 'flex', alignItems: 'center' }} className='myempush'> <div style={{ marginRight: 20, display: 'flex', alignItems: 'center' }} className='myempush'>
<Form <Form
onSubmit={(values) => console.log(values)} // getFormApi={(formApi) => (form.current = formApi)}
getFormApi={(formApi) => (form.current = formApi)}
layout="horizontal" layout="horizontal"
style={{ position: "relative", width: "100%", flex: 1 }} style={{ position: "relative", width: "100%", flex: 1 }}
onSubmit={(values) => {
console.log(values)
}}
> >
<Form.DatePicker <Form.DatePicker
pure pure
@ -112,26 +119,22 @@ const Rest = (props) => {
style={{ width: 260, marginLeft: 12, marginRight: 12 }} style={{ width: 260, marginLeft: 12, marginRight: 12 }}
placeholder="请输入申请人" placeholder="请输入申请人"
/> />
<Button
type="primary" htmlType="submit"
style={{
width: 80,
height: 32,
borderRadius: 2,
marginRight: 32,
background: '#FFFFFF',
color: '#005ABD',
border: '1px solid #005ABD'
}}
>
查询
</Button>
</Form> </Form>
<Button
theme="solid"
type="primary"
style={{
width: 80,
height: 32,
borderRadius: 2,
marginRight: 32,
background: '#FFFFFF',
color: '#005ABD',
border: '1px solid #005ABD'
}}
onClick={() => {
getPushList({ limit: query.limit, page: 0 })
}}
>
查询
</Button>
</div> </div>
</div> </div>
@ -146,7 +149,7 @@ const Rest = (props) => {
<Table <Table
rowKey="name" rowKey="name"
columns={columns} columns={columns}
dataSource={tableData} dataSource={tableData?.slice(query.limit * query.page, (query.page + 1) * query.limit)}
bordered={false} bordered={false}
hideExpandedColumn={false} hideExpandedColumn={false}
empty="暂无数据" empty="暂无数据"
@ -175,14 +178,19 @@ const Rest = (props) => {
pageSizeOpts={[10, 20, 30, 40]} pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => { onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 }); setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
setChange(!change)
}} }}
/> />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<WorkflowModal
visible={workflowModalVisible}
title={''}
processId={processInstanceId}
onCancel={() => { setWorkflowModalVisible(false) }}
successCallBack={() => { setWorkflowModalVisible(false) }}
/>
</> </>
) )
} }

4
web/client/src/utils/webapi.js

@ -86,9 +86,9 @@ export const ApiTable = {
export const EmisApiTable = { export const EmisApiTable = {
//通过流程名称查找指定流程 //通过流程名称查找指定流程
getProcessByName: 'workflow/process/name', getProcessByName: 'workflow/process/name',
processInstancemMyApplyList: 'process-instance/my-apply-list', processInstancemMyApplyList: 'process-instance/my-apply-list',
processInstancemMyAuditList: 'process-instance/my-audit-list?', processInstancemMyAuditList: 'process-instance/my-audit-list',
//删除草稿 //删除草稿
delDraftUrl: 'process/drafts/{draftId}', delDraftUrl: 'process/drafts/{draftId}',
} }

Loading…
Cancel
Save