更新版本-参照 jinnang-v1
This commit is contained in:
1 parent
0ace3ac506
commit
c9c16e9d26
17 files changed
+2675
-1144
No files matched your search
@@ -1,176 +0,0 @@
|
||||
{% 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">共{{ tableDataFromBackend.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 fixed-header
|
||||
:headers="headers"
|
||||
:items="tableDataFromBackend"
|
||||
: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 class="mr-2" :class="tableButton.color" v-for="tableButton of tableButtonList"
|
||||
@click="doUiAction(tableButton.action, {item})">
|
||||
{{ tableButton.text }}
|
||||
</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: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
isFormValid: true,
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
],
|
||||
constantCollection: {},
|
||||
|
||||
serverSearchInput: {
|
||||
studentId: null,
|
||||
classId: null
|
||||
},
|
||||
isEditDrawerShow: false,
|
||||
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: 200, class: 'fixed', cellClass: 'fixed'},
|
||||
],
|
||||
|
||||
editItem: {},
|
||||
tableButtonList: [
|
||||
{text: '查看', buttonType: 'view', color: 'success', action: 'toTaskHistory'},
|
||||
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
|
||||
],
|
||||
dialogSaveInfoAction: ''
|
||||
}),
|
||||
watch: {},
|
||||
async created() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'deleteItem':
|
||||
await this.confirmDeleteItemDialog(uiActionData);
|
||||
await this.doDeleteItem(uiActionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'toTaskHistory':
|
||||
await this.toTaskHistory(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
break;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取表格数据
|
||||
*/
|
||||
async refreshTableData() {
|
||||
this.isTableLoading = true;
|
||||
const result = await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'taskManagement',
|
||||
actionId: 'selectItemList',
|
||||
actionData: {},
|
||||
where: {},
|
||||
orderBy: [{column: 'operationAt', order: 'desc'}]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.tableDataFromBackend = result.data.appData.resultData.rows;
|
||||
this.isTableLoading = false;
|
||||
},
|
||||
|
||||
// updateItem
|
||||
async confirmDeleteItemDialog() {
|
||||
if (await window.confirmDialog({title: "删除", content: "确定删除吗?"}) === false) {
|
||||
throw new Error("[confirmDeleteItemDialog] 否");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
async doDeleteItem({item}) {
|
||||
const {id} = item;
|
||||
await window.vtoast.loading("删除数据");
|
||||
await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'taskManagement',
|
||||
actionId: 'deleteItem',
|
||||
actionData: {},
|
||||
where: {id: id}
|
||||
}
|
||||
}
|
||||
});
|
||||
await window.vtoast.success("删除数据成功");
|
||||
},
|
||||
// 跳转
|
||||
toTaskHistory({item}) {
|
||||
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user