Files
workflow/app/view/component/taskHistory.html
T

103 lines
2.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- taskHistory.html >>>>>>>>>>>>> -->
<script type="text/html" id="task-history">
<div>
<v-data-table
:headers="headers"
:items="tableData"
:items-per-page="-1"
mobile-breakpoint="0"
:loading="isTableLoading"
checkbox-color="success"
fixed-header
hide-default-footer
class="jh-fixed-table-height elevation-0 mt-0 mb-xs-4">
<!--没有数据-->
<template v-slot:loading>
<div class="jh-no-data">数据加载中</div>
</template>
<template v-slot:no-data>
<div class="jh-no-data">暂无数据</div>
</template>
<template v-slot:no-results>
<div class="jh-no-data">暂无数据</div>
</template>
<!-- 节点说明 -->
<template v-slot:item.taskHandleDesc="{ item }">
<template v-if="item.taskConfigId.includes('userTask-')">
<v-chip :color="item.taskHandleDesc === '拒绝' ? 'red' : 'green'" x-small dark>
{{item.taskExplain}}:{{item.taskHandleDesc}}
</v-chip>
</template>
<template v-else>
<v-chip color="grey lighten-1" x-small dark>
{{item.taskHandleDesc}}
</v-chip>
</template>
</template>
</v-data-table>
</div>
</script>
<script>
Vue.component('task-history', {
template: "#task-history",
vueComponent: 'task-history',
vuetify: new Vuetify(),
props: {
taskId: {
type: String,
default: '',
},
},
data() {
return {
isTableLoading: false,
headers: [
{text: "名称", value: "taskTitle", width: 230, class: 'fixed', cellClass: 'fixed'},
{text: "节点说明", value: "taskHandleDesc", width: 120},
{text: "操作人", value: "operationByUser", width: 120},
{text: "操作时间", value: "operationAt", width: 250},
],
tableData: [],
};
},
watch: {
taskId: {
handler(val, oldVal) {
if (!val) return;
this.getTableData();
},
immediate: true,
},
},
methods: {
// ---------- 获取列表 >>>>>>>>>> --------
async getTableData() {
this.isTableLoading = true;
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'todo',
actionId: 'getTaskHistory',
actionData: {taskId: this.taskId},
}
}
})
const {taskHistoryList, lineTypeList} = result.data.appData.resultData;
taskHistoryList.forEach(task => {
task.operationAt = task.taskStatus != 'end' ? dayjs(task.operationAt).format('YYYY-MM-DD HH:mm:ss') : ''
})
this.tableData = taskHistoryList;
this.$emit('line-type-list', lineTypeList);
this.isTableLoading = false;
},
// ---------- <<<<<<<<<< 获取列表 --------
},
});
</script>
<style>
</style>
<!-- <<<<<<<<<<<<< taskHistory.html -->