diff --git a/web/client/src/sections/workOrder/containers/aboutMe.jsx b/web/client/src/sections/workOrder/containers/aboutMe.jsx index 8abf95c..454f448 100644 --- a/web/client/src/sections/workOrder/containers/aboutMe.jsx +++ b/web/client/src/sections/workOrder/containers/aboutMe.jsx @@ -1,21 +1,186 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { connect } from 'react-redux'; +import { ApiTable, EmisApiTable, EmisRequest } from '$utils' +import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen, WorkflowModal } from "$components"; +import moment from "moment"; -const Server = (props) => { - const { dispatch, actions, user, loading, socket } = props - useEffect(() => { +const Rest = (props) => { + const { dispatch, actions, user, socket } = props + + const [query, setQuery] = useState({ limit: 10, offset: 0 }); //页码信息 + const [limits, setLimits] = useState(0)//每页实际条数 + const [tableData, setTableData] = useState([]); + const [loading, setLoading] = useState(true); + const [workflowModalVisible, setWorkflowModalVisible] = useState(false) + const [processInstanceId, setProcessInstanceId] = useState(null) + const [params, setParams] = useState({}) + + + useEffect(() => { + backlogData() }, []) + let backlogData = (obj = { limit: 10, offset: 0 }) => { + + setLoading(true) + EmisRequest.get(EmisApiTable.processInstancemMyNoticeList, + { userId: user?.id, businessType: '', ...obj }) + .then(res => { + setTableData(res?.data) + setLoading(false) + }, error => { + Toast.error({ content: '抄送我的工单列表请求失败', duration: 1, }) + setLoading(false) + + }); + EmisRequest.get(EmisApiTable.processInstancemMyNoticeCount, + { userId: user?.id, businessType: '', ...obj, limit: "", offset: "" }) + .then(res => { + setLimits(res.count || 0) + }, error => { + Toast.error({ content: '抄送我的工单数量请求失败', duration: 1, }) + }); + } + + let columns = [{ + title: '序号', + dataIndex: 'index', + render: (text, record, index) => index + 1 + }, { + title: '标题', + dataIndex: 'nae', + }, { + title: '关联项目', + dataIndex: 'nae', + }, { + title: '申请人', + dataIndex: 'applyerName', + }, { + title: '申请部门', + dataIndex: 'applyDepartmentName', + }, { + title: '审批状态', + dataIndex: 'apName', + }, { + title: '提交时间', + dataIndex: 'startTime', + render: (text, record, index) => text && moment(text).format('YYYY-MM-DD HH:mm:ss') || '--' + }, { + title: '期望完成时间', + dataIndex: 'nae', + }, { + title: '操作', + dataIndex: 'hadle', + render: (text, record, index) =>
{ + setProcessInstanceId(record.processInstanceId) + setWorkflowModalVisible(true) + + }}>查看详情
+ }] return ( <> -
- +
+
+
+
+
已办工单
+
ALREADY WORKORDER
+
+
+
(form.current = formApi)} + layout="horizontal" + style={{ position: "relative", width: "100%", flex: 1 }} + onSubmit={(values) => { + if (values?.applyTimes) { + values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] + } + backlogData({ ...values, limit: 10, page: 0 }) + setQuery({ limit: 10, offset: 0 }); + setLimits(0) + setParams({ ...values }) + }} + > + + } + field="keywordsUser" + pure + showClear + style={{ width: 260, marginLeft: 12, marginRight: 12 }} + placeholder="请输入申请人" + /> + + + + +
+
+ +
+ + + + +
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, offset: currentPage - 1 }); + backlogData({ ...params, limit: pageSize, offset: currentPage - 1 }) + }} + /> +
+
+ + { setWorkflowModalVisible(false) }} + successCallBack={() => { setWorkflowModalVisible(false) }} + /> ) } @@ -24,11 +189,11 @@ function mapStateToProps (state) { const { auth, global, members, webSocket } = state; return { // loading: members.isRequesting, - // user: auth.user, + user: auth.user, // actions: global.actions, // members: members.data, // socket: webSocket.socket }; } -export default connect(mapStateToProps)(Server); +export default connect(mapStateToProps)(Rest); diff --git a/web/client/src/sections/workOrder/containers/initiated.jsx b/web/client/src/sections/workOrder/containers/initiated.jsx index 27f758a..dbe77e7 100644 --- a/web/client/src/sections/workOrder/containers/initiated.jsx +++ b/web/client/src/sections/workOrder/containers/initiated.jsx @@ -1,21 +1,180 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { connect } from 'react-redux'; +import { ApiTable, EmisApiTable, EmisRequest } from '$utils' +import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen, WorkflowModal } from "$components"; +import moment from "moment"; + + const Rest = (props) => { - const { dispatch, actions, user, loading, socket } = props + const { dispatch, actions, user, socket } = props + + const [query, setQuery] = useState({ limit: 10, offset: 0 }); //页码信息 + const [limits, setLimits] = useState(0)//每页实际条数 + const [tableData, setTableData] = useState([]); + const [loading, setLoading] = useState(true); + const [workflowModalVisible, setWorkflowModalVisible] = useState(false) + const [processInstanceId, setProcessInstanceId] = useState(null) + const [params, setParams] = useState({}) - useEffect(() => { + useEffect(() => { + backlogData() }, []) + let backlogData = (obj = { limit: 10, offset: 0 }) => { + + setLoading(true) + EmisRequest.get(EmisApiTable.processInstancemMyApplyList, + { userId: user?.id, businessType: '', ...obj }) + .then(res => { + setTableData(res?.data) + setLimits(res.count || 0) + setLoading(false) + }, error => { + Toast.error({ content: '由我发起的工单列表请求失败', duration: 1, }) + setLoading(false) + + }); + } + + let columns = [{ + title: '序号', + dataIndex: 'index', + render: (text, record, index) => index + 1 + }, { + title: '标题', + dataIndex: 'nae', + }, { + title: '关联项目', + dataIndex: 'nae', + }, { + title: '申请人', + dataIndex: 'applyerName', + }, { + title: '申请部门', + dataIndex: 'applyDepartmentName', + }, { + title: '审批状态', + dataIndex: 'apName', + }, { + title: '提交时间', + dataIndex: 'startTime', + render: (text, record, index) => text && moment(text).format('YYYY-MM-DD HH:mm:ss') || '--' + }, { + title: '期望完成时间', + dataIndex: 'nae', + }, { + title: '操作', + dataIndex: 'hadle', + render: (text, record, index) =>
{ + setProcessInstanceId(record.processInstanceId) + setWorkflowModalVisible(true) + + }}>查看详情
+ }] return ( <> -
- +
+
+
+
+
由我发起
+
LAUNCH WORKORDER
+
+
+
(form.current = formApi)} + layout="horizontal" + style={{ position: "relative", width: "100%", flex: 1 }} + onSubmit={(values) => { + if (values?.applyTimes) { + values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] + } + backlogData({ ...values, limit: 10, page: 0 }) + setQuery({ limit: 10, offset: 0 }); + setLimits(0) + setParams({ ...values }) + }} + > + + {/* } + field="keywordsUser" + pure + showClear + style={{ width: 260, marginLeft: 12, marginRight: 12 }} + placeholder="请输入申请人" + /> */} + + + + +
+
+ +
+ +
+ + +
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, offset: currentPage - 1 }); + backlogData({ ...params, limit: pageSize, offset: currentPage - 1 }) + }} + /> +
+
+ + { setWorkflowModalVisible(false) }} + successCallBack={() => { setWorkflowModalVisible(false) }} + /> ) } @@ -24,7 +183,7 @@ function mapStateToProps (state) { const { auth, global, members, webSocket } = state; return { // loading: members.isRequesting, - // user: auth.user, + user: auth.user, // actions: global.actions, // members: members.data, // socket: webSocket.socket diff --git a/web/client/src/sections/workOrder/containers/receipt.jsx b/web/client/src/sections/workOrder/containers/receipt.jsx index c116207..898f1b4 100644 --- a/web/client/src/sections/workOrder/containers/receipt.jsx +++ b/web/client/src/sections/workOrder/containers/receipt.jsx @@ -1,21 +1,186 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { connect } from 'react-redux'; +import { ApiTable, EmisApiTable, EmisRequest } from '$utils' +import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen, WorkflowModal } from "$components"; +import moment from "moment"; -const SetControl = (props) => { - const { dispatch, actions, user, loading, socket } = props - useEffect(() => { +const Rest = (props) => { + const { dispatch, actions, user, socket } = props + + const [query, setQuery] = useState({ limit: 10, offset: 0 }); //页码信息 + const [limits, setLimits] = useState(0)//每页实际条数 + const [tableData, setTableData] = useState([]); + const [loading, setLoading] = useState(true); + const [workflowModalVisible, setWorkflowModalVisible] = useState(false) + const [processInstanceId, setProcessInstanceId] = useState(null) + const [params, setParams] = useState({}) + + + useEffect(() => { + backlogData() }, []) + let backlogData = (obj = { limit: 10, offset: 0 }) => { + + setLoading(true) + EmisRequest.get(EmisApiTable.processInstancemMyDoneList, + { userId: user?.id, businessType: '', ...obj }) + .then(res => { + setTableData(res?.data) + setLoading(false) + }, error => { + Toast.error({ content: '已办工单列表请求失败', duration: 1, }) + setLoading(false) + + }); + EmisRequest.get(EmisApiTable.processInstancemMyDoneCount, + { userId: user?.id, businessType: '', ...obj, limit: "", offset: "" }) + .then(res => { + setLimits(res.count || 0) + }, error => { + Toast.error({ content: '已办工单数量请求失败', duration: 1, }) + }); + } + + let columns = [{ + title: '序号', + dataIndex: 'index', + render: (text, record, index) => index + 1 + }, { + title: '标题', + dataIndex: 'nae', + }, { + title: '关联项目', + dataIndex: 'nae', + }, { + title: '申请人', + dataIndex: 'applyerName', + }, { + title: '申请部门', + dataIndex: 'applyDepartmentName', + }, { + title: '审批状态', + dataIndex: 'apName', + }, { + title: '提交时间', + dataIndex: 'startTime', + render: (text, record, index) => text && moment(text).format('YYYY-MM-DD HH:mm:ss') || '--' + }, { + title: '期望完成时间', + dataIndex: 'nae', + }, { + title: '操作', + dataIndex: 'hadle', + render: (text, record, index) =>
{ + setProcessInstanceId(record.processInstanceId) + setWorkflowModalVisible(true) + + }}>查看详情
+ }] return ( <> -
- +
+
+
+
+
已办工单
+
ALREADY WORKORDER
+
+
+
(form.current = formApi)} + layout="horizontal" + style={{ position: "relative", width: "100%", flex: 1 }} + onSubmit={(values) => { + if (values?.applyTimes) { + values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] + } + backlogData({ ...values, limit: 10, page: 0 }) + setQuery({ limit: 10, offset: 0 }); + setLimits(0) + setParams({ ...values }) + }} + > + + } + field="keywordsUser" + pure + showClear + style={{ width: 260, marginLeft: 12, marginRight: 12 }} + placeholder="请输入申请人" + /> + + + + +
+
+ +
+ +
+ + +
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, offset: currentPage - 1 }); + backlogData({ ...params, limit: pageSize, offset: currentPage - 1 }) + }} + /> +
+
+ + { setWorkflowModalVisible(false) }} + successCallBack={() => { setWorkflowModalVisible(false) }} + /> ) } @@ -24,11 +189,11 @@ function mapStateToProps (state) { const { auth, global, members, webSocket } = state; return { // loading: members.isRequesting, - // user: auth.user, + user: auth.user, // actions: global.actions, // members: members.data, // socket: webSocket.socket }; } -export default connect(mapStateToProps)(SetControl); +export default connect(mapStateToProps)(Rest); diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index ea72334..4f1493b 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -13,18 +13,8 @@ import moment from "moment"; const Rest = (props) => { const { dispatch, actions, user, socket } = props - const form = useRef();//表单 - const [setup, setSetup] = useState(false); //表格设置是否显现 - const [setupp, setSetupp] = useState([]);//实际显示的表格列表 const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 const [limits, setLimits] = useState(0)//每页实际条数 - const mylimits = useRef(); //每页实际条数 - const [pushModal, setPushModal] = useState(false) //信鸽弹框 - const [pushEdit, setPushEdit] = useState(false) //是否是修改 - const [change, setChange] = useState(false) //是否改变 - const [allTableData, setAllTableData] = useState([]) //获取到的所有表格信息 - const [editObj, setEditObj] = useState({});//管理员弹框修改内容 - const [projectStatus, setProjectStatus] = useState([]); //获取项目状态列表 const [tableData, setTableData] = useState([]); //获取项目状态列表 const [loading, setLoading] = useState(true); //获取项目状态列表 const [workflowModalVisible, setWorkflowModalVisible] = useState(false) @@ -36,16 +26,15 @@ const Rest = (props) => { backlogData() }, []) - let backlogData = () => { + let backlogData = (obj = {}) => { + setLoading(true) EmisRequest.get(EmisApiTable.processInstancemMyAuditList, - { userId: user?.id, businessType: '运维中台表单', }) + { userId: user?.id, businessType: '', ...obj }) .then(res => { - console.log(111, res); setTableData(res) setLimits(res.length || 0) setLoading(false) - }, error => { Toast.error({ content: '待办工单请求失败', duration: 1, }) setLoading(false) @@ -101,7 +90,12 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - console.log(values) + if (values?.applyTimes) { + values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] + } + backlogData(values) + setQuery({ limit: 10, page: 0 }); + setLimits(0) }} > { /> } - field="keyword" + field="keywordsUser" pure showClear style={{ width: 260, marginLeft: 12, marginRight: 12 }} placeholder="请输入申请人" /> - + @@ -199,7 +180,7 @@ function mapStateToProps (state) { const { auth, global, members, webSocket } = state; return { // loading: members.isRequesting, - // user: auth.user, + user: auth.user, // actions: global.actions, // members: members.data, // socket: webSocket.socket diff --git a/web/client/src/sections/workOrder/nav-item.jsx b/web/client/src/sections/workOrder/nav-item.jsx index f74e758..e4c0d28 100644 --- a/web/client/src/sections/workOrder/nav-item.jsx +++ b/web/client/src/sections/workOrder/nav-item.jsx @@ -22,7 +22,7 @@ export function getNavItem (user, dispatch) { items: [{ itemKey: 'stayDoWorkOrder', to: '/workOrder/workOrderList/stayDoWorkOrder', text: '待办工单' },{ - itemKey: 'initiated', to: '/workOrder/workOrderList/initiated', text: '由发起的' + itemKey: 'initiated', to: '/workOrder/workOrderList/initiated', text: '由我发起' },{ itemKey: 'receipt', to: '/workOrder/workOrderList/already ', text: '已办工单' },{ diff --git a/web/client/src/sections/workOrder/routes.js b/web/client/src/sections/workOrder/routes.js index 8a17cf2..d4d31f6 100644 --- a/web/client/src/sections/workOrder/routes.js +++ b/web/client/src/sections/workOrder/routes.js @@ -25,7 +25,7 @@ export default [{ path: '/initiated', key: 'initiated', component: Initiated, - breadcrumb: '由发起的', + breadcrumb: '由我发起', }, { path: '/already ', key: 'already ', diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 732da79..57a7707 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -87,8 +87,12 @@ export const EmisApiTable = { //通过流程名称查找指定流程 getProcessByName: 'workflow/process/name', - processInstancemMyApplyList: 'process-instance/my-apply-list', - processInstancemMyAuditList: 'process-instance/my-audit-list', + processInstancemMyApplyList: 'process-instance/my-apply-list', //待办工单 + processInstancemMyAuditList: 'process-instance/my-audit-list', //由我发起 + processInstancemMyDoneList: 'process-instance/my-done-list/optimization', //已办工单 + processInstancemMyDoneCount: 'process-instance/my-done-count/optimization', //已办工单数量 + processInstancemMyNoticeList: 'process-instance/my-notice-list/optimization', //抄送我 + processInstancemMyNoticeCount: 'process-instance/my-notice-count/optimization', //抄送我 数量 //删除草稿 delDraftUrl: 'process/drafts/{draftId}', }