Files
workflow/app/view/page/taskICreateManagement.html
T
2022-08-27 21:25:10 +08:00

140 lines
4.3 KiB
HTML

{% extends 'template/jhTemplateV3.html'%}
{% block vue_template %}
<jh-layout-v3>
<!-- 页面主要内容 -->
<v-card :class="{'px-2': isMobile}">
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-2': isMobile}">
<v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span>
</v-col>
<v-spacer></v-spacer>
<v-col cols="12" xs="8" sm="4" md="3" xl="3" class="px-0">
<v-text-field v-model="searchInput" prefix="表格过滤:" color="success" class="cus-v-input" dense filled
single-line></v-text-field>
</v-col>
</v-row>
<v-data-table :headers="headers"
:items="tableData"
:search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20"
mobile-breakpoint="0"
:loading="isTableLoading"
checkbox-color="success"
:class="{'mx-2': isMobile}"
color="success"
class="elevation-0 mt-0 flex-fill d-flex flex-column">
<template v-slot:item.action="{ item }">
<v-btn small color="success" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
</jh-layout-v3>
{% endblock %}
{% block vue_body %}
<script type="module">
new Vue({
el: '#app',
template: '#app-template',
vuetify: new Vuetify(),
data: () => ({
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
currentTableGenderType: 'all',
searchInput: null,
isTableLoading: true,
tableDataFromBackend: [],
headers: [
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
{text: "任务ID", value: "taskId", width: 120},
{text: "任务名称", value: "taskTitle", width: 120},
{text: "任务状态", value: "taskStatus", width: 120},
{text: "当前执行中节点ID", value: "taskConfigId", width: 120},
{text: "申请人", value: "taskInitUser", width: 120},
{text: "当前执行的处理人员,用逗号分隔", value: "taskEditUserList", width: 120},
{text: "所有相关人员,用逗号分隔", value: "taskViewUserList", width: 120},
{text: "备注", value: "taskComment", width: 120},
{text: "任务创建人", value: "createByUser", width: 120},
{text: "操作者", value: "operationByUser", width: 120},
{text: "操作时间", value: "operationAt", width: 250},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
],
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {
},
methods: {
async doUiAction(uiActionId, actionData) {
switch (uiActionId) {
case 'refreshTableData':
await this.refreshTableData(actionData);
break;
case 'toTaskHistory':
await this.toTaskHistory(actionData);
break;
default:
console.error("[doAction] uiActionId not find", { uiActionId });
break;
}
},
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskICreateManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
});
this.tableDataFromBackend = rows;
this.isTableLoading = false;
},
toTaskHistory({item}) {
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
</script>
<style scoped>
</style>
{% endblock %}