Files
workflow/app/view/component/taskHistory.html
T
yuebenshan 14cfbf118d review workflowManagement.html
1.table空数据(所有)
2.方法结构整理 workflowManagement
3.最新UI同步(所有)
2023-02-14 16:28:16 +08:00

115 lines
3.1 KiB
HTML

<!-- 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 }">
<span v-if="item.taskConfigId.includes('userTask-')">
<span>{{item.taskExplain}}</span>
<v-icon
large
>
mdi-arrow-right-thin
</v-icon>
<v-chip
v-if="item.taskHandleDesc === '拒绝'"
color="red"
small dark
>
{{item.taskHandleDesc}}
</v-chip>
<v-chip
v-else
color="green"
small dark
>
{{item.taskHandleDesc}}
</v-chip>
</span>
<span v-else>{{item.taskHandleDesc}}</span>
</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 -->