|
@@ -14,3 +14,98 @@
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/
|
|
|
+
|
|
|
+import { axios } from '@/service/service'
|
|
|
+import {
|
|
|
+ CodeReq,
|
|
|
+ ProcessInstanceListReq,
|
|
|
+ BatchDeleteReq,
|
|
|
+ SubIdReq,
|
|
|
+ TaskReq,
|
|
|
+ LongestReq,
|
|
|
+ IdReq,
|
|
|
+ ProcessInstanceReq
|
|
|
+} from './types'
|
|
|
+
|
|
|
+export function queryProcessInstanceListPaging(params: ProcessInstanceListReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances`,
|
|
|
+ method: 'get',
|
|
|
+ params,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function batchDeleteProcessInstanceByIds(data: BatchDeleteReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/batch-delete`,
|
|
|
+ method: 'post',
|
|
|
+ data,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function queryParentInstanceBySubId(params: SubIdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/query-parent-by-sub`,
|
|
|
+ method: 'get',
|
|
|
+ params,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function querySubProcessInstanceByTaskCode(params: TaskReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/query-sub-by-parent`,
|
|
|
+ method: 'get',
|
|
|
+ params,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function queryTopNLongestRunningProcessInstance(params: LongestReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/top-n`,
|
|
|
+ method: 'get',
|
|
|
+ params,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function queryProcessInstanceById(id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}`,
|
|
|
+ method: 'get',
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function updateProcessInstance(data: ProcessInstanceReq, id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}`,
|
|
|
+ method: 'put',
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function deleteProcessInstanceById(id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}`,
|
|
|
+ method: 'delete',
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function queryTaskListByProcessId(id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}/tasks`,
|
|
|
+ method: 'get',
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function vieGanttTree(id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}/view-gantt`,
|
|
|
+ method: 'get',
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export function viewVariables(id: IdReq, code: CodeReq): any {
|
|
|
+ return axios({
|
|
|
+ url: `/projects/${code}/process-instances/${id}/view-variables`,
|
|
|
+ method: 'get',
|
|
|
+ })
|
|
|
+}
|