更新版本-参照 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

+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 %}