ui 优化

This commit is contained in:
zenglh committed 2023-09-06 17:23:30 +08:00
1 parent c0270b7f6a
commit e7ea27cf6b
8 files changed
+113 -125

No files matched your search

+15 -15
View File
@@ -1,28 +1,28 @@
<template id="edit-line"> <template id="edit-line">
<v-form v-model="isFormValid" ref="dataForm" lazy-validation> <v-form v-model="isFormValid" ref="dataForm" lazy-validation>
<v-row class="px-2" :class="{'pb-7': isMobile}"> <v-row>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">GUID</span> <span class="jh-input-label">GUID</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line disabled label="GUID" v-model="line.id"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line disabled label="GUID" v-model="line.id"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">源活动</span> <span class="jh-input-label">源活动</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line disabled label="源活动" v-model="line.from"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line disabled label="源活动" v-model="line.from"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">目标活动</span> <span class="jh-input-label">目标活动</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line disabled label="目标活动" v-model="line.to"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line disabled label="目标活动" v-model="line.to"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">名称</span> <span class="jh-input-label">名称</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line label="名称" v-model="line.label"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="名称" v-model="line.label"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3" v-if="mode == 'serial'"> <v-col cols="12" class=" pb-3" v-if="mode == 'serial'">
<span class="inputLabel">操作类型</span> <span class="jh-input-label">操作类型</span>
<v-select <v-select
:items="lineTypeList" :items="lineTypeList"
dense filled single-line dense filled single-line
class="jh-v-input mr-2" class="jh-v-input"
label="操作类型" label="操作类型"
color="success" color="success"
item-color="success" item-color="success"
@@ -30,12 +30,12 @@
></v-select> ></v-select>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">执行Hook</span> <span class="jh-input-label">执行Hook</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line label="执行Hook" v-model="line.hook"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="执行Hook" v-model="line.hook"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12" class=" pb-3">
<span class="inputLabel">备注说明</span> <span class="jh-input-label">备注说明</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line label="备注说明" v-model="line.Remark"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="备注说明" v-model="line.Remark"></v-text-field>
</v-col> </v-col>
</v-row> </v-row>
</v-form> </v-form>
+24 -24
View File
@@ -1,22 +1,22 @@
<template id="edit-node"> <template id="edit-node">
<v-form v-model="isFormValid" ref="dataForm" lazy-validation> <v-form v-model="isFormValid" ref="dataForm" lazy-validation>
<v-row class="px-2" :class="{'pb-7': isMobile}"> <v-row>
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">GUID</span> <span class="jh-input-label">GUID</span>
<v-text-field class="jh-v-input" dense filled single-line disabled label="GUID" v-model="node.id"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line disabled label="GUID" v-model="node.id"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">名称</span> <span class="jh-input-label">名称</span>
<v-text-field class="jh-v-input" dense filled single-line label="名称" v-model="node.label"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="名称" v-model="node.label"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">备注说明</span> <span class="jh-input-label">备注说明</span>
<v-text-field class="jh-v-input" dense filled single-line label="备注说明" v-model="node.Remark"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="备注说明" v-model="node.Remark"></v-text-field>
</v-col> </v-col>
<template v-if="!node.id.includes('start-') && !node.id.includes('end-')"> <template v-if="!node.id.includes('start-') && !node.id.includes('end-')">
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">指派类型</span> <span class="jh-input-label">指派类型</span>
<v-select <v-select
:items="assignTypeList" :items="assignTypeList"
@@ -30,10 +30,10 @@
v-model="node.assignType" v-model="node.assignType"
></v-select> ></v-select>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">指派</span> <span class="jh-input-label">指派</span>
<v-autocomplete <v-autocomplete
class="jh-v-input mr-2" class="jh-v-input"
dense filled single-line clearable dense filled single-line clearable
:items="optionList" :items="optionList"
item-text="text" item-text="text"
@@ -44,12 +44,12 @@
:disabled="!node.assignType"> :disabled="!node.assignType">
</v-autocomplete> </v-autocomplete>
</v-col> </v-col>
<v-col cols="12" class=" pb-3" v-if="mode == 'serial'"> <v-col cols="12" v-if="mode == 'serial'">
<span class="inputLabel">允许的操作(英文逗号分隔)</span> <span class="jh-input-label">允许的操作(英文逗号分隔)</span>
<v-text-field class="jh-v-input" dense filled single-line label="允许的操作(英文逗号分隔)" v-model="node.lineTypeList"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="允许的操作(英文逗号分隔)" v-model="node.lineTypeList"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3" > <v-col cols="12" >
<span class="inputLabel">可写模板</span> <span class="jh-input-label">可写模板</span>
<v-select <v-select
:items="tpl" :items="tpl"
dense filled single-line dense filled single-line
@@ -63,8 +63,8 @@
v-model="node.formIdEdit" v-model="node.formIdEdit"
></v-select> ></v-select>
</v-col> </v-col>
<v-col cols="12" class=" pb-3" > <v-col cols="12" >
<span class="inputLabel">隐藏模板</span> <span class="jh-input-label">隐藏模板</span>
<v-select <v-select
:items="tpl" :items="tpl"
dense filled single-line dense filled single-line
@@ -80,13 +80,13 @@
</v-col> </v-col>
</template> </template>
<template v-if="node.id.includes('end-')"> <template v-if="node.id.includes('end-')">
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">流程完成Hook</span> <span class="jh-input-label">流程完成Hook</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line label="流程完成Hook" v-model="node.finishHook"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="流程完成Hook" v-model="node.finishHook"></v-text-field>
</v-col> </v-col>
<v-col cols="12" class=" pb-3"> <v-col cols="12">
<span class="inputLabel">流程中断Hook</span> <span class="jh-input-label">流程中断Hook</span>
<v-text-field class="jh-v-input mr-2" dense filled single-line label="流程中断Hook" v-model="node.interruptHook"></v-text-field> <v-text-field class="jh-v-input" dense filled single-line label="流程中断Hook" v-model="node.interruptHook"></v-text-field>
</v-col> </v-col>
</template> </template>
</v-row> </v-row>
+42 -64
View File
@@ -1,36 +1,36 @@
<template id="process-flow"> <template id="process-flow">
<v-card class="process-flow-container"> <v-card class="process-flow-container">
<v-card v-if="!readonly" class="flow-menu pa-4 ma-2" width="140px"> <!-- 左侧 节点选择列表 >>>>>>>>>>>>> -->
<div class="menu-item mb-3" v-for="item in menuList" @mousedown.stop.prevent="startDrag(item)"> <v-card v-if="!readonly" :style="{'width': isMobile ? '100%' : '150px'}" outlined
<i :class="item.icon"></i> :class="{'pa-4': !isMobile, 'pa-2': isMobile, 'mr-2': !isMobile}" outlined>
<div>{{item.name}}</div> <div class="menu-item mb-2" v-for="item in menuList" @mousedown.stop.prevent="startDrag(item)">
<v-icon small class="mr-1">{{ item.icon }}</v-icon>
{{item.name}}
</div> </div>
</v-card> </v-card>
<v-card class="flow-detail pa-0 my-2"> <!-- <<<<<<<<<<<<< 左侧 节点选择列表 -->
<!-- 中间 主内容编辑区 >>>>>>>>>>>>> -->
<v-card class="flow-detail pa-4" outlined>
<div id="flowContent" ref="flowContent"></div> <div id="flowContent" ref="flowContent"></div>
</v-card> </v-card>
<v-card v-show="!readonly" class="flow-edit pa-2 ma-2"> <!-- <<<<<<<<<<<<< 中间 主内容编辑区 -->
<template v-if="editType == 'node' || editType == 'line'">
<div class="mb-3"> <!-- 右侧 属性编辑区 >>>>>>>>>>>>> -->
<v-icon>mdi-application-edit-outline</v-icon> <v-card v-show="!readonly" :style="{'width': isMobile ? 'auto' : '300px'}" class="pa-4" :class="{'ml-2': !isMobile}" outlined>
<span style="transform: translateY(2px); display: inline-block; ">{{editType == 'node' ? '节点' : '连线'}}属性</span> <div class="font-weight-medium text-subtitle-2 text-subtitle-2 mb-3">
<v-icon size="18" class="mr-1">mdi-application-cog-outline</v-icon>
<span style="transform: translateY(2px); display: inline-block;">{{editType == 'node' ? '节点属性' : editType == 'line' ? '连线属性' : '属性面板'}}</span>
</div> </div>
<div class="flow-edit-content"> <div v-if="editType == 'node' || editType == 'line'" class="flow-edit-content">
<edit-node ref="nodeForm" v-if="editType == 'node'" :lf="logicFlow" :user="user" :group="group" :mode="mode" :tpl="tpl"></edit-node> <edit-node ref="nodeForm" v-if="editType == 'node'" :lf="logicFlow" :user="user" :group="group" :mode="mode" :tpl="tpl"></edit-node>
<edit-line ref="lineForm" v-if="editType == 'line'" :lf="logicFlow" :mode="mode"></edit-line> <edit-line ref="lineForm" v-if="editType == 'line'" :lf="logicFlow" :mode="mode"></edit-line>
</div> </div>
</template> <div v-else class="text-center mt-8">
<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>
<div style="text-align: center;line-height: 100px; color: #999999">
请选择节点或连接线
</div>
</template>
</v-card> </v-card>
<!-- <<<<<<<<<<<<< 右侧 属性编辑区 -->
</v-card> </v-card>
</template> </template>
@@ -94,10 +94,10 @@ Vue.component("process-flow", {
data: () => { data: () => {
return { return {
menuList: [ menuList: [
{name: '起点', type: 'start', icon: 'el-icon-help'}, {name: '起点', type: 'start', icon: 'mdi-ray-start'},
{name: '终点', type: 'end', icon: 'el-icon-s-help'}, {name: '终点', type: 'end', icon: 'mdi-ray-end'},
{name: '审批节点', type: 'userTask', icon: 'el-icon-user'}, {name: '审批节点', type: 'userTask', icon: 'mdi-account-details-outline'},
{name: '处理节点', type: 'receiveTask', icon: 'el-icon-s-tools'}, {name: '处理节点', type: 'receiveTask', icon: 'mdi-account-check-outline'},
], ],
logicFlow: null, // logicflow实例 logicFlow: null, // logicflow实例
// 是否加载完毕 // 是否加载完毕
@@ -115,6 +115,11 @@ Vue.component("process-flow", {
this.logicFlow.clearData(); this.logicFlow.clearData();
} }
}, },
computed: {
isMobile() {
return window.innerWidth < 600;
},
},
mounted() { mounted() {
}, },
methods: { methods: {
@@ -509,11 +514,7 @@ Vue.component("process-flow", {
.flow-detail { .flow-detail {
flex: 1; flex: 1;
border: 1px solid #EBEEF5;
padding: 12px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
word-break: break-all; word-break: break-all;
border-radius: 4px;
position: relative; position: relative;
} }
@@ -534,51 +535,28 @@ Vue.component("process-flow", {
border: 1px solid #007AFF; border: 1px solid #007AFF;
} }
.flow-menu {
width: 100px;
border: 1px solid #EBEEF5;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
word-break: break-all;
border-radius: 4px;
}
.menu-item { .menu-item {
text-align: center; padding: 8px 10px;
margin-bottom: 8px;
cursor: pointer;
font-size: 14px;
color: #606266;
background: #f5f8fa; background: #f5f8fa;
padding: 5px 0; font-size: 12px;
border-radius: 5px; cursor: move;
border: 1px dashed #f5f8fa;
border-radius: 3px;
} }
.menu-item:hover { .menu-item:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border: 1px dashed #4caf50;
background: #f5f8fa;
color: #4caf50;
} }
.menu-item > i { .menu-item:hover .v-icon {
font-size: 30px; color: #4caf50;
}
.flow-edit {
width: 300px;
padding: 0 10px;
max-height: 100%;
min-height: 100%;
overflow-x: hidden;
overflow-y: auto;
} }
.flow-edit-content { .flow-edit-content {
min-height: 100%; max-height: 95%;
color: #606266; overflow-y: auto;
line-height: 1.4;
text-align: justify;
font-size: 14px;
padding: 12px;
word-break: break-all;
border-radius: 4px;
} }
.lf-control-item i { .lf-control-item i {
+3 -1
View File
@@ -30,6 +30,7 @@
v-model="formItem.answer" v-model="formItem.answer"
:items="formItem.optionList" :items="formItem.optionList"
dense single-line filled dense single-line filled
class="jh-v-input"
:rules="validationRules.requireRules" :rules="validationRules.requireRules"
:readonly="typeof readonly == 'boolean'? readonly: readonly.indexOf(formItem.id) > -1" :readonly="typeof readonly == 'boolean'? readonly: readonly.indexOf(formItem.id) > -1"
></v-select> ></v-select>
@@ -41,6 +42,7 @@
:items="formItem.optionList" :items="formItem.optionList"
multiple multiple
dense single-line filled dense single-line filled
class="jh-v-input"
:rules="validationRules.requireRules" :rules="validationRules.requireRules"
:readonly="typeof readonly == 'boolean'? readonly: readonly.indexOf(formItem.id) > -1" :readonly="typeof readonly == 'boolean'? readonly: readonly.indexOf(formItem.id) > -1"
></v-select> ></v-select>
@@ -59,7 +61,7 @@
<v-menu v-if="formItem.type === 'date'" class="jh-v-input" :close-on-content-click="false" v-model="isDataPickerShown" <v-menu v-if="formItem.type === 'date'" class="jh-v-input" :close-on-content-click="false" v-model="isDataPickerShown"
transition="scale-transition" offset-y min-width="auto"> transition="scale-transition" offset-y min-width="auto">
<template v-slot:activator="{on, attrs}"> <template v-slot:activator="{on, attrs}">
<v-text-field class="jh-v-input" dense single-line filled readonly v-on="on" v-bind="attr" label="出生日期" v-model="formItem.answer" <v-text-field class="jh-v-input" dense single-line filled readonly v-on="on" v-bind="attrs" label="出生日期" v-model="formItem.answer"
:rules="validationRules.requireRules" :readonly="readonly"></v-text-field> :rules="validationRules.requireRules" :readonly="readonly"></v-text-field>
</template> </template>
<v-date-picker color="green lighten-1" elevation="20" @input="isDataPickerShown = false" v-model="formItem.answer"></v-date-picker> <v-date-picker color="green lighten-1" elevation="20" @input="isDataPickerShown = false" v-model="formItem.answer"></v-date-picker>
+5 -6
View File
@@ -4,6 +4,11 @@
<!-- 抽屉标题 --> <!-- 抽屉标题 -->
<v-row> <v-row>
<span class="title pa-6 pl-8">流程编辑</span> <span class="title pa-6 pl-8">流程编辑</span>
<!-- 抽屉操作按钮 -->
<v-row class="justify-end mx-0 mt-6 px-8">
<v-btn color="success" @click="doUiAction(submitUiActionId)" small>保存</v-btn>
<v-btn class="elevation-0 ml-2" @click="isDrawerShown = false" small>取消</v-btn>
</v-row>
</v-row> </v-row>
<div class="px-6"> <div class="px-6">
@@ -50,12 +55,6 @@
</v-form> </v-form>
</div> </div>
<!--抽屉操作按钮-->
<v-row class="mx-0 justify-end my-4" :class="{'px-4': isMobile, 'px-6': !isMobile, 'mb-8': isMobile}">
<v-btn color="success" @click="doUiAction(submitUiActionId)" small>保存</v-btn>
<v-btn class="elevation-0 ml-2" @click="isDrawerShown = false" small>取消</v-btn>
</v-row>
<!-- 抽屉关闭按钮 --> <!-- 抽屉关闭按钮 -->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn" @click="isDrawerShown = false"> <v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn" @click="isDrawerShown = false">
<v-icon>mdi-close</v-icon> <v-icon>mdi-close</v-icon>
+12 -5
View File
@@ -89,24 +89,31 @@
</v-data-table> </v-data-table>
</v-card> </v-card>
<!-- <<<<<<<<<<<<< 页面内容 --> <!-- <<<<<<<<<<<<< 页面内容 -->
<!--编辑抽屉--> <!--编辑抽屉-->
<v-navigation-drawer v-model="isViewDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%" <v-navigation-drawer v-model="isViewDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%"
class="elevation-24"> class="elevation-24">
<v-form v-if="isViewDrawerShown" ref="updateForm" lazy-validation> <v-form v-if="isViewDrawerShown" ref="updateForm" lazy-validation>
<!--抽屉标题--> <!--抽屉标题-->
<v-row class="ma-0"> <v-row class="ma-0">
<span class="text-h6 pa-4">历史审核记录</span> <span class="title pa-4">历史审核记录</span>
</v-row> </v-row>
<!--抽屉表单--> <!--抽屉表单-->
<v-row class="mt-0 px-4"> <v-row class="mt-0 px-4" >
<v-col cols="12" sm="12" v-for="(item, index) in viewItem.taskFormInput.formList" :key="index"> <v-col cols="12" sm="12" md="4" class="py-0" v-for="(item, index) in viewItem.taskFormInput.formList" :key="index">
<form-item :form-item="item" readonly></form-item> <form-item :form-item="item" readonly></form-item>
</v-col> </v-col>
</v-row> </v-row>
<span class="jh-input-label px-4">审核申请信息</span>
<task-history :task-id="viewItem.taskId"></task-history>
</v-form> </v-form>
<!-- 审核申请信息 -->
<v-row class="mt-8">
<v-col cols="12" sm="12" md="12">
<div class="text-subtitle-2 mb-2 mx-4">审核申请信息</div>
<task-history :task-id="viewItem.taskId"></task-history>
</v-col>
</v-row>
<!--抽屉关闭按钮--> <!--抽屉关闭按钮-->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn" <v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
@click="isViewDrawerShown = false"> @click="isViewDrawerShown = false">
+11 -9
View File
@@ -120,9 +120,15 @@
<!--抽屉标题--> <!--抽屉标题-->
<v-row class="ma-0"> <v-row class="ma-0">
<span class="title pa-4">审核信息</span> <span class="title pa-4">审核信息</span>
<!-- 抽屉操作按钮 -->
<v-row class="justify-end mx-0 mt-4 px-4">
<v-btn :color="lineTypeItem.type === '拒绝' ? 'error' : 'success'" small class="ml-2" v-for="lineTypeItem in lineTypeList" v-if="lineTypeItem.type" @click="doUiAction('submitNode', lineTypeItem.type)">
{{ lineTypeItem.type }}
</v-btn>
</v-row>
</v-row> </v-row>
<!--抽屉表单--> <!--抽屉表单-->
<v-row class="mt-0 px-4"> <v-row class="mt-0 px-4" >
<v-col cols="12" sm="12" md="4" v-for="(formItem, index) in updateItem.taskFormInput.formList" :key="index"> <v-col cols="12" sm="12" md="4" v-for="(formItem, index) in updateItem.taskFormInput.formList" :key="index">
<form-item :form-item="formItem" :readonly="updateItem.readonlyFormIdList"></form-item> <form-item :form-item="formItem" :readonly="updateItem.readonlyFormIdList"></form-item>
</v-col> </v-col>
@@ -133,16 +139,12 @@
v-model="updateItem.taskComment" :readonly="workflowType != 'todo'"></v-textarea> v-model="updateItem.taskComment" :readonly="workflowType != 'todo'"></v-textarea>
</v-col> </v-col>
</v-row> </v-row>
<!--抽屉操作按钮-->
<v-row class="justify-end mx-0 mt-8 px-6">
<v-btn color="success" small class="ml-4" v-for="lineTypeItem in lineTypeList" v-if="lineTypeItem.type" @click="doUiAction('submitNode', lineTypeItem.type)">
{{ lineTypeItem.type }}
</v-btn>
</v-row>
</v-form> </v-form>
<v-row class="mt-0">
<!-- 审核历史 -->
<v-row class="mt-8">
<v-col cols="12" sm="12" md="12"> <v-col cols="12" sm="12" md="12">
<span class="jh-input-label px-4">审核历史</span> <div class="text-subtitle-2 mb-2 mx-4">审核历史</div>
<task-history :task-id="updateItem.taskId" @line-type-list="setLineTypeList"></task-history> <task-history :task-id="updateItem.taskId" @line-type-list="setLineTypeList"></task-history>
</v-col> </v-col>
</v-row> </v-row>
+1 -1
View File
@@ -93,7 +93,7 @@
</v-row> </v-row>
<!--抽屉表单主体--> <!--抽屉表单主体-->
<v-row class="mt-0 px-6"> <v-row class="mt-0 px-6">
<v-col cols="12" sm="12" md="4" v-for="(item, index) in currentWorkflowForm" :key="index"> <v-col cols="12" sm="12" :md="item.type === 'short' ? 12 : 4" v-for="(item, index) in currentWorkflowForm" :key="index">
<form-item :form-item="item"></form-item> <form-item :form-item="item"></form-item>
</v-col> </v-col>
<v-col cols="12" sm="12" md="12"> <v-col cols="12" sm="12" md="12">