init
This commit is contained in:
20
src/views/jsonflow/comment/flow.vue
Normal file
20
src/views/jsonflow/comment/flow.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<comment-timeline :currJob="props.currJob">
|
||||
</comment-timeline>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Comment">
|
||||
// 引入组件
|
||||
const CommentTimeline = defineAsyncComponent(() => import('./timeline.vue'));
|
||||
|
||||
const props = defineProps({
|
||||
currJob: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
166
src/views/jsonflow/comment/form.vue
Normal file
166
src/views/jsonflow/comment/form.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-dialog :title="title" v-model="visible" width="60%"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px" v-loading="loading" :disabled="operType === 'view'">
|
||||
<el-row :gutter="24">
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="$t('jfcomment.flowInstId')" prop="flowInstId" >
|
||||
<el-input v-model="form.flowInstId" :placeholder="t('jfcomment.inputFlowInstIdTip')" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="t('jfcomment.flowKey')" prop="flowKey">
|
||||
<el-select v-model="form.flowKey" :placeholder="t('jfcomment.inputFlowKeyTip')" clearable filterable disabled>
|
||||
<el-option v-for="(item, index) in cascadeDic.flowKey" :key="index" :label="item.flowName" :value="item.flowKey"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="t('jfcomment.runNodeId')" prop="runNodeId">
|
||||
<el-select v-model="form.runNodeId" :placeholder="t('jfcomment.inputRunNodeIdTip')" clearable filterable disabled>
|
||||
<el-option v-for="(item, index) in cascadeDic.runNodeId" :key="index" :label="item.nodeName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="t('jfcomment.runJobId')" prop="runJobId">
|
||||
<el-select v-model="form.runJobId" :placeholder="t('jfcomment.inputRunJobIdTip')" clearable filterable disabled>
|
||||
<el-option v-for="(item, index) in cascadeDic.runJobId" :key="index" :label="item.jobName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="t('jfcomment.userId')" prop="userId">
|
||||
<el-select v-model="form.userId" :placeholder="t('jfcomment.inputUserIdTip')" clearable filterable>
|
||||
<el-option v-for="(item, index) in dicData.userId" :key="index" :label="item.name" :value="item.userId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="t('jfcomment.remark')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="t('jfcomment.inputRemarkTip')"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="operType !== 'view'">
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="CommentDialog">
|
||||
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/jsonflow/comment'
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { rule } from '/@/utils/validate';
|
||||
import {onCascadeChange, onLoadDicUrl} from "/@/flow/components/convert-name/convert";
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
const operType = ref(false);
|
||||
const title = ref('');
|
||||
// 定义字典
|
||||
const dicData = reactive({});
|
||||
const cascadeDic = reactive({});
|
||||
const onLoad = onLoadDicUrl({key: "userId"});
|
||||
const onCascade = onCascadeChange(cascadeDic, {key: "flowInstId", cascades: ["flowKey", "runNodeId"]}, {key: "runNodeId", cascades: ["runJobId"]});
|
||||
onMounted(() => {
|
||||
onLoad(dicData);
|
||||
});
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
flowKey: '',
|
||||
flowNodeId: '',
|
||||
nodeJobId: '',
|
||||
userId: '',
|
||||
remark: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
flowKey: [{required: true, message: '流程名称不能为空', trigger: 'blur'}],
|
||||
flowNodeId: [{required: true, message: '节点名称不能为空', trigger: 'blur'}],
|
||||
nodeJobId: [{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
||||
userId: [{required: true, message: '审批人不能为空', trigger: 'blur'}],
|
||||
remark: [{required: true, message: '审批意见不能为空', trigger: 'blur'}],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (type: string, id: string) => {
|
||||
visible.value = true
|
||||
operType.value = type;
|
||||
form.id = ''
|
||||
|
||||
if (type === 'add') {
|
||||
title.value = t('common.addBtn');
|
||||
} else if (type === 'edit') {
|
||||
title.value = t('common.editBtn');
|
||||
} else if (type === 'view') {
|
||||
title.value = t('common.viewBtn');
|
||||
}
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取Comment信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getCommentData(id)
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(t(form.id ? 'common.editSuccessText' : 'common.addSuccessText'));
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化表单数据
|
||||
const getCommentData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
onCascade(form);
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
});
|
||||
</script>
|
||||
35
src/views/jsonflow/comment/i18n/en.ts
Normal file
35
src/views/jsonflow/comment/i18n/en.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export default {
|
||||
jfcomment: {
|
||||
index: '#',
|
||||
importcommentTip: 'import Comment',
|
||||
id: 'id',
|
||||
flowKey: 'flowKey',
|
||||
flowNodeId: 'flowNodeId',
|
||||
nodeJobId: 'nodeJobId',
|
||||
userId: 'userId',
|
||||
subFlowStatus: 'subFlowStatus',
|
||||
remark: 'remark',
|
||||
signName: 'signName',
|
||||
reSign: 're-sign',
|
||||
createUser: 'createUser',
|
||||
createTime: 'createTime',
|
||||
flowInstId: 'flowInstId',
|
||||
runNodeId: 'runNodeId',
|
||||
runJobId: 'runJobId',
|
||||
tenantId: 'tenantId',
|
||||
useTime: 'useTime',
|
||||
inputIdTip: 'input id',
|
||||
inputFlowKeyTip: 'input flowKey',
|
||||
inputFlowNodeIdTip: 'input flowNodeId',
|
||||
inputNodeJobIdTip: 'input nodeJobId',
|
||||
inputUserIdTip: 'input userId',
|
||||
inputRemarkTip: 'input remark',
|
||||
inputSignNameTip: 'input signName',
|
||||
inputCreateUserTip: 'input createUser',
|
||||
inputCreateTimeTip: 'input createTime',
|
||||
inputFlowInstIdTip: 'input flowInstId',
|
||||
inputRunNodeIdTip: 'input runNodeId',
|
||||
inputRunJobIdTip: 'input runJobId',
|
||||
inputTenantIdTip: 'input tenantId',
|
||||
}
|
||||
}
|
||||
35
src/views/jsonflow/comment/i18n/zh-cn.ts
Normal file
35
src/views/jsonflow/comment/i18n/zh-cn.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export default {
|
||||
jfcomment: {
|
||||
index: '#',
|
||||
importcommentTip: '导入节点批注管理',
|
||||
id: '主键ID',
|
||||
flowKey: '流程名称',
|
||||
flowNodeId: '节点名称',
|
||||
nodeJobId: '任务名称',
|
||||
userId: '审批人',
|
||||
subFlowStatus: '子流程状态',
|
||||
remark: '审批意见',
|
||||
signName: '审批签名',
|
||||
reSign: '重签',
|
||||
createUser: '创建人',
|
||||
createTime: '创建时间',
|
||||
flowInstId: '流程实例ID',
|
||||
runNodeId: '节点名称',
|
||||
runJobId: '任务名称',
|
||||
|
||||
useTime: '任务耗时',
|
||||
inputIdTip: '请输入主键ID',
|
||||
inputFlowKeyTip: '请输入流程名称',
|
||||
inputFlowNodeIdTip: '请输入节点名称',
|
||||
inputNodeJobIdTip: '请输入任务名称',
|
||||
inputUserIdTip: '请输入审批人',
|
||||
inputRemarkTip: '请输入审批意见',
|
||||
inputSignNameTip: '请输入审批签名',
|
||||
inputCreateUserTip: '请输入创建人',
|
||||
inputCreateTimeTip: '请输入创建时间',
|
||||
inputFlowInstIdTip: '请输入流程实例ID',
|
||||
inputRunNodeIdTip: '请输入节点名称',
|
||||
inputRunJobIdTip: '请输入任务名称',
|
||||
|
||||
}
|
||||
}
|
||||
168
src/views/jsonflow/comment/index.vue
Normal file
168
src/views/jsonflow/comment/index.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item :label="$t('jfcomment.flowInstId')" prop="flowInstId" >
|
||||
<el-input v-model="state.queryForm.flowInstId" :placeholder="t('jfcomment.inputFlowInstIdTip')"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('jfcomment.userId')" prop="userId" >
|
||||
<el-select v-model="state.queryForm.userId" :placeholder="t('jfcomment.inputUserIdTip')" clearable filterable style="max-width: 180px">
|
||||
<el-option v-for="(item, index) in dicData.users" :key="index" :label="item.name" :value="item.userId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'jsonflow_comment_export'"
|
||||
class="ml10" style="float: right;margin-right: 20px"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" :label="t('jfcomment.index')" width="40" />
|
||||
<el-table-column prop="flowInstId" :label="t('jfcomment.flowInstId')" show-overflow-tooltip/>
|
||||
<el-table-column prop="flowKey" :label="t('jfcomment.flowKey')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.flowInstId" :value="scope.row.flowKey"
|
||||
:valueKey="'flowKey'" :showKey="'flowName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runNodeId" :label="t('jfcomment.runNodeId')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.runNodeId" :value="scope.row.runNodeId"
|
||||
:valueKey="'id'" :showKey="'nodeName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runJobId" :label="t('jfcomment.runJobId')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.runJobId" :value="scope.row.runJobId"
|
||||
:valueKey="'id'" :showKey="'jobName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" :label="t('jfcomment.userId')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.userId" :value="scope.row.userId"
|
||||
:valueKey="'userId'" :showKey="'name'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signName" :label="t('jfcomment.signName')">
|
||||
<template #default="scope">
|
||||
<img width="200px" v-if="scope.row.signName" :src="scope.row.signName"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" :label="t('jfcomment.remark')" show-overflow-tooltip/>
|
||||
<el-table-column prop="createUser" :label="t('jfcomment.createUser')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.createUser" :value="scope.row.createUser"
|
||||
:valueKey="'userId'" :showKey="'name'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" :label="t('jfcomment.createTime')" show-overflow-tooltip/>
|
||||
<el-table-column :label="$t('common.action')" width="100">
|
||||
<template #default="scope">
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
{{ $t('common.viewBtn') }}
|
||||
</template>
|
||||
<el-button text type="primary" icon="view" @click="formDialogRef.openDialog('view', scope.row.id)">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
{{ $t('common.editBtn') }}
|
||||
</template>
|
||||
<el-button icon="edit-pen" text type="primary" @click="formDialogRef.openDialog('edit', scope.row.id)">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
{{ $t('common.delBtn') }}
|
||||
</template>
|
||||
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemComment">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/jsonflow/comment";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
|
||||
import { useI18n } from "vue-i18n";
|
||||
import {onLoadDicUrl, onLoaded} from "/@/flow/components/convert-name/convert";
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const { t } = useI18n()
|
||||
// 定义字典
|
||||
const dicData = reactive({});
|
||||
const onLoad = onLoadDicUrl({key: "users"});
|
||||
onMounted(() => {
|
||||
onLoad(dicData);
|
||||
});
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
onLoaded: onLoaded({key: "createUser"}, {key: "userId"}, {key: "flowInstId"}, {key: "runNodeId"}, {key: "runJobId"}),
|
||||
descs: ["create_time"]
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile
|
||||
} = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm(t('common.delConfirmText'));
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
289
src/views/jsonflow/comment/timeline.vue
Normal file
289
src/views/jsonflow/comment/timeline.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="color: red">注:一个任务若被审批多次,则会显示出多条审批记录(审批留痕)</div>
|
||||
<div id="printComment">
|
||||
<div>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<right-toolbar v-model:showSearch="showSearch" v-model:search="search"
|
||||
class="ml10" style="float: right;margin-right: 20px"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="index" :label="t('jfcomment.index')" width="40"/>
|
||||
<el-table-column prop="flowKey" :label="t('jfcomment.flowKey')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.flowInstId" :value="scope.row.flowInstId"
|
||||
:valueKey="'id'" :showKey="'flowName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runNodeId" :label="t('jfcomment.runNodeId')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.runNodeId" :value="scope.row.runNodeId"
|
||||
:valueKey="'id'" :showKey="'nodeName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runJobId" :label="t('jfcomment.runJobId')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.runJobId" :value="scope.row.runJobId"
|
||||
:valueKey="'id'" :showKey="'jobName'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jobType" :label="t('runJob.jobType')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="DIC_PROP.JOB_USER_TYPE" :value="scope.row.jobType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" :label="t('runJob.roleId')" :width="data.width">
|
||||
<template #default="scope">
|
||||
<convert-role-name :value="scope.row" :isJobType="'0'"></convert-role-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userId" :label="t('jfcomment.userId')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<convert-name :options="state.dicData.userId" :value="scope.row.userId"
|
||||
:valueKey="'userId'" :showKey="'name'"></convert-name>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" :label="t('runJob.startTime')" show-overflow-tooltip width="160px"/>
|
||||
<el-table-column prop="endTime" :label="t('runJob.endTime')" show-overflow-tooltip width="160px"/>
|
||||
<el-table-column prop="useTime" :label="t('jfcomment.useTime')" show-overflow-tooltip width="120px"/>
|
||||
<el-table-column prop="status" :label="t('runJob.status')" show-overflow-tooltip width="90px">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="DIC_PROP.NODE_STATUS" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="subFlowInstId" :label="t('runJob.subFlowInstId')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tooltip placement="top" content="点击可查看关联子流程工单信息" v-if="scope.row.subFlowInstId">
|
||||
<convert-name :options="state.dicData.subFlowInstId" :value="scope.row.subFlowInstId"
|
||||
:valueKey="'id'" :showKey="'flowName'"
|
||||
:elTagType="'primary'" @click="handleJobByFlowInstId(scope.row)"></convert-name>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="subFlowStatus" :label="t('jfcomment.subFlowStatus')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="DIC_PROP.FLOW_STATUS" :value="scope.row.subFlowStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signatureType" :label="t('runJob.signatureType')" show-overflow-tooltip width="90px">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="DIC_PROP.BELONG_TYPE" :value="scope.row.belongType" v-if="scope.row.belongType !== '0'"></dict-tag>
|
||||
<dict-tag :options="DIC_PROP.SIGNATURE_TYPE" :value="scope.row.signatureType" v-else></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="suspension" :label="t('runJob.suspension')" show-overflow-tooltip :width="data.width">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="DIC_PROP.YES_OR_NO" :value="scope.row.suspension"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signName" :label="t('jfcomment.signName')" :width="data.width">
|
||||
<template #default="scope">
|
||||
<img width="200px" v-if="scope.row.signName" :src="scope.row.signName"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" :label="t('jfcomment.remark')" show-overflow-tooltip :width="data.width"/>
|
||||
<el-table-column :label="$t('common.action')" width="300">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" icon="Bell" @click="remind(scope.row, '0')"
|
||||
v-if="(scope.row.status ==='0' || scope.row.status ==='9') && scope.row.roleId">
|
||||
{{ $t('jfForm.urgentTask') }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="Bell" @click="remind(scope.row, '1')"
|
||||
v-if="scope.row.subFlowStatus === '0'">
|
||||
{{ $t('jfForm.urgentSubFlow') }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="delete" @click="signOff(scope.row)"
|
||||
v-if="scope.row.status ==='0' && validateSignOff(scope.row)">
|
||||
{{ $t('jfForm.reduceSign') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||
v-bind="state.pagination"/>
|
||||
</div>
|
||||
<el-timeline style="margin-top: 22px; margin-left: 12px">
|
||||
<el-timeline-item
|
||||
v-for="(item, index) in state.dataList"
|
||||
:key="index"
|
||||
:icon="item.status === '0' ? 'Loading' : 'SuccessFilled'"
|
||||
:color="item.status === '0' ? '#409EFF' : '#19be6b'"
|
||||
size="large"
|
||||
:timestamp="item.endTime">
|
||||
<div style="align-items: center; display: flex;">
|
||||
<span style="margin-right: 15px">
|
||||
{{ item.jobName }} {{ item.userName }}
|
||||
</span>
|
||||
<span style="margin-right: 15px">
|
||||
<convert-role-name :value="item"></convert-role-name>
|
||||
</span>
|
||||
<span style="margin-right: 15px">
|
||||
{{
|
||||
item.status === '0' || item.status === '2' || item.status === '9' ? item.useTime : item.remark
|
||||
}}
|
||||
</span>
|
||||
|
||||
<el-tooltip placement="top" content="点击可查看关联子流程工单信息" v-if="item.subFlowInstId && state.dicData.subFlowInstId">
|
||||
<convert-name :options="state.dicData.subFlowInstId" :value="item.subFlowInstId" :style="'margin-right: 15px'"
|
||||
:valueKey="'id'" :showKey="'flowName'"
|
||||
:elTagType="'primary'" @click="handleJobByFlowInstId(item)"></convert-name>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip placement="top" :content="t('jfcomment.subFlowStatus')" v-if="item.subFlowInstId">
|
||||
<dict-tag :options="DIC_PROP.FLOW_STATUS" :value="item.subFlowStatus" style="margin-right: 15px"></dict-tag>
|
||||
</el-tooltip>
|
||||
|
||||
<dict-tag :options="DIC_PROP.BELONG_TYPE" :value="item.belongType" v-if="item.belongType !== '0'"></dict-tag>
|
||||
|
||||
<dict-tag :options="DIC_PROP.SIGNATURE_TYPE" :value="item.signatureType" v-else></dict-tag>
|
||||
|
||||
<template v-if="item.signName">
|
||||
<img width="200px" :src="item.signName"/>
|
||||
</template>
|
||||
|
||||
<el-button text type="primary" icon="Bell" @click="remind(item, '0')"
|
||||
v-if="(item.status ==='0' || item.status ==='9') && item.roleId">
|
||||
{{ $t('jfForm.urgentTask') }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="Bell" @click="remind(item, '1')"
|
||||
v-if="item.subFlowStatus === '0'">
|
||||
{{ $t('jfForm.urgentSubFlow') }}
|
||||
</el-button>
|
||||
<el-button text type="primary" icon="delete" @click="signOff(item)"
|
||||
v-if="item.status ==='0' && validateSignOff(item)">
|
||||
{{ $t('jfForm.reduceSign') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<footer class="el-dialog__footer" style="text-align: center;">
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="printForm">{{
|
||||
t('jfI18n.print')
|
||||
}}
|
||||
</el-button>
|
||||
</span>
|
||||
</footer>
|
||||
|
||||
<el-drawer
|
||||
v-if="data.showHiJob"
|
||||
class="flow-header-drawer" direction="rtl"
|
||||
append-to-body size="90%"
|
||||
v-model="data.showHiJob"
|
||||
>
|
||||
<handle-job :curr-job="data.currJob"></handle-job>
|
||||
</el-drawer>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="CommentTimeline">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchComment } from "/@/api/jsonflow/comment";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
|
||||
import { useI18n } from "vue-i18n";
|
||||
import {onLoaded} from "/@/flow/components/convert-name/convert";
|
||||
import * as runJob from "/@/api/jsonflow/run-job";
|
||||
import {validateNull} from "/@/utils/validate";
|
||||
import {printHtml} from "/@/flow";
|
||||
|
||||
const HandleJob = defineAsyncComponent(() => import('/@/flow/components/handle-job/handle.vue'));
|
||||
|
||||
// 引入组件
|
||||
const { t } = useI18n()
|
||||
const $message = useMessage();
|
||||
|
||||
const props = defineProps({
|
||||
currJob: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
});
|
||||
|
||||
// 搜索变量
|
||||
const showSearch = ref(true)
|
||||
const search = ref(false)
|
||||
|
||||
const data = reactive({
|
||||
currJob: {},
|
||||
showHiJob: false,
|
||||
width: "-"
|
||||
})
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
flowInstId: props.currJob.flowInstId
|
||||
},
|
||||
pageList: fetchComment,
|
||||
pagination: {
|
||||
size: 1000,
|
||||
},
|
||||
onLoaded: onLoaded({key: "userId"}, {key: "flowInstId"}, {key: "subFlowInstId"}, {key: "runNodeId"}, {key: "runJobId"}),
|
||||
descs: ["create_time"]
|
||||
})
|
||||
|
||||
function signOff(row) {
|
||||
runJob.signOff(row).then(() => {
|
||||
getDataList();
|
||||
$message.success('Reduce Sign Success')
|
||||
})
|
||||
}
|
||||
|
||||
function remind(row, type) {
|
||||
row.remindType = type
|
||||
runJob.remind(row).then(() => {
|
||||
$message.success('Urgent Success')
|
||||
})
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
function handleJobByFlowInstId(row) {
|
||||
let find = state.dicData.subFlowInstId.find(f => f.id === row.subFlowInstId);
|
||||
data.currJob.flowInstId = find.id
|
||||
data.currJob.isHiJob = '1'
|
||||
data.currJob.isForm = '1'
|
||||
data.showHiJob = true
|
||||
}
|
||||
|
||||
function validateSignOff(row) {
|
||||
// TODO 此处需要全量数据,否则判断有问题。目前pageSize 1000
|
||||
// 当前节点下只有一个任务不能做减签操作
|
||||
let existNodeJobs = state.dataList.filter(f => f.runNodeId === row.runNodeId && f.id !== row.id && ['0', '1', '2', '9'].some(s => s === f.status));
|
||||
if (validateNull(existNodeJobs)) return false;
|
||||
// 当前流程只有一个任务不能做减签操作
|
||||
let existFlowJobs = state.dataList.filter(f => f.flowInstId === row.flowInstId && f.id !== row.id && ['0', '2', '9'].some(s => s === f.status));
|
||||
return !validateNull(existFlowJobs);
|
||||
}
|
||||
|
||||
function printForm() {
|
||||
data.width = "55"
|
||||
let flowName = state.dicData.flowInstId.find(f => f.flowKey === state.dataList[0].flowKey).flowName;
|
||||
printHtml("printComment", flowName, data)
|
||||
}
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
} = useTable(state)
|
||||
|
||||
// 监听双向绑定
|
||||
watch(
|
||||
() => props.currJob.id,
|
||||
(val) => {
|
||||
getDataList();
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import "../../../flow/components/style/flow-drawer.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user