新版UI适配

This commit is contained in:
yuebenshan committed 2022-08-04 22:22:33 +08:00
1 parent 55dfcee93e
commit 73d6daacc7
17 files changed
+1542 -1991

No files matched your search

+16 -8
View File
@@ -11,17 +11,20 @@
<el-input v-model="flowData.Remark" type="textarea" :autosize="{ minRows: 2, maxRows: 4}"></el-input>
</el-form-item>
</el-form> -->
<v-form v-model="isFormValid" ref="dataForm" lazy-validation>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="GUID" v-model="flowData.Id"></v-text-field>
<v-row class="px-2" :class="{'pb-7': isMobile}">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">GUID</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="GUID" v-model="flowData.Id"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="流程名称" v-model="flowData.Name"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">流程名称</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="流程名称" v-model="flowData.Name"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="备注" v-model="flowData.Remark"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">备注</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="备注" v-model="flowData.Remark"></v-text-field>
</v-col>
</v-row>
</v-form>
@@ -38,6 +41,11 @@
isFormValid: true
}
},
computed: {
isMobile() {
return window.innerWidth < 600;
},
},
methods: {
init(data) {
this.flowData = data;
+31 -18
View File
@@ -16,36 +16,44 @@
<el-input v-model="line.Remark" type="textarea" :autosize="{ minRows: 2, maxRows: 4}"></el-input>
</el-form-item>
</el-form> -->
<v-form v-model="isFormValid" ref="dataForm" lazy-validation>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="GUID" v-model="line.id"></v-text-field>
<v-row class="px-2" :class="{'pb-7': isMobile}">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">GUID</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="GUID" v-model="line.id"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined disabled label="源活动" v-model="line.from"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">源活动</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line disabled label="源活动" v-model="line.from"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined disabled label="目标活动" v-model="line.to"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">目标活动</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line disabled label="目标活动" v-model="line.to"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="名称" v-model="line.label"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="名称" v-model="line.label"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">操作类型</span>
<v-select
:items="lineTypeList"
dense outlined
dense filled single-line
class="cus-v-input mr-2"
label="操作类型"
outlined
color="success"
item-color="success"
v-model="line.type"
></v-select>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务Resource" v-model="line.hook"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">任务Resource</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="任务Resource" v-model="line.hook"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="备注说明" v-model="line.Remark"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">备注说明</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="备注说明" v-model="line.Remark"></v-text-field>
</v-col>
</v-row>
</v-form>
@@ -74,6 +82,11 @@
deep: true
}
},
computed: {
isMobile() {
return window.innerWidth < 600;
},
},
methods: {
init(item, lineTypeList) {
this.isUpdate = false;
@@ -85,4 +98,4 @@
},
}
})
</script>
</script>
+40 -23
View File
@@ -19,34 +19,42 @@
</el-form> -->
<v-form v-model="isFormValid" ref="dataForm" lazy-validation>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input" dense outlined label="GUID" v-model="node.id"></v-text-field>
<v-row class="px-2" :class="{'pb-7': isMobile}">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">GUID</span>
<v-text-field class="cus-v-input" dense filled single-line label="GUID" v-model="node.id"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input" dense outlined label="名称" v-model="node.label"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-text-field class="cus-v-input" dense filled single-line label="名称" v-model="node.label"></v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input" dense outlined label="备注说明" v-model="node.Remark"></v-text-field>
<v-col cols="12" class=" pb-3">
<span class="inputLabel">备注说明</span>
<v-text-field class="cus-v-input" dense filled single-line label="备注说明" v-model="node.Remark"></v-text-field>
</v-col>
<v-col cols="12" v-if="showTask" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-select
:items="assignTypeList"
dense outlined
dense filled single-line
item-text="text"
color="success"
item-color="success"
item-value="value"
class="cus-v-input"
label="指派类型"
outlined
v-model="node.assignType"
></v-select>
</v-col>
<v-col cols="12" v-if="showTask" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-select
:items="optionList"
dense outlined
color="success"
item-color="success"
dense filled single-line
item-text="text"
item-value="value"
class="cus-v-input"
@@ -56,22 +64,26 @@
:disabled="!node.assignType"
></v-select>
</v-col>
<v-col cols="12" v-if="showTask" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<!-- <v-textarea
outlined
filled single-line
name="input-7-4"
label="允许的操作"
value=""
rows="3"
hide-details
></v-textarea> -->
<v-text-field class="cus-v-input" dense outlined label="允许的操作(英文逗号分隔)" v-model="node.lineTypeList"></v-text-field>
<v-text-field class="cus-v-input" dense filled single-line label="允许的操作(英文逗号分隔)" v-model="node.lineTypeList"></v-text-field>
</v-col>
<v-col cols="12" v-if="showTask" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-select
:items="tpl"
dense outlined
dense filled single-line
item-text="text"
color="success"
item-color="success"
item-value="value"
class="cus-v-input"
label="可写模板"
@@ -79,12 +91,15 @@
v-model="node.formId"
></v-select>
</v-col>
<v-col cols="12" v-if="showTask" class="pa-xs-0 pb-xs-4 pb-3">
<v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span>
<v-select
:items="tpl"
dense outlined
dense filled single-line
item-text="text"
item-value="value"
color="success"
item-color="success"
class="cus-v-input"
label="隐藏模板"
multiple
@@ -134,8 +149,10 @@
},
watch: {
},
created() {},
computed: {
isMobile() {
return window.innerWidth < 600;
},
showTask() {
return ['userTask', 'receiveTask'].includes(this.node.type);
},
@@ -182,4 +199,4 @@
.v-textarea textarea {
line-height: 1.2rem;
}
</style>
</style>
+4 -1
View File
@@ -31,6 +31,9 @@
}
},
computed: {
isMobile() {
return window.innerWidth < 600;
},
// 节点容器样式
flowNodeContainer: {
get() {
@@ -140,4 +143,4 @@
opacity: 0;
cursor: crosshair;
}
</style>
</style>
+41 -27
View File
@@ -1,35 +1,52 @@
<template id="process-flow">
<div class="process-flow-container">
<div class="flow-menu">
<div class="menu-item" v-for="item in menuList" draggable="true" @dragstart="drag(item)">
<v-card class="flow-menu pa-4 mr-4" color="#f5f8fa" width="140px">
<div block color="white" class="menu-item mb-3" v-for="item in menuList" draggable="true" @dragstart="drag(item)">
<i :class="item.icon"></i>
<div>{{item.name}}</div>
</div>
<hr>
<div class="menu-item" @click="isConnect=true">
<v-divider></v-divider>
<v-btn block class="menu-item mt-3" :color="isConnect ? 'success' : 'white'" @click="isConnect=true">
<i class="el-icon-bottom-right"></i>
<div>连线</div>
</div>
<div class="menu-item" @click="isConnect=false">
</v-btn>
<v-btn block class="menu-item" :color="!isConnect ? 'success' : 'white'" @click="isConnect=false">
<i class="el-icon-rank"></i>
<div>选择</div>
</div>
</v-btn>
</div>
<div class="flow-detail">
</v-card>
<v-card class="flow-detail pa-4 mr-4" color="#f5f8fa">
<div id="flowContent" ref="flowContent" @drop="drop($event)" @dragover="allowDrop($event)" @click="editFlow()"
@dblclick="isConnect=false">
<flow-node v-for="node in data.nodeList" :key="node.id" :node="node" :id="node.id" :isconnect="isConnect"
@delete-node="deleteNode" @change-node-site="changeNodeSite" @edit-node="editNode">
</flow-node>
</div>
</div>
<div class="flow-edit" v-if="editType">
<div class="flow-edit-content">
<edit-node ref="nodeForm" v-show="editType=='node'" :user="user" :group="group" :tpl="tpl"></edit-node>
<edit-line ref="lineForm" v-show="editType=='line'" @line-save="lineLabelSave"></edit-line>
</div>
</div>
</v-card>
<v-card class="flow-edit pa-4" v-if="editType" color="#f5f8fa">
<template v-if="editType=='node' || editType=='line'">
<div class="mb-3">
<v-icon>mdi-application-edit-outline</v-icon>
<span style="transform: translateY(2px); display: inline-block; ">{{editType=='node' ? '节点' : '连线'}}属性</span>
</div>
<v-card>
<div class="flow-edit-content">
<edit-node ref="nodeForm" v-show="editType=='node'" :user="user" :group="group" :tpl="tpl"></edit-node>
<edit-line ref="lineForm" v-show="editType=='line'" @line-save="lineLabelSave"></edit-line>
</div>
</v-card>
</template>
<template v-else>
<div class="mb-3">
<v-icon>mdi-application-edit-outline</v-icon>
<span style="transform: translateY(2px); display: inline-block; ">属性面板</span>
</div>
<div style="text-align: center;line-height: 100px; color: #999999">
请选择节点或连接线
</div>
</template>
</v-card>
</div>
</template>
@@ -249,7 +266,7 @@
_this.jsPlumb.importDefaults(_this.jsplumbSetting)
// 会使整个jsPlumb立即重绘。
_this.jsPlumb.setSuspendDrawing(false, true);
// 初始化节点
_this.loadEasyFlow()
@@ -466,12 +483,12 @@
if (!lineTypeList.includes(item.type) ) {
// 1 - 删除画布连线 | 2 - 清空line的操作属性
// _this.jsPlumb.deleteConnection(conn)
// 从 lineList 数组移除
// _this.data.lineList.splice(index,1);
// 不渲染表单
// return
// 默认修改类型为第一个
if (!preNode.id.includes('start-')) {
if (add) {
@@ -591,10 +608,7 @@
.flow-menu {
width: 100px;
padding: 10px;
margin: 0 10px;
border: 1px solid #EBEEF5;
padding: 12px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
word-break: break-all;
border-radius: 4px;
@@ -602,14 +616,17 @@
.menu-item {
text-align: center;
box-shadow: 0 0 4px #696969;
margin-bottom: 8px;
cursor: pointer;
font-size: 14px;
color: #606266;
background: #FFFFFF;
padding: 5px 0;
border-radius: 5px;
}
.menu-item:hover {
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.menu-item>i {
font-size: 30px;
@@ -626,14 +643,11 @@
.flow-edit-content {
min-height: 100%;
background: #FFF;
color: #606266;
line-height: 1.4;
text-align: justify;
font-size: 14px;
border: 1px solid #EBEEF5;
padding: 12px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
word-break: break-all;
border-radius: 4px;
}
@@ -650,4 +664,4 @@
.csslabel .label-text {
background-color: white;
}
</style>
</style>
+291 -212
View File
@@ -1,121 +1,134 @@
<template id="form-item-list-generator">
<div class="d-flex form-item-list-generator-content">
<div class="componentList">
<div class="left-component-item-title">
<v-card :class="{'d-flex': !isMobile, 'form-item-list-generator-content': !isMobile}">
<v-card color="#f5f8fa" :style="{'width': isMobile ? '100%' : '300px'}"
:class="{'pa-4': !isMobile, 'pa-2': isMobile, 'mr-6': !isMobile}">
<div class="left-component-item-title" :style="{'white-space': 'nowrap'}">
<v-icon>mdi-puzzle-outline</v-icon>
组件
<span style="transform: translateY(2px); display: inline-block;">组件</span>
</div>
<draggable
:group="{ name: 'componentGroup', pull: 'clone', put: false }"
:list="componentList"
draggable=".left-component-item"
:clone="cloneComponent"
@end="leftComponentDraggableOnEnd">
<div class="left-component-item"
v-for="(component, index) in componentList" :key="index"
@click="addFormItem(component)">
<div class="left-component-item-body">
<v-icon small class="mr-1">{{ component.icon }}</v-icon>
{{ component.title }}
</div>
:group="{ name: 'componentGroup', pull: 'clone', put: false }"
:list="componentList"
draggable=".left-component-item"
:clone="cloneComponent"
@end="leftComponentDraggableOnEnd">
<div class="left-component-item"
v-for="(component, index) in componentList" :key="index"
@click="addFormItem(component)">
<div class="left-component-item-body">
<v-icon small class="mr-1">{{ component.icon }}</v-icon>
{{ component.title }}
</div>
</div>
</draggable>
</div>
</v-card>
<v-card class="formItemList">
<v-toolbar dense flat>
<v-btn icon @click.stop="emptyCanva" class="ml-2">
<v-icon color="grey lighten-1" dark>mdi-delete-empty</v-icon>
</v-btn>
</v-toolbar>
<draggable
<v-card class="formItemList py-10 pl-4 pr-4" color="#f5f8fa" style="position: relative;">
<v-btn small color="error" @click.stop="emptyCanva" class="mr-2 mt-2"
style="position: absolute; right: 8px; top: 0;">
<span>重置</span>
</v-btn>
<draggable
v-if="formItemList.length > 0"
:list="formItemList"
:animation="300"
group="componentGroup">
<v-hover v-for="(formItem, index) in formItemList" :key="index" v-slot:default="{ hover }">
<v-card
@click.native="formItemSelect(formItem.id)"
:elevation="hover ? 12 : 2"
:class="['ma-2', selectedFormItemId === formItem.id && !hover ? 'formItem-selected' : 'formItem-body']"
style="cursor: move"
dense>
<v-list-item>
<v-hover v-for="(formItem, index) in formItemList" :key="index" v-slot:default="{ hover }">
<v-card
@click.native="formItemSelect(formItem.id)"
:elevation="hover ? 12 : 2"
:class="['my-2', selectedFormItemId === formItem.id && !hover ? 'formItem-selected' : 'formItem-body']"
style="cursor: move"
dense>
<v-list-item>
<v-list-item-content v-if="formItem.component.type === 'singleSelect'">
<v-radio-group :disabled="true" :label="(index+1) + formItem.component.outline">
<v-radio hide-details v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
:key="optionIndex" :label="option.value" :value="option.value"></v-radio>
</v-radio-group>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'singleSelect'">
<v-radio-group :disabled="true" :label="(index+1) + formItem.component.outline">
<v-radio hide-details v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
:key="optionIndex" :label="option.value" :value="option.value"></v-radio>
</v-radio-group>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'multipleSelect'">
<v-list-item-title class="formItem-title">{{ index+1 }}. {{ formItem.component.outline }}</v-list-item-title>
<div v-for="(option, optionIndex) in formItem.component.property.selectOptionList" :key="optionIndex">
<v-checkbox hide-details style="margin-top: 0px;" :disabled="true" :label="option.value" hide-details color="red"></v-checkbox>
</div>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'multipleSelect'">
<v-list-item-title class="formItem-title">{{ index + 1 }}. {{
formItem.component.outline
}}
</v-list-item-title>
<div v-for="(option, optionIndex) in formItem.component.property.selectOptionList" :key="optionIndex">
<v-checkbox hide-details style="margin-top: 0px;" :disabled="true" :label="option.value" hide-details
color="red"></v-checkbox>
</div>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'textarea'">
<v-textarea dense outlined placeholder="请输入答案" hide-details :disabled="true" :rows="4" :label="(index+1) + '. ' + formItem.component.outline"/>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'textarea'">
<v-textarea dense outlined placeholder="请输入答案" hide-details :disabled="true" :rows="4"
:label="(index+1) + '. ' + formItem.component.outline"/>
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'input'">
<v-text-field class="cus-v-input" dense outlined :label="(index+1) + '. ' + formItem.component.outline" :disabled="true">
</v-list-item-content>
<v-list-item-content v-if="formItem.component.type === 'input'">
<v-text-field class="cus-v-input" dense outlined :label="(index+1) + '. ' + formItem.component.outline"
:disabled="true"></v-text-field>
</v-list-item-content>
<v-list-item-action v-if="selectedFormItemId === formItem.id" class="justify-start">
<v-btn x-small icon @click.stop="formItemCopy(index, formItem)">
<v-icon color="primary">mdi-content-duplicate</v-icon>
</v-btn>
<v-btn x-small icon @click.stop="formItemDelete(formItem.id)">
<v-icon color="error">mdi-close-box</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-card>
</v-hover>
</draggable>
<v-row v-else align="center" justify="center" style="width: 100%;">
<v-card height="100" class="ma-12" width="100%">
<draggable :list="[]" :animation="300" group="componentGroup">
<v-card-text class="text-center title">
从左侧拖入或点选组件进行表单设计
</v-card-text>
</draggable>
<v-list-item-action v-if="selectedFormItemId === formItem.id" class="justify-start">
<v-btn x-small icon @click.stop="formItemCopy(index, formItem)">
<v-icon color="primary">mdi-content-duplicate</v-icon>
</v-btn>
<v-btn x-small icon @click.stop="formItemDelete(formItem.id)">
<v-icon color="error">mdi-close-box</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-card>
</v-hover>
</draggable>
<v-row v-else align="center" justify="center" class="ma-0 pa-0" style="width: 100%;">
<v-card height="100" class="ma-12" width="100%" color="#f5f8fa" style="border: 1px dashed #333333">
<draggable :list="[]" :animation="300" group="componentGroup" style="position: relative; height: 100%;">
<v-card-text class="text-center title draggable-placeholder">
从左侧拖入或点选组件进行表单设计
</v-card-text>
</draggable>
</v-card>
</v-row>
</v-row>
</v-card>
</v-row>
</v-card>
<div class="property">
<v-card color="#f5f8fa" :style="{'width': isMobile ? 'auto' : '300px'}" class="pa-4" :class="{'ml-6': !isMobile}">
<div class="property-title">
<v-icon>mdi-application-edit-outline</v-icon>组件属性
<v-icon>mdi-application-edit-outline</v-icon>
<span style="transform: translateY(2px); display: inline-block;">组件属性</span>
</div>
<div v-if="selectCanvaIndex >= 0 && formItemList[selectCanvaIndex]">
<v-card flat v-if="formItemList[selectCanvaIndex].component.type === 'singleSelect' || formItemList[selectCanvaIndex].component.type === 'multipleSelect'">
<v-card class="pa-4 mt-4"
v-if="formItemList[selectCanvaIndex].component.type === 'singleSelect' || formItemList[selectCanvaIndex].component.type === 'multipleSelect'">
<v-row no-gutters>
<v-col cols="12">
<v-text-field class="cus-v-input mr-2" dense outlined label="标题" v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
<v-text-field class="cus-v-input mr-2" dense filled single-line prefix="标题: " color="success"
v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
<div style="display: flex; flex-direction: row;justify-content: space-between; align-items: center;">
<v-subheader>选项列表</v-subheader>
<v-btn icon @click.stop="propertyAddOption(formItemList[selectCanvaIndex].component.property.selectOptionList.length)">
<v-subheader class="pa-0">选项列表</v-subheader>
<v-btn icon
@click.stop="propertyAddOption(formItemList[selectCanvaIndex].component.property.selectOptionList.length)">
<v-icon dark color="grey lighten-1">mdi-plus-box</v-icon>
</v-btn>
</div>
<v-list dense>
<v-list-item v-for="(option, index) in formItemList[selectCanvaIndex].component.property.selectOptionList" :key="index">
<v-list class="propertyList" dense style="max-height: 300px; overflow-y: auto;">
<v-list-item
class="pa-0"
v-for="(option, index) in formItemList[selectCanvaIndex].component.property.selectOptionList"
:key="index">
<v-list-item-content>
<v-text-field
v-model="option.value"
label="选项"
outlined
dense
hide-details
clearable
placeholder="请输入选项"/>
v-model="option.value"
prefix="选项:"
color="success"
filled single-line
dense
hide-details
clearable
placeholder="请输入选项"/>
</v-list-item-content>
<v-list-item-action>
<v-list-item-action class="ml-2">
<v-btn icon @click.stop="propertyDeleteOption(index)">
<v-icon color="grey lighten-1" dark>mdi-delete</v-icon>
</v-btn>
@@ -125,17 +138,17 @@
</v-col>
</v-row>
</v-card>
<v-card flat v-if="formItemList[selectCanvaIndex].component.type === 'textarea'">
<v-text-field class="cus-v-input mr-2" dense outlined label="多行文本" v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
<v-card class="mt-5" flat v-if="formItemList[selectCanvaIndex].component.type === 'textarea'">
<v-text-field class="cus-v-input black" dense filled single-line label="多行文本"
v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
</v-card>
<v-card flat v-if="formItemList[selectCanvaIndex].component.type === 'input'">
<v-text-field class="cus-v-input mr-2" dense outlined label="单行文本" v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
<v-card class="mt-5" flat v-if="formItemList[selectCanvaIndex].component.type === 'input'">
<v-text-field class="cus-v-input black" dense filled single-line label="单行文本"
v-model="formItemList[selectCanvaIndex].component.outline"></v-text-field>
</v-card>
</div>
</div>
</div>
</v-card>
</v-card>
</template>
<script src="//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
@@ -144,111 +157,131 @@
<script>
// 1. v-main 滚动条
// 2. v-navigation-drawer 小屏幕 不要关闭
Vue.component("form-item-list-generator", {
template: '#form-item-list-generator',
vuetify: new Vuetify(),
name: 'form-item-list-generator',
props: {
formItemList: {
type: Array,
default: [],
required: true,
},
Vue.component("form-item-list-generator", {
template: '#form-item-list-generator',
vuetify: new Vuetify(),
name: 'form-item-list-generator',
props: {
formItemList: {
type: Array,
default: [],
required: true,
},
data: () => ({
componentList: [
{ title: '单行文本', type: 'input', outline: '单行文本', property: {}, icon: 'mdi-form-textarea' },
{ title: '多行文本', type: 'textarea', outline: '多行文本', property: {}, icon: 'mdi-form-textarea' },
{ title: '单选', type: 'singleSelect', outline: '单选', property: { selectOptionList: [] }, icon: 'mdi-checkbox-marked-circle' },
{ title: '多选', type: 'multipleSelect', outline: '多选', property: { selectOptionList: [] }, icon: 'mdi-checkbox-marked' },
],
tempComponent: null,
},
data: () => ({
componentList: [
{title: '单行文本', type: 'input', outline: '单行文本', property: {}, icon: 'mdi-form-textarea'},
{title: '多行文本', type: 'textarea', outline: '多行文本', property: {}, icon: 'mdi-form-textarea'},
{
title: '单选',
type: 'singleSelect',
outline: '单选',
property: {selectOptionList: []},
icon: 'mdi-checkbox-marked-circle'
},
{
title: '多选',
type: 'multipleSelect',
outline: '多选',
property: {selectOptionList: []},
icon: 'mdi-checkbox-marked'
},
],
tempComponent: null,
// 当 needle 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。
// 当 needle 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。
// 对于本题而言,当 needle 是空字符串时我们应当返回 0 。这与 C 语言的 strstr() 以及 Java 的 indexOf() 定义相符。
// 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
// `,
// property: {}, icon: 'mdi-checkbox-marked-circle'
// },
// formItemData: {}
// }
// ],
selectedFormItemId: null,
rightPanels: [0,1,2,3,4],
}),
computed: {
selectCanvaIndex () {
const index = this.formItemList.findIndex(item => item.id === this.selectedFormItemId);
return index;
},
// 对于本题而言,当 needle 是空字符串时我们应当返回 0 。这与 C 语言的 strstr() 以及 Java 的 indexOf() 定义相符。
// 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
// `,
// property: {}, icon: 'mdi-checkbox-marked-circle'
// },
// formItemData: {}
// }
// ],
selectedFormItemId: null,
rightPanels: [0, 1, 2, 3, 4],
}),
computed: {
selectCanvaIndex() {
const index = this.formItemList.findIndex(item => item.id === this.selectedFormItemId);
return index;
},
mounted() {
isMobile() {
return window.innerWidth < 600;
},
destroyed() {},
watch: {
},
mounted() {
},
destroyed() {
},
watch: {},
async created() {
},
methods: {
cloneComponent(component) {
this.tempComponent = component;
},
async created() {},
methods: {
cloneComponent (component) {
this.tempComponent = component;
},
leftComponentDraggableOnEnd (event) {
if (event.from !== event.to) {
const newIndex = event.newIndex;
this.addFormItem(this.tempComponent, newIndex);
}
this.tempComponent = null;
},
addFormItem(component, targetIndex) {
const { type } = component;
const formItem = {
id: `${type}_${this.uuid(8)}`,
component: _.cloneDeep(component)
};
if (!this.formItemList) {
this.formItemList = [];
}
if (targetIndex > -1) {
this.formItemList.splice(targetIndex, 0, formItem);
} else {
this.formItemList.push(formItem);
}
},
formItemSelect (id) {
this.selectedFormItemId = id;
},
formItemCopy (index, formItem) {
const newFormItem = _.cloneDeep(formItem);
newFormItem.id = `${newFormItem.component.type}_${this.uuid(8)}`,
this.formItemList.splice(index+1, 0, newFormItem);
},
emptyCanva () {
this.formItemList.splice(0, this.formItemList.length);
},
formItemDelete (id) {
const index = this.formItemList.findIndex((item) => item.id === id);
if (index > -1) {
this.formItemList.splice(index, 1);
}
},
propertyAddOption (index) {
this.formItemList[this.selectCanvaIndex].component.property.selectOptionList.splice(index, 0, { value: "" });
},
propertyDeleteOption (index) {
this.formItemList[this.selectCanvaIndex].component.property.selectOptionList.splice(index, 1);
},
uuid (t=21) {
let e="",r=crypto.getRandomValues(new Uint8Array(t));
for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"};
return e
},
getFormItemList () {
return this.formItemList;
},
leftComponentDraggableOnEnd(event) {
if (event.from !== event.to) {
const newIndex = event.newIndex;
this.addFormItem(this.tempComponent, newIndex);
}
this.tempComponent = null;
},
})
addFormItem(component, targetIndex) {
const {type} = component;
const formItem = {
id: `${type}_${this.uuid(8)}`,
component: _.cloneDeep(component)
};
if (!this.formItemList) {
this.formItemList = [];
}
if (targetIndex > -1) {
this.formItemList.splice(targetIndex, 0, formItem);
} else {
this.formItemList.push(formItem);
}
},
formItemSelect(id) {
this.selectedFormItemId = id;
},
formItemCopy(index, formItem) {
const newFormItem = _.cloneDeep(formItem);
newFormItem.id = `${newFormItem.component.type}_${this.uuid(8)}`,
this.formItemList.splice(index + 1, 0, newFormItem);
},
emptyCanva() {
this.formItemList.splice(0, this.formItemList.length);
},
formItemDelete(id) {
const index = this.formItemList.findIndex((item) => item.id === id);
if (index > -1) {
this.formItemList.splice(index, 1);
}
},
propertyAddOption(index) {
this.formItemList[this.selectCanvaIndex].component.property.selectOptionList.splice(index, 0, {value: ""});
},
propertyDeleteOption(index) {
this.formItemList[this.selectCanvaIndex].component.property.selectOptionList.splice(index, 1);
},
uuid(t = 21) {
let e = "", r = crypto.getRandomValues(new Uint8Array(t));
for (; t--;) {
let n = 63 & r[t];
e += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? "_" : "-"
}
;
return e
},
getFormItemList() {
return this.formItemList;
},
},
})
</script>
<style scoped>
@@ -265,31 +298,36 @@
height: 100%;
max-height: 100%;
}
.left-component-item {
width: 100%;
margin: 1%;
margin: 8px 0;
transition: transform 0ms !important;
}
.left-component-item-title {
font-size: 14px;
color: #222;
margin: 6px 2px;
font-size: 14px;
color: #222;
margin: 6px 2px;
}
.left-component-item-body {
padding: 8px 10px;
background: #e0e0e0;
font-size: 12px;
cursor: move;
border: 1px dashed #e0e0e0;
border-radius: 3px;
padding: 8px 10px;
background: #ffffff;
font-size: 12px;
cursor: move;
border: 1px dashed #ffffff;
border-radius: 3px;
}
.left-component-item-body:hover {
border: 1px dashed #1565c0;
background: #e3f2fd;
color: #1565c0;
border: 1px dashed #4caf50;
background: #e6fde3;
color: #4caf50;
}
.left-component-item-body:hover .v-icon {
color: #1565c0;
color: #4caf50;
}
.formItemList {
@@ -297,14 +335,13 @@
overflow-y: auto;
height: 100%;
max-height: 100%;
background-color: #e0e0e0 !important;
border-radius: 0 !important;
border: 1px dashed #999 !important;
}
.formItemList .formItem-selected {
border: 1px dashed #1565c0 !important;
background: #e3f2fd;
border: 1px dashed #4caf50 !important;
background: #e6fde3;
}
.formItem-title {
white-space: normal;
}
@@ -315,6 +352,7 @@
max-height: calc(100vh - 105px);
padding: 10px;
}
.property .property-title {
margin-bottom: 10px;
}
@@ -332,4 +370,45 @@
min-width: 24px;
}
.propertyList::-webkit-scrollbar {
width: 5px;
background: #f5f8fa;
border-radius: 5px;
}
.propertyList::-webkit-scrollbar-thumb {
width: 5px;
background: #606060;
border-radius: 5px;
}
body .theme--light.v-text-field--filled.cus-v-input.black > .v-input__control > .v-input__slot {
background: #e6ebee;
}
.draggable-placeholder {
position: absolute;
left: 0!important;
top: 50%!important;
transform: translateY(-50%)!important;
opacity: 0.3;
}
@media (max-width: 500px) {
.left-component-item {
width: auto;
display: inline-block;
margin: 8px 4px;
transition: transform 0ms !important;
}
.formItemList {
border-top: 2px solid #cccccc !important;
border-bottom: 2px solid #cccccc !important;
border-radius: unset !important;
height: auto;
max-height: none;
overflow: hidden;
}
}
</style>
+8 -1
View File
@@ -79,6 +79,13 @@
height: 500px;
max-height: 500px;
overflow-y: auto;
border: 2px solid rgb(226, 226, 226);
}
@media (max-width: 500px) {
.tpl-form-design-container {
width: 100%;
height: auto;
max-height: none;
overflow-y: hidden;
}
}
</style>
+27 -31
View File
@@ -5,34 +5,32 @@
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field v-model="serverSearchInput.processName" label="流程名称" class="cus-v-input "
:class="{'mr-2': !isMobile}" dense filled single-line ></v-text-field>
<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}">
<v-text-field v-model="serverSearchInput.processName" color="success" prefix="流程名称:" class="cus-v-input" :class="{'mr-2': !isMobile}" dense filled single-line></v-text-field>
</v-col>
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-col class="pl-0 pr-0" :class="{'pt-0': isMobile}" style="max-width: 57px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-card :class="{'px-2': isMobile}">
<v-list three-line subheader>
<v-subheader>流程列表</v-subheader>
<v-list-item v-for="(item, index) in tableDataFromBackend" :key="index">
<v-subheader>{{getConstantCollectionItemText('categoryList', index)}}</v-subheader>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" sm="12" md="6" xl="6" class="pa-xs-0 pb-xs-4 pb-3" v-for="(it, index) in item">
<v-row :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
<v-col cols="12" sm="12" md="6" xl="6" class=" pb-3" v-for="(it, index) in item">
<v-btn class="elevation-0 mr-10" color="success" dark @click="doUiAction('startCreateItem', {item: it})">
{{it.workflowName}}
</v-btn>
@@ -41,29 +39,28 @@
</v-list-item>
</v-list>
</v-card>
</v-container>
<!-- 编辑抽屉 -->
<v-navigation-drawer v-model="isEditDrawerShow" :permanent="isEditDrawerShow" fixed temporary right width="80%"
<v-navigation-drawer v-model="isEditDrawerShow" fixed temporary right width="40%"
class="elevation-24">
<v-form v-model="isFormValid" v-if="isEditDrawerShow" ref="form" lazy-validation>
<v-row>
<span class="title pa-6">{{ currentClickButton.title }}信息</span>
<v-row class="pt-8">
<span class="title pa-6" :class="{'pl-12': !isMobile, 'pl-6': isMobile}">{{ currentClickButton.title }}信息</span>
<v-spacer></v-spacer>
<v-btn class="mt-7 mr-8 elevation-0" fab x-small @click="isEditDrawerShow = false">
<v-btn class="mt-6 elevation-0" :class="{'mr-16': !isMobile, 'mr-8': isMobile}" fab x-small @click="isEditDrawerShow = false">
<v-icon dark>mdi-close</v-icon>
</v-btn>
</v-row>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-row :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<span style="color: #3F4254;" :style="{'line-height': isMobile ? '20px' : '42px', 'font-weight': isMobile ? 400 : 500}">任务标题</span>
<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']">
</v-text-field>
</v-col>
<v-col cols="12" class="pa-xs-0 pb-xs-4 pb-3" v-for="(formItem, index) in editItem.workflowForm" :key="index">
<span style="color: #3F4254;" :style="{'line-height': isMobile ? '20px' : '42px', 'font-weight': isMobile ? 400 : 500}">{{formItem.component.outline}}</span>
<v-col cols="12" class=" pb-3" v-for="(formItem, index) in editItem.workflowForm" :key="index">
<span class="inputLabel">{{formItem.component.outline}}</span>
<v-list-item-content v-if="formItem.component.type === 'singleSelect'">
<v-list-item-title class="formItem-title">{{ index+1 }}、 {{ formItem.component.outline }}</v-list-item-title>
<v-radio-group :rules="requireRules" v-model="editItem.workflowFormData[formItem.id]" hide-details>
@@ -88,12 +85,11 @@
</v-list-item-content>
</v-col>
</v-row>
<v-row class="justify-end pr-6">
<v-btn color="success" small @click="doUiAction(dialogSaveInfoAction)"
:style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mb-2': isMobile, 'mr-4': isMobile}">保存
<v-row class="justify-end mx-0 mt-8" :class="{'px-10': !isMobile, 'px-4': isMobile, 'mb-8': isMobile}">
<v-btn color="success" @click="doUiAction(dialogSaveInfoAction)"
>保存
</v-btn>
<v-btn class="ml-2" small @click="isEditDrawerShow = false"
:style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mr-4': isMobile}">取消</v-btn>
<v-btn class="elevation-0 ml-2" @click="isEditDrawerShow = false">取消</v-btn>
</v-row>
</v-form>
</v-navigation-drawer>
@@ -310,4 +306,4 @@
<style scoped>
</style>
{% endblock %}
{% endblock %}
+342 -331
View File
@@ -4,113 +4,111 @@
<jh-layout-v3>
<!-- 页面主要内容 -->
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-4" style="background-color: rgb(236, 236, 236);">
<v-stepper v-model="step" class="mb-4">
<v-stepper-header>
<!-- 页面主要内容 -->
<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"></v-divider>
<v-stepper-step :complete="step > item.value" :step="item.value">
{{item.text}}
<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-card class="mb-4">
<v-subheader>表单信息</v-subheader>
<v-divider></v-divider>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col :cols="taskTpl.prev ? 6 : 12" v-for="(key, i) in ['prev', 'input']" :key="i"
v-if="isAccess && taskTpl[key]">
<v-row>
<v-col cols="12" class="pa-xs-0 pb-xs-4 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> -->
<template v-if="formItem.component.type === 'singleSelect'">
<v-list-item-title class="formItem-title">{{formTitlePrefix(formItem.component.outline, key)}}
</v-list-item-title>
<v-radio-group v-model="taskTpl[key][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-model="taskTpl[key][formItem.id]"></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>
<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" v-model="taskTpl[key][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" />
</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>
</template>
</v-col>
</v-row>
</v-col>
</v-row>
<v-divider></v-divider>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none" v-if="isAccess">
<v-col cols="12">
<v-textarea dense outlined placeholder="请输入备注信息" hide-details v-model="editItem.taskComment" :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="primary" v-for="item in nextLineList" @click="submitNode(item.type)">
{{item.type}}-{{item.label}}</v-btn>
</v-col>
</v-row>
</v-card>
<v-card>
<v-list three-line subheader>
<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>
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}"><v-subheader>表单信息</v-subheader></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-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> -->
<template v-if="formItem.component.type === 'singleSelect'">
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
</v-list-item-title>
<v-radio-group v-model="taskTpl[key][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-model="taskTpl[key][formItem.id]"></v-radio>
</v-radio-group>
</template>
</v-simple-table>
</div>
</v-list>
</v-card>
</v-container>
<template v-if="formItem.component.type === 'multipleSelect'">
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
</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" v-model="taskTpl[key][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"/>
</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>
</template>
</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="submitNode(item.type)">
{{ item.type }}-{{ item.label }}
</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>
</v-card>
</jh-layout-v3>
{% endblock %}
@@ -118,244 +116,257 @@
{% block vue_body %}
<script type="module">
new Vue({
el: '#app',
template: '#app-template',
vuetify: new Vuetify(),
mixins: [window.jianghuUiActionMixins],
data: () => ({
step: 1,
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
categoryList: [],
new Vue({
el: '#app',
template: '#app-template',
vuetify: new Vuetify(),
mixins: [window.jianghuUiActionMixins],
data: () => ({
step: 1,
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
categoryList: [],
},
serverSearchInput: {
processName: null
},
currentTableGenderType: 'all',
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: "流程节点版本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' },
],
currentClickButton: { title: '新增', action: 'add' },
editItem: {},
tableButtonList: [
{ text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem' },
{ text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem' },
],
dialogSaveInfoAction: '',
taskId: '',
isAccess: [],
nextLineList: [],
taskHistoryList: [],
taskTpl: [],
taskStepperList: [],
currentNode: {}
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({ gender }) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
const searchParams = new URLSearchParams(location.search.substring(1));
this.taskId = searchParams.get('taskId');
await this.getTaskHistoryList()
serverSearchInput: {
processName: null
},
mounted() { },
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskCreateManagement',
actionId: 'selectProcessList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{ column: 'operationAt', order: 'desc' }]
}
}
});
this.tableDataFromBackend = _.groupBy(rows, 'categoryId');
this.isTableLoading = false;
},
currentTableGenderType: 'all',
isEditDrawerShow: false,
searchInput: null,
isTableLoading: true,
tableDataFromBackend: [],
headers: [
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
/**
* 获取表格数据
*/
async getTaskHistoryList() {
const { data: { appData: { taskHistoryList, taskStepperList, taskTpl, isAccess, nextLineList, step, currentNode } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskHistoryManagement',
actionId: 'getTaskHistoryInfo',
actionData: { taskId: this.taskId },
}
}
});
this.taskHistoryList = taskHistoryList;
this.taskTpl = taskTpl;
this.taskStepperList = taskStepperList;
this.currentNode = currentNode;
this.isAccess = isAccess;
this.nextLineList = nextLineList;
this.step = step;
},
{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'},
],
// startCreateItem
async clearItemData({ processVersionId }) {
this.editItem = { processVersionId };
},
async openCreateItemDialog() {
this.currentClickButton = { action: 'add', title: '新增' };
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({ title: '新增', content: '确定新增吗?' })
},
/**
* 新增数据
*/
async submitNode(type) {
await window.vtoast.loading("提交数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskHistoryManagement',
actionId: 'submitNode',
actionData: { type, taskId: this.taskId, taskComment: this.editItem.taskComment, taskTpl: this.taskTpl }
}
}
})
await window.vtoast.success("提交数据成功");
this.getTaskHistoryList();
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({ item }) {
this.editItem = { ...item };
},
async openUpdateDialog() {
this.currentClickButton = { action: 'edit', title: '修改' };
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({ title: '修改', content: '确定修改吗?' });
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: { id: id }
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({ title: '删除', content: '确定删除吗?' });
},
/**
* 删除数据
*/
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("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(e => e.value + '' === _value + '');
if (constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
formTitlePrefix(title, type) {
if (type === 'prev') {
return '历史-' + title;
}
return title;
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: '',
taskId: '',
isAccess: [],
nextLineList: [],
taskHistoryList: [],
taskTpl: [],
taskStepperList: [],
currentNode: {}
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
const searchParams = new URLSearchParams(location.search.substring(1));
this.taskId = searchParams.get('taskId');
await this.getTaskHistoryList()
},
mounted() {
},
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskCreateManagement',
actionId: 'selectProcessList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
});
this.tableDataFromBackend = _.groupBy(rows, 'categoryId');
this.isTableLoading = false;
},
/**
* 获取表格数据
*/
async getTaskHistoryList() {
const {
data: {
appData: {
taskHistoryList,
taskStepperList,
taskTpl,
isAccess,
nextLineList,
step,
currentNode
}
}
} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskHistoryManagement',
actionId: 'getTaskHistoryInfo',
actionData: {taskId: this.taskId},
}
}
});
this.taskHistoryList = taskHistoryList;
this.taskTpl = taskTpl;
this.taskStepperList = taskStepperList;
this.currentNode = currentNode;
this.isAccess = isAccess;
this.nextLineList = nextLineList;
this.step = step;
},
// startCreateItem
async clearItemData({processVersionId}) {
this.editItem = {processVersionId};
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
/**
* 新增数据
*/
async submitNode(type) {
await window.vtoast.loading("提交数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskHistoryManagement',
actionId: 'submitNode',
actionData: {type, taskId: this.taskId, taskComment: this.editItem.taskComment, taskTpl: this.taskTpl}
}
}
})
await window.vtoast.success("提交数据成功");
this.getTaskHistoryList();
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = {...item};
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
},
/**
* 删除数据
*/
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("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(e => e.value + '' === _value + '');
if (constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
formTitlePrefix(title, type) {
if (type === 'prev') {
return '历史-' + title;
}
return title;
}
})
}
})
</script>
<style scoped>
</style>
{% endblock %}
{% endblock %}
+45 -186
View File
@@ -4,57 +4,40 @@
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-row class="ma-0 pa-xs-4 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="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span>
</v-col>
<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-spacer></v-spacer>
<v-col cols="12" xs="8" sm="4" md="3" xl="3" class="pa-xs-0 pa-xs-2 col-sm-8-flex">
<v-text-field v-model="searchInput" label="表格过滤" class="cus-v-input" dense filled single-line></v-text-field>
</v-col>
</v-row>
<v-data-table fixed-header
: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="elevation-0 mt-0 mb-xs-4 flex-fill d-flex flex-column">
<!-- <template v-slot:item.level="{ item }">-->
<!-- {{ getConstantCollectionItemText('level', item.level) }}-->
<!-- </template>-->
<template v-slot:item.action="{ item }">
<v-btn small color="warning" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
</v-container>
<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 %}
@@ -69,45 +52,29 @@ new Vue({
mixins: [window.jianghuUiActionMixins],
data: () => ({
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
},
serverSearchInput: {
studentId: null,
classId: null
},
currentTableGenderType: 'all',
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: "任务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'},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: ''
}),
computed: {
isMobile() {
@@ -119,30 +86,26 @@ new Vue({
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {},
mounted() {
},
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value=> !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskICreateManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
@@ -152,112 +115,8 @@ new Vue({
this.isTableLoading = false;
},
// startCreateItem
async clearItemData() {
this.editItem = {};
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'insertItem',
actionData: this.computedEditItem
}
}
})
await window.vtoast.success("新增数据成功");
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = {...item};
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
},
/**
* 删除数据
*/
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("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(({value}) => value === _value);
if(constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
toTaskHistory({item}) {
window.open(`/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`);
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
+50 -237
View File
@@ -4,145 +4,41 @@
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<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-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-row class="ma-0 pa-xs-4 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-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-spacer></v-spacer>
<v-col cols="12" xs="8" sm="4" md="3" xl="3" class="pa-xs-0 pa-xs-2 col-sm-8-flex">
<v-text-field v-model="searchInput" label="表格过滤" class="cus-v-input" dense filled single-line></v-text-field>
</v-col>
</v-row>
<v-data-table fixed-header
: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="elevation-0 mt-0 mb-xs-4 flex-fill d-flex flex-column">
<!-- <template v-slot:item.level="{ item }">-->
<!-- {{ getConstantCollectionItemText('level', item.level) }}-->
<!-- </template>-->
<template v-slot:item.action="{ item }">
<v-btn small color="warning" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
<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-container>
<!-- 编辑抽屉 -->
<v-navigation-drawer v-model="isEditDrawerShow" absolute temporary right width="80%" hide-overlay class="elevation-24">
<v-form v-model="isFormValid" v-if="isEditDrawerShow" ref="form" lazy-validation>
<v-row>
<span class="title pa-6">{{ currentClickButton.title }}信息</span>
<v-spacer></v-spacer>
<v-btn class="mt-7 mr-8 elevation-0" fab x-small @click="isEditDrawerShow = false">
<v-icon dark>mdi-close</v-icon>
</v-btn>
</v-row>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务ID" v-model="editItem['taskId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务名称" v-model="editItem['taskTitle']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务状态:running 执行中;deny 拒绝;end 结束" v-model="editItem['taskStatus']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="表单" v-model="editItem['taskFormInput']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行中节点ID" v-model="editItem['taskConfigId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="执行线路id list: 逗号分隔" v-model="editItem['taskNextConfigList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="申请人" v-model="editItem['taskInitUser']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行的处理人员,用逗号分隔" v-model="editItem['taskEditUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="所有相关人员,用逗号分隔" v-model="editItem['taskViewUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="备注" v-model="editItem['taskComment']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="work flow流程JSON" v-model="editItem['workflowConfig']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务创建人" v-model="editItem['createByUser']"></v-text-field>
</v-col>
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- &lt;!&ndash; 必填字段样式 demo :rules="requireRules" &ndash;&gt;-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined label="学生ID" v-model="editItem.studentId" :rules="requireRules"></v-text-field>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; select 字段 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-select class="cus-v-input mr-2" dense outlined clearable label="班级ID" v-model="editItem.classId" :items="constantCollection.classId"></v-select>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; 日期选择 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-menu class="cus-v-input mr-2" offset-y max-width="290">-->
<!-- <template v-slot:activator="{ on, attrs }">-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined v-on="on" label="出生日期" v-model="editItem.dateOfBirth"></v-text-field>-->
<!-- </template>-->
<!-- <v-date-picker color="success" elevation="20" v-model="editItem.dateOfBirth"></v-date-picker>-->
<!-- </v-menu>-->
<!-- </v-col>-->
</v-row>
<v-row class="justify-end pr-6">
<v-btn color="success" small @click="doUiAction(dialogSaveInfoAction)" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mb-2': isMobile, 'mr-4': isMobile}">保存</v-btn>
<v-btn class="ml-2" small @click="isEditDrawerShow = false" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mr-4': isMobile}">取消</v-btn>
</v-row>
</v-form>
</v-navigation-drawer>
<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="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 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>
@@ -162,8 +58,7 @@ new Vue({
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
},
constantCollection: {},
serverSearchInput: {
studentId: null,
@@ -176,24 +71,24 @@ 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: "申请人", 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: "任务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'},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '查看', buttonType: 'view', color: 'success', action: 'toTaskHistory'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: ''
@@ -216,22 +111,21 @@ new Vue({
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {},
mounted() {
},
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value=> !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
@@ -241,80 +135,6 @@ new Vue({
this.isTableLoading = false;
},
// startCreateItem
async clearItemData() {
this.editItem = {};
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'insertItem',
actionData: this.computedEditItem
}
}
})
await window.vtoast.success("新增数据成功");
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = {...item};
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
@@ -324,7 +144,7 @@ new Vue({
* 删除数据
*/
async doDeleteItem({item}) {
const { id } = item;
const {id} = item;
await window.vtoast.loading("删除数据");
await window.jianghuAxios({
data: {
@@ -332,21 +152,14 @@ new Vue({
pageId: 'taskManagement',
actionId: 'deleteItem',
actionData: {},
where: { id: id }
where: {id: id}
}
}
});
await window.vtoast.success("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(({value}) => value === _value);
if(constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
toTaskHistory({item}) {
window.open(`/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`);
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
+43 -269
View File
@@ -4,142 +4,40 @@
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-row class="ma-0 pa-xs-4 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="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span>
</v-col>
<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-spacer></v-spacer>
<v-col cols="12" xs="8" sm="4" md="3" xl="3" class="pa-xs-0 pa-xs-2 col-sm-8-flex">
<v-text-field v-model="searchInput" label="表格过滤" class="cus-v-input" dense filled single-line></v-text-field>
</v-col>
</v-row>
<v-data-table fixed-header
: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="elevation-0 mt-0 mb-xs-4 flex-fill d-flex flex-column">
<!-- <template v-slot:item.level="{ item }">-->
<!-- {{ getConstantCollectionItemText('level', item.level) }}-->
<!-- </template>-->
<template v-slot:item.action="{ item }">
<v-btn small color="warning" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
</v-container>
<!-- 编辑抽屉 -->
<v-navigation-drawer v-model="isEditDrawerShow" absolute temporary right width="80%" hide-overlay class="elevation-24">
<v-form v-model="isFormValid" v-if="isEditDrawerShow" ref="form" lazy-validation>
<v-row>
<span class="title pa-6">{{ currentClickButton.title }}信息</span>
<v-spacer></v-spacer>
<v-btn class="mt-7 mr-8 elevation-0" fab x-small @click="isEditDrawerShow = false">
<v-icon dark>mdi-close</v-icon>
<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="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}"
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>
</v-row>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务ID" v-model="editItem['taskId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务名称" v-model="editItem['taskTitle']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务状态:running 执行中;deny 拒绝;end 结束" v-model="editItem['taskStatus']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="表单" v-model="editItem['taskFormInput']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行中节点ID" v-model="editItem['taskConfigId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="执行线路id list: 逗号分隔" v-model="editItem['taskNextConfigList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="申请人" v-model="editItem['taskInitUser']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行的处理人员,用逗号分隔" v-model="editItem['taskEditUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="所有相关人员,用逗号分隔" v-model="editItem['taskViewUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="备注" v-model="editItem['taskComment']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="work flow流程JSON" v-model="editItem['workflowConfig']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务创建人" v-model="editItem['createByUser']"></v-text-field>
</v-col>
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- &lt;!&ndash; 必填字段样式 demo :rules="requireRules" &ndash;&gt;-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined label="学生ID" v-model="editItem.studentId" :rules="requireRules"></v-text-field>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; select 字段 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-select class="cus-v-input mr-2" dense outlined clearable label="班级ID" v-model="editItem.classId" :items="constantCollection.classId"></v-select>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; 日期选择 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-menu class="cus-v-input mr-2" offset-y max-width="290">-->
<!-- <template v-slot:activator="{ on, attrs }">-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined v-on="on" label="出生日期" v-model="editItem.dateOfBirth"></v-text-field>-->
<!-- </template>-->
<!-- <v-date-picker color="success" elevation="20" v-model="editItem.dateOfBirth"></v-date-picker>-->
<!-- </v-menu>-->
<!-- </v-col>-->
</v-row>
<v-row class="justify-end pr-6">
<v-btn color="success" small @click="doUiAction(dialogSaveInfoAction)" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mb-2': isMobile, 'mr-4': isMobile}">保存</v-btn>
<v-btn class="ml-2" small @click="isEditDrawerShow = false" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mr-4': isMobile}">取消</v-btn>
</v-row>
</v-form>
</v-navigation-drawer>
</template>
</v-data-table>
</v-card>
</jh-layout-v3>
@@ -155,45 +53,29 @@ new Vue({
mixins: [window.jianghuUiActionMixins],
data: () => ({
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
},
serverSearchInput: {
studentId: null,
classId: null
},
currentTableGenderType: 'all',
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: "任务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'},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: ''
}),
computed: {
isMobile() {
@@ -205,30 +87,26 @@ new Vue({
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {},
mounted() {
},
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value=> !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskICreateManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
@@ -238,112 +116,8 @@ new Vue({
this.isTableLoading = false;
},
// startCreateItem
async clearItemData() {
this.editItem = {};
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'insertItem',
actionData: this.computedEditItem
}
}
})
await window.vtoast.success("新增数据成功");
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = {...item};
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
},
/**
* 删除数据
*/
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("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(({value}) => value === _value);
if(constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
toTaskHistory({item}) {
window.open(`/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`);
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
+46 -270
View File
@@ -4,143 +4,42 @@
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-row class="ma-0 pa-xs-4 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-2': isMobile}">
<!-- 页面主要内容 -->
<v-card :class="{'px-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-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-2': isMobile}">
<v-spacer></v-spacer>
<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-col cols="12" xs="8" sm="4" md="3" xl="3" class="pa-xs-0 pa-xs-2 col-sm-8-flex">
<v-text-field v-model="searchInput" label="表格过滤" class="cus-v-input" dense filled single-line></v-text-field>
</v-col>
</v-row>
<v-data-table fixed-header
: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="elevation-0 mt-0 mb-xs-4 flex-fill d-flex flex-column">
<!-- <template v-slot:item.level="{ item }">-->
<!-- {{ getConstantCollectionItemText('level', item.level) }}-->
<!-- </template>-->
<template v-slot:item.action="{ item }">
<v-btn small color="warning" class="mr-2" @click="doUiAction('toTaskHistory', {item})">
查看
</v-btn>
</template>
</v-data-table>
</v-card>
</v-container>
<v-spacer></v-spacer>
<!-- 编辑抽屉 -->
<v-navigation-drawer v-model="isEditDrawerShow" absolute temporary right width="80%" hide-overlay class="elevation-24">
<v-form v-model="isFormValid" v-if="isEditDrawerShow" ref="form" lazy-validation>
<v-row>
<span class="title pa-6">{{ currentClickButton.title }}信息</span>
<v-spacer></v-spacer>
<v-btn class="mt-7 mr-8 elevation-0" fab x-small @click="isEditDrawerShow = false">
<v-icon dark>mdi-close</v-icon>
</v-btn>
</v-row>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务ID" v-model="editItem['taskId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务名称" v-model="editItem['taskTitle']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务状态:running 执行中;deny 拒绝;end 结束" v-model="editItem['taskStatus']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="表单" v-model="editItem['taskFormInput']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行中节点ID" v-model="editItem['taskConfigId']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="执行线路id list: 逗号分隔" v-model="editItem['taskNextConfigList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="申请人" v-model="editItem['taskInitUser']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="当前执行的处理人员,用逗号分隔" v-model="editItem['taskEditUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="所有相关人员,用逗号分隔" v-model="editItem['taskViewUserList']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="备注" v-model="editItem['taskComment']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="work flow流程JSON" v-model="editItem['workflowConfig']"></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<v-text-field class="cus-v-input mr-2" dense outlined label="任务创建人" v-model="editItem['createByUser']"></v-text-field>
</v-col>
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- &lt;!&ndash; 必填字段样式 demo :rules="requireRules" &ndash;&gt;-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined label="学生ID" v-model="editItem.studentId" :rules="requireRules"></v-text-field>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; select 字段 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-select class="cus-v-input mr-2" dense outlined clearable label="班级ID" v-model="editItem.classId" :items="constantCollection.classId"></v-select>-->
<!-- </v-col>-->
<!-- &lt;!&ndash; 日期选择 demo &ndash;&gt;-->
<!-- <v-col cols="12" sm="12" md="4" xl="3" class="pa-xs-0 pb-xs-4 pb-3">-->
<!-- <v-menu class="cus-v-input mr-2" offset-y max-width="290">-->
<!-- <template v-slot:activator="{ on, attrs }">-->
<!-- <v-text-field class="cus-v-input mr-2" dense outlined v-on="on" label="出生日期" v-model="editItem.dateOfBirth"></v-text-field>-->
<!-- </template>-->
<!-- <v-date-picker color="success" elevation="20" v-model="editItem.dateOfBirth"></v-date-picker>-->
<!-- </v-menu>-->
<!-- </v-col>-->
</v-row>
<v-row class="justify-end pr-6">
<v-btn color="success" small @click="doUiAction(dialogSaveInfoAction)" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mb-2': isMobile, 'mr-4': isMobile}">保存</v-btn>
<v-btn class="ml-2" small @click="isEditDrawerShow = false" :style="{width: isMobile ? 'calc(100% - 45px)' : '200px'}" :class="{'mr-4': isMobile}">取消</v-btn>
</v-row>
</v-form>
</v-navigation-drawer>
<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="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>
@@ -156,45 +55,29 @@ new Vue({
mixins: [window.jianghuUiActionMixins],
data: () => ({
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
},
serverSearchInput: {
studentId: null,
classId: null
},
currentTableGenderType: 'all',
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: "任务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'},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
],
currentClickButton: {title: '新增', action: 'add'},
editItem: {},
tableButtonList: [
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: ''
}),
computed: {
isMobile() {
@@ -206,30 +89,26 @@ new Vue({
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {},
async created() {
await this.doUiAction('refreshTableData');
},
mounted() {},
mounted() {
},
methods: {
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value=> !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'taskUpcomingManagement',
actionId: 'selectItemList',
actionData: {},
where: {},
whereLike: serverSearchInput,
orderBy: [{column: 'operationAt', order: 'desc'}]
}
}
@@ -239,112 +118,9 @@ new Vue({
this.isTableLoading = false;
},
// startCreateItem
async clearItemData() {
this.editItem = {};
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'insertItem',
actionData: this.computedEditItem
}
}
})
await window.vtoast.success("新增数据成功");
},
async closeDrawerShow() {
this.isEditDrawerShow = false;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = {...item};
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
this.isEditDrawerShow = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const id = this.computedEditItem.id;
delete this.computedEditItem.id;
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'taskManagement',
actionId: 'updateItem',
actionData: this.computedEditItem,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
},
/**
* 删除数据
*/
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("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(({value}) => value === _value);
if(constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return _value;
},
toTaskHistory({item}) {
window.open(`/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`);
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
}
}
})
+287
View File
@@ -0,0 +1,287 @@
{% extends 'template/jhTemplateV3.html'%}
{% block vue_template %}
<jh-layout-v3>
<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-col>
<v-btn color="success" @click="doUiAction(dialogSaveInfoAction)" style="height: 40px">
保存
</v-btn>
</v-col>
</v-row>
<div class="pt-8 pb-4" style="font-size: 18px; font-weight: bold">模板设置</div>
<tpl-form-design :form="editItem.workflowForm">
</tpl-form-design>
<div class="pt-8 pb-4" style="font-size: 18px; font-weight: bold">模板设置</div>
<process-flow :data="editItem.workflowConfig" :user="constantCollection.userList"
:group="constantCollection.groupList" :tpl="constantCollection.workflowFormList">
</process-flow>
</v-card>
</template>
</jh-layout-v3>
{% endblock %}
{% block vue_body %}
{% include 'component/flow/processFlow.html' %}
{% include 'component/flow/editFlow.html' %}
{% include 'component/flow/editLine.html' %}
{% include 'component/flow/editNode.html' %}
{% include 'component/flow/flowNode.html' %}
{% include 'component/tpl/tplFormDesign.html' %}
{% include 'component/tpl/formItemListGenerator.html' %}
{% include 'component/tpl/formItemListRender.html' %}
<script type="module">
new Vue({
el: '#app',
template: '#app-template',
vuetify: new Vuetify(),
mixins: [window.jianghuUiActionMixins],
data: () => ({
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
userList: [],
groupList: [],
workflowFormList: []
},
serverSearchInput: {
studentId: null,
classId: null
},
currentTableGenderType: 'all',
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: "分类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: {},
tableButtonList: [
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: 'createItem',
dialog: false,
}),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {
'editItem.workflowForm': {
handler(val) {
if (!val) return
this.constantCollection.workflowFormList = [];
for (const item of val) {
this.constantCollection.workflowFormList.push({
text: item.component.outline,
value: item.id
})
}
if (!this.editItem.workflowConfig) return;
for (const config of this.editItem.workflowConfig.nodeList) {
if (!config.formId) return;
const formId = []
for (const item of config.formId) {
if (!this.constantCollection.workflowFormList.find(e => e.value === item)) {
formId.push(item)
}
}
config.formId = formId
console.log(config.outline, config.formId)
}
},
deep: true,
immediate: true
}
},
async created() {
const searchParams = new URLSearchParams(location.search.substring(1));
const type = searchParams.get('type');
if(type === 'edit') {
const workflowEditItem = sessionStorage.getItem('workflowEditItem');
if(workflowEditItem) {
this.dialogSaveInfoAction = 'updateItem';
this.editItem = JSON.parse(workflowEditItem);
sessionStorage.removeItem('workflowEditItem');
console.log(this.editItem);
} else {
history.back();
}
} else {
this.clearItemData();
}
this.getUserList();
this.getGroupList();
},
mounted() {
},
methods: {
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,
}
if (this.editItem.id) {
item.id = this.editItem.id;
}
return item;
},
/**
* 获取表格数据
*/
async getUserList() {
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectUserList',
actionData: {},
where: {},
}
}
});
this.constantCollection.userList = rows.map(e => {
return {text: e.username, value: e.userId}
})
},
/**
* 获取表格数据
*/
async getGroupList() {
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectGroupList',
actionData: {},
where: {},
}
}
});
this.constantCollection.groupList = rows.map(e => {
return {text: e.groupName, value: e.groupId}
});
},
// startCreateItem
async clearItemData() {
this.editItem = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}};
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
validate() {
if (!this.editItem.workflowId || !this.editItem.workflowId) {
}
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
const item = this.buildEditItem();
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'insertItem',
actionData: item
}
}
})
await window.vtoast.success("新增数据成功");
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const {id, ...item} = this.buildEditItem();
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'updateItem',
actionData: item,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
}
})
</script>
<style scoped>
.v-dialog--fullscreen .v-sheet {
height: unset;
top: unset;
position: unset;
background: white;
}
</style>
{% endblock %}
+55 -305
View File
@@ -3,124 +3,46 @@
{% block vue_template %}
<jh-layout-v3>
<template slot="serverSearch">
<v-row class="ma-0 align-center flex-none pa-0" :class="{'pa-2': !isMobile, 'pa-2': isMobile}" style="justify-content: end">
<v-col :class="{'pt-2': isMobile, 'pl-0': isMobile, 'pr-0': !isMobile}" style="max-width: 77px">
<v-btn
class="elevation-0"
color="success"
dark
@click="doUiAction('refreshTableData')"
>
查询
</v-btn>
</v-col>
</v-row>
</template>
<!-- 页面主要内容 -->
<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-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-card>
<v-row class="ma-0 pa-xs-4 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">
<v-btn color="success" small dark class="elevation-0 mr-2" @click="doUiAction('startCreateItem')">新增</v-btn>
<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="pa-xs-0 pa-xs-2 col-sm-8-flex">
<v-text-field v-model="searchInput" label="表格过滤" class="cus-v-input" dense filled single-line></v-text-field>
</v-col>
</v-row>
<v-data-table fixed-header
: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="elevation-0 mt-0 mb-xs-4 flex-fill d-flex flex-column">
<!-- <template v-slot:item.level="{ item }">-->
<!-- {{ getConstantCollectionItemText('level', item.level) }}-->
<!-- </template>-->
<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-container>
<v-dialog v-model="dialog" fullscreen hide-overlay persistent transition="dialog-bottom-transition">
<v-card>
<v-toolbar dark color="primary">
<v-btn icon dark @click="dialog = false" class="ml-2">
<v-icon>mdi-close</v-icon>
</v-btn>
<v-toolbar-title>流程编辑</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark text @click="doUiAction(dialogSaveInfoAction)">
保存
</v-btn>
</v-toolbar-items>
</v-toolbar>
<v-list three-line subheader>
<v-row class="pa-0 ma-0 pa-xs-4 pb-xs-4 flex-none">
<v-col cols="12" sm="12" md="3" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<span style="color: #3F4254;" :style="{'line-height': isMobile ? '20px' : '42px', 'font-weight': isMobile ? 400 : 500}">流程名</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="流程名" v-model="editItem['workflowName']" :rules="requireRules">
</v-text-field>
</v-col>
<v-col cols="12" sm="12" md="3" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<span style="color: #3F4254;" :style="{'line-height': isMobile ? '20px' : '42px', 'font-weight': isMobile ? 400 : 500}">分类</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="分类" v-model="editItem['workflowCategory']" :rules="requireRules">
</v-text-field>
</v-col>
<v-col cols="12" sm="12" md="3" xl="3" class="pa-xs-0 pb-xs-4 pb-3">
<span style="color: #3F4254;" :style="{'line-height': isMobile ? '20px' : '42px', 'font-weight': isMobile ? 400 : 500}">备注</span>
<v-text-field class="cus-v-input mr-2" dense filled single-line label="备注" v-model="editItem['workflowRemark']">
</v-text-field>
</v-col>
</v-row>
</v-list>
<v-divider></v-divider>
<v-list three-line subheader>
<v-subheader>模板设置</v-subheader>
<v-list-item>
<tpl-form-design v-if="dialog" :form="editItem.workflowForm">
</tpl-form-design>
</v-list-item>
</v-list>
<v-list three-line subheader>
<v-subheader>流程设置</v-subheader>
<v-list-item>
<process-flow v-if="dialog" :data="editItem.workflowConfig" :user="constantCollection.userList" :group="constantCollection.groupList" :tpl="constantCollection.workflowFormList">
</process-flow>
</v-list-item>
</v-list>
</v-card>
</v-dialog>
<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('startCreateItem')">新增</v-btn>
<span class="body-2">共{{ tableData.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="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 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 %}
{% include 'component/flow/processFlow.html' %}
{% include 'component/flow/editFlow.html' %}
{% include 'component/flow/editLine.html' %}
{% include 'component/flow/editNode.html' %}
{% include 'component/flow/flowNode.html' %}
{% include 'component/tpl/tplFormDesign.html' %}
{% include 'component/tpl/formItemListGenerator.html' %}
{% include 'component/tpl/formItemListRender.html' %}
<script type="module">
new Vue({
@@ -130,16 +52,9 @@ new Vue({
mixins: [window.jianghuUiActionMixins],
data: () => ({
// 表格相关数据
isFormValid: true,
requireRules: [
v => !!v || 'This is required',
],
constantCollection: {
userList: [],
groupList: [],
workflowFormList: []
},
serverSearchInput: {
studentId: null,
classId: null
@@ -151,14 +66,14 @@ new Vue({
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: "workFlowRemark", width: 120},
{text: "流程ID", value: "workflowId", width: 120},
{text: "流程名", value: "workflowName", width: 120},
{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'},
{text: '操作', value: 'action', align: 'center', sortable: false, width: 160, class: 'fixed', cellClass: 'fixed'},
],
currentClickButton: {title: '新增', action: 'add'},
@@ -180,68 +95,20 @@ new Vue({
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
computedEditItem() {
return this.editItem;
},
},
watch: {
'editItem.workflowForm': {
handler(val) {
if (!val) return
this.constantCollection.workflowFormList = [];
for(const item of val) {
this.constantCollection.workflowFormList.push({
text: item.component.outline,
value: item.id
})
}
if (!this.editItem.workflowConfig) return;
for (const config of this.editItem.workflowConfig.nodeList) {
if (!config.formId) return;
const formId = []
for(const item of config.formId) {
if (!this.constantCollection.workflowFormList.find(e => e.value === item)) {
formId.push(item)
}
}
config.formId = formId
console.log(config.outline, config.formId)
}
},
deep: true,
immediate: true
}
},
async created() {
await this.doUiAction('refreshTableData');
this.getUserList();
this.getGroupList();
},
mounted() {},
mounted() {
},
methods: {
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,
}
if (this.editItem.id) {
item.id = this.editItem.id;
}
return item;
},
/**
* 获取表格数据
*/
async refreshTableData() {
this.isTableLoading = true;
const serverSearchInput = _.pickBy(this.serverSearchInput, value=> !!value);
const { data: { appData: { rows } } } = await window.jianghuAxios({
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
const {data: {appData: {rows}}} = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
@@ -253,7 +120,7 @@ new Vue({
}
}
});
for(const item of rows) {
for (const item of rows) {
item.workflowConfig = item.workflowConfig ? JSON.parse(item.workflowConfig) : null;
item.workflowForm = item.workflowForm ? JSON.parse(item.workflowForm) : [];
}
@@ -261,127 +128,17 @@ new Vue({
this.isTableLoading = false;
},
/**
* 获取表格数据
*/
async getUserList() {
const { data: { appData: { rows } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectUserList',
actionData: {},
where: {},
}
}
});
this.constantCollection.userList = rows.map(e => {
return {text: e.username, value: e.userId}
})
},
/**
* 获取表格数据
*/
async getGroupList() {
const { data: { appData: { rows } } } = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectGroupList',
actionData: {},
where: {},
}
}
});
this.constantCollection.groupList = rows.map(e => {
return {text: e.groupName, value: e.groupId}
});
},
// startCreateItem
async clearItemData() {
this.editItem = { workflowForm: [], workflowConfig: {lineList: [], nodeList:[]} };
},
async openCreateItemDialog() {
this.currentClickButton = {action: 'add', title: '新增'};
// this.isEditDrawerShow = true;
this.dialog = true;
this.dialogSaveInfoAction = 'createItem';
},
// createItem
async confirmCreateItemDialog() {
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
},
validate() {
if (!this.editItem.workflowId || !this.editItem.workflowId) {
}
},
/**
* 新增数据
*/
async doCreateItem() {
delete this.computedEditItem.id;
const item = this.buildEditItem();
await window.vtoast.loading("新增数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'insertItem',
actionData: item
}
}
})
await window.vtoast.success("新增数据成功");
},
async closeDrawerShow() {
// this.isEditDrawerShow = false;
this.dialog = false;
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=add`;
},
// startUpdateItem
async prepareItemData({item}) {
this.editItem = item;
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=edit`;
},
async openUpdateDialog() {
this.currentClickButton = {action: 'edit', title: '修改'};
// this.isEditDrawerShow = true;
this.dialog = true;
this.dialogSaveInfoAction = 'updateItem';
},
// updateItem
async confirmUpdateItemDialog() {
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
},
/**
* 保存数据
*/
async doUpdateItem() {
const {id, ...item} = this.buildEditItem();
await window.vtoast.loading("修改数据");
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'updateItem',
actionData: item,
where: {id: id}
}
}
})
await window.vtoast.success("修改数据成功");
},
// updateItem
async confirmDeleteItemDialog() {
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
},
@@ -390,7 +147,7 @@ new Vue({
* 删除数据
*/
async doDeleteItem({item}) {
const { id } = item;
const {id} = item;
await window.vtoast.loading("删除数据");
await window.jianghuAxios({
data: {
@@ -398,29 +155,22 @@ new Vue({
pageId: 'workflowManagement',
actionId: 'deleteItem',
actionData: {},
where: { id: id }
where: {id: id}
}
}
});
await window.vtoast.success("删除数据成功");
},
getConstantCollectionItemText(key, _value) {
const constantCollectionItemFind = this.constantCollection[key].find(({value}) => value === _value);
if(constantCollectionItemFind) {
return constantCollectionItemFind.text;
}
return value;
}
}
})
</script>
<style scoped>
.v-dialog--fullscreen .v-sheet {
height: unset;
top: unset;
position: unset;
background: white;
}
.v-dialog--fullscreen .v-sheet {
height: unset;
top: unset;
position: unset;
background: white;
}
</style>
{% endblock %}