更新版本-参照 jinnang-v1

This commit is contained in:
case committed 2022-11-03 23:38:50 +08:00
1 parent 0ace3ac506
commit c9c16e9d26
17 files changed
+2675 -1144

No files matched your search

+31 -45
View File
@@ -3,7 +3,6 @@
{% block vue_template %}
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center" :class="{'pa-0': isMobile, 'pa-2': !isMobile}" style="justify-content: end">
<v-col cols="12" sm="12" xs="5" md="3" xl="2" class="pb-3" :class="{'pl-0': isMobile, 'pt-0': isMobile}">
@@ -20,29 +19,29 @@
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<v-card :class="{'px-2': isMobile}">
<v-data-table :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 color="success" class="mr-2" @click="doUiAction('startCreateItem', {item: item})">
申请
</v-btn>
</template>
</v-data-table>
</v-card>
<v-card :class="{'px-2': isMobile}">
<v-data-table
: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 color="success" class="mr-2" @click="doUiAction('startCreateItem', {item: item})">
申请
</v-btn>
</template>
</v-data-table>
</v-card>
<!-- 编辑抽屉 -->
<v-navigation-drawer v-model="isEditDrawerShow" :permanent="isEditDrawerShow" fixed temporary right width="40%"
@@ -58,8 +57,8 @@
<v-row :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
<v-col cols="12" sm="12" md="12" :class="{'pa-0': isMobile, 'px-3': isMobile, 'pt-6': isMobile}">
<span class="inputLabel">任务标题</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="任务标题" v-model="editItem['taskTitle']">
<span class="inputLabel">课程标题</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="课程标题" v-model="editItem['taskTitle']">
</v-text-field>
</v-col>
@@ -95,7 +94,6 @@
</v-row>
</v-form>
</v-navigation-drawer>
</jh-layout-v3>
{% endblock %}
@@ -114,10 +112,6 @@
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
categoryList: [],
},
serverSearchInput: {
workflowName: null
},
@@ -126,24 +120,17 @@
isTableLoading: true,
tableDataFromBackend: [],
headers: [
{ text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed' },
{ text: "任务ID", value: "workflowId", width: 120 },
{ text: "任务名称", value: "workflowName", width: 120 },
{ text: "任务分类ID", value: "workflowCategory", width: 120 },
{ text: "任务节点", value: "workflowConfig", width: 120 },
{ text: "ID", value: "id", width: 100, class: 'fixed', cellClass: 'fixed' },
{ text: "课程ID", value: "workflowId", width: 120 },
{ text: "课程名称", value: "workflowName", width: 150 },
{ text: "课程分类ID", value: "workflowCategory", width: 120 },
{ text: "备注", value: "workflowRemark", 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' },
],
currentClickButton: { title: '新增', action: 'add' },
editItem: {},
tplItem: {},
tableButtonList: [
{ text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem' },
{ text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem' },
],
dialogSaveInfoAction: ''
}),
async created() {
@@ -157,7 +144,7 @@
await this.refreshTableData(uiActionData);
break;
case 'startCreateItem':
await this.clearItemData(uiActionData);
await this.preprocessItemData(uiActionData);
await this.openCreateItemDialog(uiActionData);
break;
case 'createItem':
@@ -177,7 +164,7 @@
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
const { rows } = (await window.jianghuAxios({
const { data: { appData: { resultData: {rows} } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskCreateManagement',
@@ -188,19 +175,19 @@
orderBy: [{ column: 'operationAt', order: 'desc' }]
}
}
})).data.appData.resultData;
});
rows.forEach(row => {
if(row.workflowConfig) {
row.workflowConfig = JSON.parse(row.workflowConfig).nodeList.map(item => [item.label, item.lineTypeList]);
row.workflowForm = JSON.parse(row.workflowForm || '[]');
}
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
})
this.tableDataFromBackend = rows;
this.isTableLoading = false;
},
// startCreateItem
clearItemData({item: { workflowForm, workflowConfig, workflowId }}) {
preprocessItemData({item: { workflowForm, workflowConfig, workflowId }}) {
const workflowFormData = {};
workflowForm.forEach(e => {
workflowFormData[e.id] = '';
@@ -217,7 +204,6 @@
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
throw new Error("[confirmCreateFormDialog] 否");
+173 -129
View File
@@ -5,110 +5,136 @@
<jh-layout-v3>
<!-- 页面主要内容 -->
<v-card :class="{'px-2': isMobile}">
<v-stepper v-model="step" class="mb-4 elevation-0 pa-0 ma-0 pt-4" :class="{'px-10': !isMobile, 'px-3': isMobile}">
<v-stepper-header class="elevation-0 pa-0 ma-0">
<template v-for="(item, index) in taskStepperList">
<v-divider v-if="index > 0" class="mx-1"></v-divider>
<v-stepper-step :complete="step > item.value" :step="item.value" class="pa-4" color="success">
{{ item.text }}
</v-stepper-step>
</template>
</v-stepper-header>
</v-stepper>
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}"><v-subheader>表单信息</v-subheader></v-row>
<v-card :class="{'px-2': isMobile}" class="pb-10 mb-10">
<!-- <v-row class="pa-0 ma-0 pt-8" :class="{'px-10': !isMobile, 'px-3': isMobile}">
<v-col cols="12 d-flex align-center" style="justify-content: space-between;">
<template v-for="(item, index) in taskStepperList">
<div>
<div v-for="e in item" class="d-flex align-center ">
<v-icon v-if="e.type === 'history' && e.id !== currentNode.id" color="primary">mdi-check-circle</v-icon>
<v-icon v-else-if="e.id === currentNode.id" color="primary">mdi-send-circle</v-icon>
<v-icon v-else >mdi-circle</v-icon>
{{e.text}}
</div>
</div>
<v-divider class="mx-8" v-if="index < (taskStepperList.length - 1)"></v-divider>
</template>
</v-col>
</v-row> -->
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}">
<v-col :cols="taskTpl.prev ? 6 : 12" v-for="(key, i) in ['prev', 'input']" :key="i"
v-if="isAccess && taskTpl[key]">
<v-col cols="6">
<v-subheader>流程预览</v-subheader>
<process-flow
v-if="taskHistoryConfigList"
:data="taskHistoryConfigList"
:current-node-id="currentNode.id"
readonly
style="height: 450px;border: 1px solid rgb(240, 240, 240); border-radius: 6px;">
</process-flow>
</v-col>
<v-col cols="6" v-if="isAccess">
<v-subheader>表单信息</v-subheader>
<v-row>
<v-col cols="12" class=" pb-3" v-for="(formItem, index) in taskTpl.formList" :key="index"
v-if="taskTpl[key] && !(currentNode.formIdHidden || []).includes(formItem.id)">
<!-- <v-subheader inset > {{ key === 'prev' ? '历史表单' : '当前' }} </v-subheader> -->
v-if="taskTpl.input && !(currentNode.formIdHidden || []).includes(formItem.id)">
<span class="inputLabel">{{formItem.component.outline}}</span>
<template v-if="formItem.component.type === 'singleSelect'">
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, 'input') }}
</v-list-item-title>
<v-radio-group v-model="taskTpl[key][formItem.id]">
<v-radio-group v-model="taskTpl.input[formItem.id]">
<v-radio hide-details v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
:key="optionIndex"
:label="option.value"></v-radio>
:disabled="!(currentNode.formId || []).includes(formItem.id)"
:key="optionIndex"></v-radio>
</v-radio-group>
</template>
<template v-if="formItem.component.type === 'multipleSelect'">
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, 'input') }}
</v-list-item-title>
<div v-for="(option, optionIndex) in formItem.component.property.selectOptionList" :key="optionIndex">
<v-checkbox style="margin-top: 0px;"
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
:label="option.value" :value="option.value"
v-model="taskTpl[key][formItem.id]" hide-details
:disabled="!(currentNode.formId || []).includes(formItem.id)"
:value="option.value"
v-model="taskTpl.input[formItem.id]" hide-details
color="red"></v-checkbox>
</div>
</template>
<template v-if="formItem.component.type === 'textarea'">
<v-textarea hide-details dense outlined placeholder="请输入"
:label="formTitlePrefix(formItem.component.outline, key)"
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
v-model="taskTpl[key][formItem.id]" :rows="4"/>
<v-textarea hide-details dense filled single-line placeholder="请输入"
:disabled="!(currentNode.formId || []).includes(formItem.id)"
v-model="taskTpl.input[formItem.id]" :rows="4"/>
</template>
<template v-if="formItem.component.type === 'input'">
<v-text-field class="cus-v-input" placeholder="请输入" dense outlined
:label="formTitlePrefix(formItem.component.outline, key)"
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
v-model="taskTpl[key][formItem.id]"></v-text-field>
<v-text-field class="cus-v-input" placeholder="请输入" dense filled single-line
:disabled="!(currentNode.formId || []).includes(formItem.id)"
v-model="taskTpl.input[formItem.id]"></v-text-field>
</template>
</v-col>
<v-col cols="12" v-if="isAccess">
<span class="inputLabel">备注信息</span>
<v-textarea dense filled single-line placeholder="请输入备注信息" hide-details v-model="editItem.taskComment" color="success"
:disabled="currentNode && currentNode.id && currentNode.id.includes('end-')" :rows="4"/>
</v-col>
<v-col v-if="isAccess" cols="12" style="text-align: center;" class="mb-3">
<v-btn color="success" class="mx-4" v-for="item in nextLineList" @click="doUiAction('submitNode', item.type)">
{{ item.type }}
</v-btn>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}" v-if="isAccess">
<v-col cols="12">
<v-textarea dense outlined placeholder="请输入备注信息" hide-details v-model="editItem.taskComment" color="success"
:disabled="currentNode && currentNode.id && currentNode.id.includes('end-')" :rows="4"/>
</v-col>
<v-col cols="12" style="text-align: center;" class="mb-3">
<v-btn color="success" class="mx-4" v-for="item in nextLineList" @click="doUiAction('submitNode', item.type)">
{{ item.type }}-{{ item.label }}
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}">
</v-row>
<v-card-text class="pl-10">
课程流转历史
</v-card-text>
<v-data-table fixed-header dense
:headers="headers"
:items="taskHistoryList"
:items-per-page="-1"
mobile-breakpoint="0"
:loading="isTableLoading"
checkbox-color="success"
:class="{'mx-2': isMobile}"
color="success"
hide-default-footer
class="elevation-0 mx-10 flex-fill d-flex flex-column">
<template v-slot:item.taskCostDuration="{ item }">
{{timeFormat(item.taskCostDuration)}}
</template>
<template v-slot:item.action="{ item }">
<v-btn small class="mr-2" @click="viewInput({item})">
查看
</v-btn>
</v-col>
</v-row>
<v-list three-line subheader class="pb-10" :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
<v-subheader>任务流转历史</v-subheader>
<v-divider></v-divider>
<div class="pa-2">
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
<th class="text-left">
节点
</th>
<th class="text-left">
流转
</th>
<th class="text-left">
处理人
</th>
<th class="text-left">
时长
</th>
</tr>
</thead>
<tbody>
<tr v-for="item in taskHistoryList" :key="item.name">
<td>{{ item.taskExplain }}</td>
<td>{{ item.taskLineLabel }}</td>
<td>{{ item.operationByUser }}</td>
<td>{{ item.taskCostDuration }}秒</td>
</tr>
</tbody>
</template>
</v-simple-table>
</div>
</v-list>
</template>
</v-data-table>
<v-dialog
v-model="dialog"
max-width="500px"
>
<v-card>
<v-card-title>
<span class="text-h5"></span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12" sm="12" md="12" v-for="(item, index) in editItem.formList" >
<span>{{item.component.outline}}:</span><span>{{editItem.input[item.id]}}</span>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</v-card>
</jh-layout-v3>
@@ -116,6 +142,11 @@
{% block vue_body %}
{% include 'component/flow/processFlow.html' %}
{% include 'component/flow/flowNode.html' %}
{% include 'component/flow/editFlow.html' %}
{% include 'component/flow/editLine.html' %}
{% include 'component/flow/editNode.html' %}
<script type="module">
new Vue({
el: '#app',
@@ -123,47 +154,18 @@ new Vue({
vuetify: new Vuetify(),
data: () => ({
isMobile: window.innerWidth < 600,
step: 1,
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
categoryList: [],
},
serverSearchInput: {
processName: null
},
isEditDrawerShow: false,
searchInput: null,
dialog: false,
isTableLoading: true,
headers: [
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
{text: "任务ID", value: "taskId", width: 120},
{text: "流程节点版本ID", value: "processVersionId", width: 120},
{text: "任务名称", value: "taskTitle", width: 120},
{text: "任务状态:running 执行中;deny 拒绝;end 结束", value: "taskStatus", width: 120},
{text: "当前执行中节点", value: "taskCurrentNode", width: 120},
{text: "申请人", value: "taskApplier", width: 120},
{text: "当前执行的处理人员,用逗号分隔", value: "taskProcessorList", width: 120},
{text: "所有相关人员,用逗号分隔", value: "taskRelatedPersonList", width: 120},
{text: "催单次数", value: "taskUrgeCount", width: 120},
{text: "最后催单时间", value: "taskUrgeLastTime", 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'},
{text: "节点", value: "taskExplain", width: 120},
{text: "流转", value: "taskHandleDesc", width: 120},
{text: "课程名称", value: "operationByUser", width: 120},
{text: "备注", value: "taskComment", width: 120},
{text: "处理时长/秒", value: "taskCostDuration", width: 120},
{text: "表单明细", value: "action", width: 120},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: '',
taskId: '',
isAccess: [],
@@ -171,12 +173,13 @@ new Vue({
taskHistoryList: [],
taskTpl: [],
taskStepperList: [],
currentNode: {}
currentNode: {},
taskHistoryConfigList: null
}),
watch: {},
async created() {
const searchParams = new URLSearchParams(location.search.substring(1));
this.taskId = searchParams.get('taskId');
this.taskId = searchParams.get('id');
await this.getTaskHistoryList()
},
mounted() {
@@ -186,7 +189,7 @@ new Vue({
switch (uiActionId) {
case 'submitNode':
await this.submitNode(uiActionData);
await this.getTaskHistoryList(uiActionData);
// await this.getTaskHistoryList(uiActionData);
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });
@@ -198,30 +201,41 @@ new Vue({
* 获取表格数据
*/
async getTaskHistoryList() {
this.isTableLoading = true;
const {
taskHistoryList,
taskStepperList,
taskTpl,
isAccess,
nextLineList,
step,
currentNode
} = (await window.jianghuAxios({
data: {
appData: {
resultData: {
taskHistoryList,
taskStepperList,
taskTpl,
isAccess,
nextLineList,
currentNode,
taskHistoryConfigList
}
}
}
} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskHistoryManagement',
actionId: 'getTaskHistoryInfo',
actionData: {taskId: this.taskId},
actionData: {id: this.taskId},
}
}
})).data.appData.resultData;
});
taskHistoryList.forEach(e => {
e.taskFormInput = JSON.parse(e.taskFormInput);
})
this.taskHistoryList = taskHistoryList;
this.taskTpl = taskTpl;
this.taskStepperList = taskStepperList;
this.currentNode = currentNode;
this.isAccess = isAccess;
this.nextLineList = nextLineList;
this.step = step;
this.nextLineList = _.uniqBy(nextLineList, 'type') ;
this.taskHistoryConfigList = taskHistoryConfigList;
this.isTableLoading = false;
},
/**
@@ -234,11 +248,18 @@ new Vue({
appData: {
pageId: 'taskHistoryManagement',
actionId: 'submitNode',
actionData: {type, taskId: this.taskId, taskComment: this.editItem.taskComment, taskTpl: this.taskTpl}
actionData: {type, id: this.taskId, taskComment: this.editItem.taskComment, taskTpl: this.taskTpl}
}
}
})
await window.vtoast.success("提交数据成功");
setTimeout(function() {
if (document.referrer) {
location.href = document.referrer;
} else {
history.back();
}
}, 1000);
},
formTitlePrefix(title, type) {
@@ -246,11 +267,34 @@ new Vue({
return '历史-' + title;
}
return title;
},
viewInput({item}) {
this.editItem = item.taskFormInput;
this.dialog = true;
},
timeFormat(time) {
if (time == 0) {
return ''
} else if (time < 60) {
return time + ' 秒';
} else if (time < 3600) {
const s = time % 60;
return parseInt(time / 60) + ' 分' + s + ' 秒';
} else if (time < 86400) {
const m = time % 3600;
return parseInt(time / 3600) + ' 小时' + parseInt(m / 60) + ' 分';
} else {
const m = time % 86400;
return parseInt(time / 86400) + ' 天' + parseInt(m / 3600) + ' 小时';
}
}
}
})
</script>
<style scoped>
.v-data-table--dense>.v-data-table__wrapper>table>tbody>tr>td, .v-data-table--dense>.v-data-table__wrapper>table>tbody>tr>th, .v-data-table--dense>.v-data-table__wrapper>table>tfoot>tr>td, .v-data-table--dense>.v-data-table__wrapper>table>tfoot>tr>th, .v-data-table--dense>.v-data-table__wrapper>table>thead>tr>td, .v-data-table--dense>.v-data-table__wrapper>table>thead>tr>th {
height: 32px;
}
</style>
{% endblock %}
+44 -46
View File
@@ -3,41 +3,38 @@
{% 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 :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 color="success" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
<!-- 页面主要内容 -->
<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
: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 color="success" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
</jh-layout-v3>
{% endblock %}
@@ -61,16 +58,14 @@ new Vue({
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: "课程ID", value: "taskId", width: 120},
{text: "课程名称", value: "taskTitle", width: 120},
{text: "课程状态", value: "taskStatus", width: 120},
{text: "当前节点ID", value: "taskConfigId", width: 200},
{text: "申请人", value: "taskInitUser", width: 120},
{text: "当前执行的处理人员,用逗号分隔", value: "taskEditUserList", width: 120},
{text: "处理人员", value: "taskEditUserList", width: 120},
{text: "所有相关人员,用逗号分隔", value: "taskViewUserList", width: 120},
{text: "备注", value: "taskComment", width: 120},
{text: "任务创建人", value: "createByUser", 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'},
@@ -101,7 +96,7 @@ new Vue({
*/
async refreshTableData() {
this.isTableLoading = true;
const result = await window.jianghuAxios({
const {data: {appData: {resultData: {rows}}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskICreateManagement',
@@ -113,12 +108,15 @@ new Vue({
}
});
this.tableDataFromBackend = result.data.appData.resultData.rows;
rows.forEach(row => {
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
})
this.tableDataFromBackend = rows;
this.isTableLoading = false;
},
toTaskHistory({item}) {
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?id=${item.id}`;
}
}
})
-176
View File
@@ -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 %}
-129
View File
@@ -1,129 +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}"
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: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
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'},
],
}),
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {
},
methods: {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'refreshTableData':
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: 'taskICreateManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
});
this.tableDataFromBackend = result.data.appData.resultData.rows;
this.isTableLoading = false;
},
toTaskHistory({item}) {
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
</script>
<style scoped>
</style>
{% endblock %}
-132
View File
@@ -1,132 +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 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: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
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'},
],
}),
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {
},
methods: {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'refreshTableData':
await this.refreshTableData(uiActionData);
break;
case 'toTaskHistory':
await this.toTaskHistory(uiActionData);
break;
default:
console.error("[doAction] uiActionId not find", { uiActionId });
break;
}
},
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskUpcomingManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
});
this.tableDataFromBackend = result.data.appData.resultData.rows;
this.isTableLoading = false;
},
toTaskHistory({item}) {
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
</script>
<style scoped>
</style>
{% endblock %}
+60 -72
View File
@@ -2,51 +2,50 @@
{% block vue_template %}
<jh-layout-v3>
<template slot="serverSearch">
<div class="mt-4" style="text-align: right;">
<v-btn color="success" @click="doUiAction(dialogSaveInfoAction)" style="height: 40px">
保存
</v-btn>
</div>
</template>
<template slot-scope="props">
<v-card class="mt-3 mb-12" :class="{'pa-8': !props.ismobile, 'pa-4': props.ismobile}">
<v-row>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="流程名:" v-model="editItem['workflowName']" :rules="requireRules">
</v-text-field>
</v-col>
<template slot="serverSearch">
<div class="mt-4" style="text-align: right;">
<v-btn color="success" @click="doUiAction(dialogSaveInfoAction)" style="height: 40px">
保存
</v-btn>
</div>
</template>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="分类:" v-model="editItem['workflowCategory']" :rules="requireRules">
</v-text-field>
</v-col>
<template slot-scope="props">
<v-card class="mt-3 mb-12" :class="{'pa-8': !props.ismobile, 'pa-4': props.ismobile}">
<v-row>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="流程名:" v-model="editItem['workflowName']" :rules="requireRules">
</v-text-field>
</v-col>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="分类:" v-model="editItem['workflowCategory']" :rules="requireRules">
</v-text-field>
</v-col>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="备注:"
v-model="editItem['workflowRemark']">
</v-text-field>
</v-col>
</v-row>
</v-card>
<v-col cols="12" sm="12" md="3" xl="3" class=" pb-3">
<v-text-field class="cus-v-input mr-2" dense filled single-line color="success" prefix="备注:"
v-model="editItem['workflowRemark']">
</v-text-field>
</v-col>
</v-row>
</v-card>
<div class=" pb-4" style="font-size: 18px; font-weight: bold">模板设置</div>
<div class=" pb-4" style="font-size: 18px; font-weight: bold">模板设置</div>
<tpl-form-design :form="editItem.workflowForm" v-if="!loading">
</tpl-form-design>
<div class="pt-8 pb-4" style="font-size: 18px; font-weight: bold">流程设置</div>
<process-flow v-if="!loading" :data="editItem.workflowConfig" :user="constantCollection.userList"
:group="constantCollection.groupList" :tpl="constantCollection.workflowFormList">
</process-flow>
<v-overlay :value="loading" absolute>
<v-progress-circular
indeterminate
size="64"
></v-progress-circular>
</v-overlay>
</template>
<v-overlay :value="loading" absolute>
<v-progress-circular
indeterminate
size="64"
></v-progress-circular>
</v-overlay>
</template>
</jh-layout-v3>
{% endblock %}
@@ -67,8 +66,6 @@ new Vue({
template: '#app-template',
vuetify: new Vuetify(),
data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
@@ -77,10 +74,8 @@ new Vue({
groupList: [],
workflowFormList: []
},
editItem: {},
dialogSaveInfoAction: 'createItem',
dialog: false,
loading: false,
}),
watch: {
@@ -127,17 +122,19 @@ new Vue({
break;
}
},
buildEditItem() {
const item = {
workflowId: this.editItem.workflowId || null,
workflowName: this.editItem.workflowName,
workflowRemark: this.editItem.workflowRemark,
workflowCategory: this.editItem.workflowCategory,
workflowConfig: this.editItem.workflowConfig ? JSON.stringify(this.editItem.workflowConfig) : null,
workflowForm: this.editItem.workflowForm ? JSON.stringify(this.editItem.workflowForm) : null,
const { id, workflowId, workflowName, workflowRemark, workflowCategory, workflowConfig, workflowForm } = this.editItem;
let item = {
workflowName,
workflowRemark,
workflowCategory,
workflowId: workflowId || null,
workflowConfig: workflowConfig ? JSON.stringify(workflowConfig) : null,
workflowForm: workflowForm ? JSON.stringify(workflowForm) : null,
}
if (this.editItem.id) {
item.id = this.editItem.id;
if (id) {
item.id = id;
}
return item;
},
@@ -167,10 +164,10 @@ new Vue({
},
/**
* 获取表格数据
* 获取user数据
*/
async getUserList() {
const { rows } = (await window.jianghuAxios({
const {data: {appData: {resultData: {rows}}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
@@ -179,16 +176,16 @@ new Vue({
where: {},
}
}
})).data.appData.resultData;
});
this.constantCollection.userList = rows.map(e => {
return {text: e.username, value: e.userId}
})
},
/**
* 获取表格数据
* 获取group数据
*/
async getGroupList() {
const { rows } = (await window.jianghuAxios({
const {data: {appData: {resultData: {rows}}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
@@ -197,23 +194,21 @@ new Vue({
where: {},
}
}
})).data.appData.resultData;
});
this.constantCollection.groupList = rows.map(e => {
return {text: e.groupName, value: e.groupId}
});
},
// startCreateItem
async clearItemData() {
this.dialogSaveInfoAction = 'createItem';
this.editItem = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}};
},
async syncEditItem() {
const _this = this;
this.loading = true;
this.dialogSaveInfoAction = 'updateItem';
const { rows } = (await window.jianghuAxios({
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
@@ -221,7 +216,7 @@ new Vue({
where: {id: this.editItem.id},
}
}
})).data.appData.resultData;
});
if (!rows.length) {
this.clearItemData();
} else {
@@ -230,12 +225,11 @@ new Vue({
item.workflowForm = item.workflowForm ? JSON.parse(item.workflowForm) : [];
this.editItem = item;
}
setTimeout(function() {
_this.loading = false;
setTimeout(() => {
this.loading = false;
}, 500)
},
// createItem
async confirmCreateItemDialog() {
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
throw new Error("[confirmCreateFormDialog] 否");
@@ -249,7 +243,7 @@ new Vue({
delete this.editItem.id;
const item = this.buildEditItem();
await window.vtoast.loading("新增数据");
const { rows } = (await window.jianghuAxios({
const { data: { appData: { resultData: { rows } } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
@@ -257,13 +251,12 @@ new Vue({
actionData: item
}
}
})).data.appData.resultData;
})
this.editItem.id = rows[0];
history.pushState({}, '', `?id=${rows[0]}`);
await window.vtoast.success("新增数据成功");
},
// updateItem
async confirmUpdateItemDialog() {
if (await window.confirmDialog({title: "修改", content: "确定修改吗?"}) === false) {
throw new Error("[confirmUpdateItemDialog] 否");
@@ -271,7 +264,7 @@ new Vue({
},
/**
* 保存数据
* 修改数据
*/
async doUpdateItem() {
const {id, ...item} = this.buildEditItem();
@@ -293,11 +286,6 @@ new Vue({
</script>
<style scoped>
.v-dialog--fullscreen .v-sheet {
height: unset;
top: unset;
position: unset;
background: white;
}
</style>
{% endblock %}
+40 -63
View File
@@ -3,41 +3,41 @@
{% 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-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="12" sm="4" md="4" xl="4" class="pl-0">
<v-btn color="success" dark class="elevation-0 mr-2" @click="doUiAction('createItem')">新增</v-btn>
<span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col>
<v-spacer></v-spacer>
<v-col cols="12" xs="12" 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-col cols="12" xs="12" sm="4" md="4" xl="4" class="pl-0">
<v-btn color="success" dark class="elevation-0 mr-2" @click="doUiAction('createItem')">新增</v-btn>
<span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col>
<v-spacer></v-spacer>
<v-col cols="12" xs="12" 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>
<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 %}
@@ -51,38 +51,23 @@ new Vue({
vuetify: new Vuetify(),
data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据
requireRules: [
v => !!v || 'This is required',
],
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: "workflowId", width: 120},
{text: "流程名", value: "workflowName", width: 120},
{text: "流程名", value: "workflowName", width: 200},
{text: "分类ID", value: "workflowCategory", width: 120},
{text: "备注", value: "workFlowRemark", width: 120},
{text: "操作者", value: "operationByUser", width: 120},
{text: "操作时间", value: "operationAt", width: 250},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 160, class: 'fixed', cellClass: 'fixed'},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '编辑', buttonType: 'edit', color: 'success', action: 'updateItem'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: '',
dialog: false,
]
}),
async created() {
await this.doUiAction('refreshTableData');
@@ -118,22 +103,19 @@ new Vue({
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
const { rows } = (await window.jianghuAxios({
const {data: {appData: {resultData: {rows}}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
})).data.appData.resultData;
});
for (const item of rows) {
item.workflowConfig = item.workflowConfig ? JSON.parse(item.workflowConfig) : null;
item.workflowForm = item.workflowForm ? JSON.parse(item.workflowForm) : [];
item.operationAt = dayjs(item.operationAt).format('YYYY-MM-DD HH:mm:ss');
}
this.tableDataFromBackend = rows;
this.isTableLoading = false;
@@ -186,11 +168,6 @@ new Vue({
</script>
<style scoped>
.v-dialog--fullscreen .v-sheet {
height: unset;
top: unset;
position: unset;
background: white;
}
</style>
{% endblock %}