This commit is contained in:
yuebenshan committed 2023-02-14 14:07:14 +08:00
1 parent 141bbda958
commit 959f4b55e8
5 files changed
+380 -431

No files matched your search

+17 -32
View File
@@ -58,15 +58,13 @@
</template> </template>
<!--表格底部右侧功能按钮--> <!--表格底部右侧功能按钮-->
<template v-slot:footer.prepend> <template v-slot:footer.prepend>
<v-btn icon @click="doUiAction('openTableZebraLineMenu', $event)"> <v-menu top offset-y :close-on-content-click="false">
<v-icon>mdi-menu</v-icon> <template v-slot:activator="{on, attrs}">
</v-btn> <v-btn icon v-bind="attrs" v-on="on">
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> <v-icon>mdi-menu</v-icon>
<v-list> </v-btn>
<v-list-item> </template>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
</v-list-item>
</v-list>
</v-menu> </v-menu>
</template> </template>
<!--表格底部右侧分页--> <!--表格底部右侧分页-->
@@ -98,23 +96,23 @@
<v-text-field class="cus-v-input " dense filled single-line hide-details v-model="node.label" disabled></v-text-field> <v-text-field class="cus-v-input " dense filled single-line hide-details v-model="node.label" disabled></v-text-field>
</v-col> </v-col>
<v-col cols="4"> <v-col cols="4">
<v-autocomplete <v-autocomplete
class="cus-v-input mr-2" class="cus-v-input mr-2"
dense filled single-line clearable dense filled single-line clearable
:items="userList" :items="userList"
item-text="username" item-text="username"
item-value="userId" item-value="userId"
multiple multiple
hide-details hide-details
:rules="validationRules.requireRules" :rules="validationRules.requireRules"
v-model="node.assignValue"> v-model="node.assignValue">
</v-autocomplete> </v-autocomplete>
</v-col> </v-col>
<v-col cols="4"> <v-col cols="4">
<v-checkbox dense filled v-model="node.isNeedAllApproval" label="是否需要所有人审批" hide-details ></v-checkbox> <v-checkbox dense filled v-model="node.isNeedAllApproval" label="是否需要所有人审批" hide-details ></v-checkbox>
</v-col> </v-col>
</v-row> </v-row>
</v-col> </v-col>
</v-row> </v-row>
@@ -200,8 +198,6 @@
searchInput: '', searchInput: '',
isHelpPageDrawerShown: false, isHelpPageDrawerShown: false,
isTableZebraLineShown: true, isTableZebraLineShown: true,
isTableZebraLineMenuShown: false,
tableZebraLineMenuPosition: {x: null, y: null},
isCreateDrawerShown: false, isCreateDrawerShown: false,
createFormList: [], createFormList: [],
@@ -221,9 +217,6 @@
case 'getTableData': case 'getTableData':
await this.getTableData(); await this.getTableData();
break; break;
case 'openTableZebraLineMenu':
await this.openTableZebraLineMenu(uiActionData);
break;
case 'startCreateWorkflow': case 'startCreateWorkflow':
await this.prepareCreateFormData(uiActionData); await this.prepareCreateFormData(uiActionData);
await this.openCreateDrawer(); await this.openCreateDrawer();
@@ -268,7 +261,7 @@
row.workflowPersonList = workflowNodeList.filter(node => node.id.includes('userTask-')); row.workflowPersonList = workflowNodeList.filter(node => node.id.includes('userTask-'));
row.workflowForm = JSON.parse(row.workflowForm); row.workflowForm = JSON.parse(row.workflowForm);
}); });
this.tableData = rows; this.tableData = rows;
this.isTableLoading = false; this.isTableLoading = false;
}, },
@@ -288,14 +281,6 @@
const userList = result.data.appData.resultData.rows; const userList = result.data.appData.resultData.rows;
this.userList = userList; this.userList = userList;
}, },
// ---------- <<<<<<<<<< 斑马纹开关 uiAction --------
async openTableZebraLineMenu(funObj) {
this.tableZebraLineMenuPosition.x = funObj.x -funObj.offsetX + 10;
this.tableZebraLineMenuPosition.y = window.innerHeight - 50;
this.isTableZebraLineMenuShown = !this.isTableZebraLineMenuShown;
},
// ---------- 斑马纹开关 uiAction >>>>>>>>>> --------
// ---------- <<<<<<<<<< 申请项目审核 -------- // ---------- <<<<<<<<<< 申请项目审核 --------
async prepareCreateFormData({workflowForm, workflowPersonList, workflowId}) { async prepareCreateFormData({workflowForm, workflowPersonList, workflowId}) {
@@ -333,7 +318,7 @@
async doCreateWork() { async doCreateWork() {
await window.jhMask.show(); await window.jhMask.show();
await window.jianghuAxios({ await window.jianghuAxios({
data: { data: {
appData: { appData: {
@@ -360,7 +345,7 @@
sessionStorage.setItem('workflowEditItem', JSON.stringify(item)) sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`; window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`;
}, },
jumpToCreateWorkflow() { jumpToCreateWorkflow() {
window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor'; window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor';
} }
@@ -386,6 +371,6 @@
flex: auto; flex: auto;
} }
} }
</style> </style>
{% endblock %} {% endblock %}
+10 -24
View File
@@ -47,14 +47,14 @@
</template> </template>
<template v-slot:item.taskStatus="{ item }"> <template v-slot:item.taskStatus="{ item }">
<v-chip <v-chip
v-if="item.taskStatus === '已结束'" v-if="item.taskStatus === '已结束'"
color="red" color="red"
small dark small dark
> >
{{item.taskStatus}} {{item.taskStatus}}
</v-chip> </v-chip>
<v-chip <v-chip
v-else v-else
color="green" color="green"
small dark small dark
> >
@@ -71,15 +71,13 @@
</template> </template>
<!--表格底部右侧功能按钮--> <!--表格底部右侧功能按钮-->
<template v-slot:footer.prepend> <template v-slot:footer.prepend>
<v-btn icon @click="doUiAction('openTableZebraLineMenu', $event)"> <v-menu top offset-y :close-on-content-click="false">
<v-icon>mdi-menu</v-icon> <template v-slot:activator="{on, attrs}">
</v-btn> <v-btn icon v-bind="attrs" v-on="on">
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> <v-icon>mdi-menu</v-icon>
<v-list> </v-btn>
<v-list-item> </template>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
</v-list-item>
</v-list>
</v-menu> </v-menu>
</template> </template>
<!--表格底部右侧分页--> <!--表格底部右侧分页-->
@@ -175,8 +173,6 @@
isHelpPageDrawerShown: false, isHelpPageDrawerShown: false,
// 表格相关数据 // 表格相关数据
isTableZebraLineMenuShown: false,
tableZebraLineMenuPosition: {x: null, y: null},
isTableZebraLineShown: true, isTableZebraLineShown: true,
// 生日日期选择 // 生日日期选择
validationRules: { validationRules: {
@@ -219,9 +215,6 @@
case 'openDataPicker': case 'openDataPicker':
await this.openDataPicker(uiActionData); await this.openDataPicker(uiActionData);
break; break;
case 'openTableZebraLineMenu':
await this.openTableZebraLineMenu(uiActionData);
break;
case 'startUpdateItem': case 'startUpdateItem':
await this.prepareUpdateFormData(uiActionData); await this.prepareUpdateFormData(uiActionData);
await this.openUpdateDrawer(); await this.openUpdateDrawer();
@@ -258,13 +251,6 @@
this.tableData = rows; this.tableData = rows;
this.isTableLoading = false; this.isTableLoading = false;
}, },
// ---------- 斑马纹开关 uiAction >>>>>>>>>> --------
async openTableZebraLineMenu(funObj) {
this.tableZebraLineMenuPosition.x = funObj.x -funObj.offsetX + 10;
this.tableZebraLineMenuPosition.y = window.innerHeight - 50;
this.isTableZebraLineMenuShown = !this.isTableZebraLineMenuShown;
},
// ---------- <<<<<<<<<< 斑马纹开关 uiAction --------
// ---------- 审核、查看 uiAction >>>>>>>>>>>> -------- // ---------- 审核、查看 uiAction >>>>>>>>>>>> --------
async prepareUpdateFormData(funObj) { async prepareUpdateFormData(funObj) {
this.updateItem = _.cloneDeep(funObj); this.updateItem = _.cloneDeep(funObj);
@@ -286,4 +272,4 @@
<style scoped> <style scoped>
</style> </style>
{% endblock %} {% endblock %}
s s
+7 -21
View File
@@ -109,15 +109,13 @@
</template> </template>
<!--表格底部右侧功能按钮--> <!--表格底部右侧功能按钮-->
<template v-slot:footer.prepend> <template v-slot:footer.prepend>
<v-btn icon @click="doUiAction('openTableZebraLineMenu', $event)"> <v-menu top offset-y :close-on-content-click="false">
<v-icon>mdi-menu</v-icon> <template v-slot:activator="{on, attrs}">
</v-btn> <v-btn icon v-bind="attrs" v-on="on">
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> <v-icon>mdi-menu</v-icon>
<v-list> </v-btn>
<v-list-item> </template>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
</v-list-item>
</v-list>
</v-menu> </v-menu>
</template> </template>
<!--表格底部右侧分页--> <!--表格底部右侧分页-->
@@ -226,8 +224,6 @@
isHelpPageDrawerShown: false, isHelpPageDrawerShown: false,
// 表格相关数据 // 表格相关数据
isTableZebraLineMenuShown: false,
tableZebraLineMenuPosition: {x: null, y: null},
isTableZebraLineShown: true, isTableZebraLineShown: true,
// 生日日期选择 // 生日日期选择
validationRules: { validationRules: {
@@ -276,9 +272,6 @@
case 'openDataPicker': case 'openDataPicker':
await this.openDataPicker(uiActionData); await this.openDataPicker(uiActionData);
break; break;
case 'openTableZebraLineMenu':
await this.openTableZebraLineMenu(uiActionData);
break;
case 'startUpdateItem': case 'startUpdateItem':
await this.prepareUpdateFormData(uiActionData); await this.prepareUpdateFormData(uiActionData);
await this.openUpdateDrawer(); await this.openUpdateDrawer();
@@ -342,13 +335,6 @@
}); });
this.historyData = rows; this.historyData = rows;
}, },
// ---------- 斑马纹开关 uiAction >>>>>>>>>> --------
async openTableZebraLineMenu(funObj) {
this.tableZebraLineMenuPosition.x = funObj.x -funObj.offsetX + 10;
this.tableZebraLineMenuPosition.y = window.innerHeight - 50;
this.isTableZebraLineMenuShown = !this.isTableZebraLineMenuShown;
},
// ---------- <<<<<<<<<< 斑马纹开关 uiAction --------
// ---------- 审核、查看 uiAction >>>>>>>>>>>> -------- // ---------- 审核、查看 uiAction >>>>>>>>>>>> --------
async prepareUpdateFormData(funObj) { async prepareUpdateFormData(funObj) {
this.updateItem = _.cloneDeep(funObj); this.updateItem = _.cloneDeep(funObj);
+344 -353
View File
@@ -3,156 +3,152 @@
{% block vueTemplate %} {% block vueTemplate %}
<script type="text/html" id="app-template"> <script type="text/html" id="app-template">
<div> <div>
<v-app mobile-breakpoint="sm"> <v-app mobile-breakpoint="sm">
<jh-menu /> <jh-menu />
<v-main class="mt-15"> <v-main class="mt-15">
<!-- 头部内容 >>>>>>>>>>>>> --> <!-- 头部内容 >>>>>>>>>>>>> -->
<div class="jh-page-second-bar px-8"> <div class="jh-page-second-bar px-8">
<div class="pt-3 text-h7 font-weight-bold">流程管理/发起任务 <div class="pt-3 text-h7 font-weight-bold">流程管理/发起任务
<!-- 帮助页按钮 --> <!-- 帮助页按钮 -->
<v-icon @click="isHelpPageDrawerShown = true" color="success" small>mdi-help-circle-outline</v-icon> <v-icon @click="isHelpPageDrawerShown = true" color="success" small>mdi-help-circle-outline</v-icon>
</div>
<v-breadcrumbs class="pb-3 pt-0 px-0" :items="breadcrumbs" divider="-"></v-breadcrumbs>
</div> </div>
<!-- <<<<<<<<<<<<< 头部内容 --> <v-breadcrumbs class="pb-3 pt-0 px-0" :items="breadcrumbs" divider="-"></v-breadcrumbs>
</div>
<!-- <<<<<<<<<<<<< 头部内容 -->
<div class="jh-page-body-container px-8"> <div class="jh-page-body-container px-8">
<!-- 页面内容 >>>>>>>>>>>>> --> <!-- 页面内容 >>>>>>>>>>>>> -->
<v-card class="rounded-lg"> <v-card class="rounded-lg">
<v-row class="ma-0 pa-4"> <v-row class="ma-0 pa-4">
<!--新增按钮--> <!--新增按钮-->
<v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pa-0"> <v-btn color="success" small class="elevation-0 mr-2" @click="doUiAction('jumpToCreateWorkflow')">新增
<v-btn color="success" small class="elevation-0 mr-2" </v-btn>
@click="doUiAction('jumpToCreateWorkflow')">新增</v-btn> <v-spacer></v-spacer>
</v-col> <!--搜索-->
<v-spacer></v-spacer> <v-col cols="12" xs="8" sm="4" md="3" xl="2" class="pa-0">
<!--搜索--> <v-text-field v-model="searchInput" color="success" prefix="搜索:" class="jh-v-input" dense filled single-line hide-details></v-text-field>
<v-col cols="12" xs="8" sm="4" md="3" xl="2" class="pa-0"> </v-col>
<v-text-field v-model="searchInput" color="success" prefix="搜索:" class="jh-v-input" dense filled single-line hide-details></v-text-field> </v-row>
</v-col> <!--表格-->
</v-row> <v-data-table
<!--表格--> :headers="headers"
<v-data-table :items="tableData"
:headers="headers" :search="searchInput"
:items="tableData" :footer-props="{ itemsPerPageOptions: [20, 50, -1], itemsPerPageText: '每页行数', itemsPerPageAllText: '所有'}"
:search="searchInput" :items-per-page="-1"
:footer-props="{ itemsPerPageOptions: [20, 50, -1], itemsPerPageText: '每页行数', itemsPerPageAllText: '所有'}" mobile-breakpoint="0"
:items-per-page="-1" :loading="isTableLoading"
mobile-breakpoint="0" :class="{'zebraLine': isTableZebraLineShown }"
:loading="isTableLoading" checkbox-color="success"
:class="{'zebraLine': isTableZebraLineShown }" fixed-header
checkbox-color="success" class="jh-fixed-table-height elevation-0 mt-0 mb-xs-4">
fixed-header <!--表格行操作按钮-->
class="jh-fixed-table-height elevation-0 mt-0 mb-xs-4"> <template v-slot:item.action="{ item }">
<!--表格行操作按钮--> <span role="button" class="success--text jh-font-size-3 pr-2"
<template v-slot:item.action="{ item }"> @click="doUiAction('startCreateWorkflow', item)">
<span role="button" class="success--text jh-font-size-3 pr-2" <v-icon size="14" class="success--text">mdi-note-edit-outline</v-icon>申请
@click="doUiAction('startCreateWorkflow', item)"> </span>
<v-icon size="14" class="success--text">mdi-note-edit-outline</v-icon>申请 <span role="button" class="success--text jh-font-size-3 pr-2"
</span>
<span role="button" class="success--text jh-font-size-3 pr-2"
@click="doUiAction('jumpUpdateWorkflow', item)"> @click="doUiAction('jumpUpdateWorkflow', item)">
<v-icon size="14" class="success--text">mdi-note-edit-outline</v-icon>编辑 <v-icon size="14" class="success--text">mdi-note-edit-outline</v-icon>编辑
</span> </span>
</template> </template>
<!--表格底部右侧功能按钮--> <!--表格底部右侧功能按钮-->
<template v-slot:footer.prepend> <template v-slot:footer.prepend>
<v-btn icon @click="doUiAction('openTableZebraLineMenu', $event)"> <v-menu top offset-y :close-on-content-click="false">
<v-icon>mdi-menu</v-icon> <template v-slot:activator="{on, attrs}">
</v-btn> <v-btn icon v-bind="attrs" v-on="on">
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> <v-icon>mdi-menu</v-icon>
<v-list> </v-btn>
<v-list-item> </template>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
</v-list-item> </v-menu>
</v-list> </template>
</v-menu> <!--表格底部右侧分页-->
</template> <template v-slot:footer.page-text="pagination">
<!--表格底部右侧分页--> <span>{{pagination.pageStart}}-{{pagination.pageStop}}</span>
<template v-slot:footer.page-text="pagination"> <span class="ml-1">共{{pagination.itemsLength}}条</span>
<span>{{pagination.pageStart}}-{{pagination.pageStop}}</span> </template>
<span class="ml-1">共{{pagination.itemsLength}}条</span> </v-data-table>
</template> </v-card>
</v-data-table> <!-- <<<<<<<<<<<<< 页面内容 -->
</v-card> </div>
<!-- <<<<<<<<<<<<< 页面内容 --> <!-- <<<<<<<<<<<<< 创建审批抽屉 -->
</div> <v-navigation-drawer v-model="isCreateDrawerShown" :permanent="isCreateDrawerShown" fixed temporary right width="80%"
<!-- <<<<<<<<<<<<< 创建审批抽屉 --> class="elevation-24">
<v-navigation-drawer v-model="isCreateDrawerShown" :permanent="isCreateDrawerShown" fixed temporary right width="80%" <v-form v-if="isCreateDrawerShown" ref="createForm" lazy-validation>
class="elevation-24"> <!--抽屉标题-->
<v-form v-if="isCreateDrawerShown" ref="createForm" lazy-validation> <v-row>
<!--抽屉标题--> <span class="title pa-6 pl-8">创建审批</span>
<v-row> </v-row>
<span class="title pa-6 pl-8">创建审批</span> <!--抽屉表单主体-->
</v-row> <v-row class="mt-0 px-6">
<!--抽屉表单主体--> <v-col cols="12" sm="12" md="4" v-for="(item, index) in createFormList" :key="index">
<v-row class="mt-0 px-6"> <form-item :form-item="item"></form-item>
<v-col cols="12" sm="12" md="4" v-for="(item, index) in createFormList" :key="index"> </v-col>
<form-item :form-item="item"></form-item> <v-col cols="12" sm="12" md="12">
</v-col> <span class="jh-input-label">审批流程 - 添加审批人</span>
<v-col cols="12" sm="12" md="12"> <v-row v-for="node in workflowPersonList">
<span class="jh-input-label">审批流程 - 添加审批人</span> <v-col cols="2">
<v-row v-for="node in workflowPersonList"> <v-text-field class="cus-v-input " dense filled single-line hide-details v-model="node.label" disabled></v-text-field>
<v-col cols="2"> </v-col>
<v-text-field class="cus-v-input " dense filled single-line hide-details v-model="node.label" disabled></v-text-field> <v-col cols="4">
</v-col> <v-autocomplete
<v-col cols="4"> class="cus-v-input mr-2"
<v-autocomplete dense filled single-line clearable
class="cus-v-input mr-2" :items="userList"
dense filled single-line clearable item-text="username"
:items="userList" item-value="userId"
item-text="username" multiple
item-value="userId" hide-details
multiple :rules="validationRules.requireRules"
hide-details v-model="node.assignValue">
:rules="validationRules.requireRules"
v-model="node.assignValue">
</v-autocomplete>
</v-col>
<v-col cols="4">
<v-checkbox dense filled v-model="node.isNeedAllApproval" label="是否需要所有人审批" hide-details ></v-checkbox>
</v-col>
</v-row>
</v-col>
</v-row>
<!--抽屉操作按钮-->
<v-row class="justify-end mx-0 mt-8 px-6">
<v-btn color="success" @click="doUiAction('createWorkflow')" small>保存</v-btn>
<v-btn class="ml-2" @click="isCreateDrawerShown = false" small>取消</v-btn>
</v-row>
</v-form>
<!--抽屉关闭按钮-->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
@click="isCreateDrawerShown = false">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-navigation-drawer>
<!-- 创建审批抽屉 >>>>>>>>>>>>> -->
<!-- 帮助页抽屉 >>>>>>>>>>>>> --> </v-autocomplete>
<v-navigation-drawer v-model="isHelpPageDrawerShown" fixed temporary right width="80%" hide-overlay </v-col>
class="elevation-24"> <v-col cols="4">
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#workflowManagement.md`" width="100%" <v-checkbox dense filled v-model="node.isNeedAllApproval" label="是否需要所有人审批" hide-details></v-checkbox>
height="100%"></iframe> </v-col>
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn" </v-row>
@click="isHelpPageDrawerShown = false"> </v-col>
<v-icon>mdi-close</v-icon> </v-row>
</v-btn> <!--抽屉操作按钮-->
</v-navigation-drawer> <v-row class="justify-end mx-0 mt-8 px-6">
<!-- <<<<<<<<<<<<< 帮助页抽屉 --> <v-btn color="success" @click="doUiAction('createWorkflow')" small>保存</v-btn>
<v-btn class="ml-2" @click="isCreateDrawerShown = false" small>取消</v-btn>
</v-row>
</v-form>
<!--抽屉关闭按钮-->
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
@click="isCreateDrawerShown = false">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-navigation-drawer>
<!-- 创建审批抽屉 >>>>>>>>>>>>> -->
</v-main> <!-- 帮助页抽屉 >>>>>>>>>>>>> -->
</v-app> <v-navigation-drawer v-model="isHelpPageDrawerShown" fixed temporary right width="80%" hide-overlay
class="elevation-24">
<iframe style="border: 0" :src="`/${appInfo.appId}/pageDoc#workflowManagement.md`" width="100%"
height="100%"></iframe>
<jh-toast /> <v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
<jh-mask /> @click="isHelpPageDrawerShown = false">
<jh-confirm-dialog /> <v-icon>mdi-close</v-icon>
</v-btn>
</v-navigation-drawer>
<!-- <<<<<<<<<<<<< 帮助页抽屉 -->
</div> </v-main>
</v-app>
<jh-toast />
<jh-mask />
<jh-confirm-dialog />
</div>
</script> </script>
<div id="app"> <div id="app">
@@ -168,224 +164,219 @@
<!-- <<<<<<<<<<<<< 加载页面组件 --> <!-- <<<<<<<<<<<<< 加载页面组件 -->
<script type="module"> <script type="module">
new Vue({ new Vue({
el: '#app', el: '#app',
template: '#app-template', template: '#app-template',
vueComponent: 'page', vueComponent: 'page',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: { data: {
// 面包屑 // 面包屑
breadcrumbs: [ breadcrumbs: [
{ {
text: '首页', text: '首页',
disabled: true, disabled: true,
},
{
text: '流程管理列表、发起任务',
disabled: true,
}
],
validationRules: {
requireRules: [
v => !!v || 'This is required',
],
}, },
isTableLoading: false, {
userList: [], text: '流程管理列表、发起任务',
tableData: [], disabled: true,
headers: [
{ text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed' },
{ text: '流程ID', value: 'workflowId' },
{ text: '流程名称', value: 'workflowName' },
],
searchInput: '',
isHelpPageDrawerShown: false,
isTableZebraLineShown: true,
isTableZebraLineMenuShown: false,
tableZebraLineMenuPosition: {x: null, y: null},
isCreateDrawerShown: false,
createFormList: [],
createItem: {},
workflowPersonList: [],
},
watch: {},
created() {
this.getTableData();
this.getUserList();
},
methods: {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'getTableData':
await this.getTableData();
break;
case 'openTableZebraLineMenu':
await this.openTableZebraLineMenu(uiActionData);
break;
case 'startCreateWorkflow':
await this.prepareCreateFormData(uiActionData);
await this.openCreateDrawer();
break;
case 'createWorkflow':
await this.prepareCreateValidate();
await this.confirmCreateWorkDialog();
await this.prepareDoWorkItem();
await this.doCreateWork();
await this.closeCreateDrawer();
break;
case 'jumpToCreateWorkflow':
await this.jumpToCreateWorkflow();
break;
case 'jumpUpdateWorkflow':
await this.jumpUpdateWorkflow(uiActionData);
break;
default:
console.error("[doUiAction] uiActionId not find", { uiActionId });
break;
}
},
async getTableData() {
this.isTableLoading = true;
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectItemList',
actionData: {}
}
}
});
const rows = result.data.appData.resultData.rows;
rows.forEach(row => {
const workflowNodeList = JSON.parse(row.workflowConfig).nodeList;
workflowNodeList.forEach(node => {
node.isNeedAllApproval = true;
});
row.workflowPersonList = workflowNodeList.filter(node => node.id.includes('userTask-'));
row.workflowForm = JSON.parse(row.workflowForm);
});
this.tableData = rows;
this.isTableLoading = false;
},
async getUserList() {
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectUserList',
actionData: {},
orderBy: [{ column: 'userId', order: 'asc' }]
}
}
});
const userList = result.data.appData.resultData.rows;
this.userList = userList;
},
// ---------- <<<<<<<<<< 斑马纹开关 uiAction --------
async openTableZebraLineMenu(funObj) {
this.tableZebraLineMenuPosition.x = funObj.x -funObj.offsetX + 10;
this.tableZebraLineMenuPosition.y = window.innerHeight - 50;
this.isTableZebraLineMenuShown = !this.isTableZebraLineMenuShown;
},
// ---------- 斑马纹开关 uiAction >>>>>>>>>> --------
// ---------- <<<<<<<<<< 申请项目审核 --------
async prepareCreateFormData({workflowForm, workflowPersonList, workflowId}) {
this.createFormList = workflowForm;
this.workflowPersonList = workflowPersonList;
this.createItem.workflowId = workflowId;
},
async openCreateDrawer() {
this.isCreateDrawerShown = true;
},
async prepareCreateValidate() {
if(!await this.$refs.createForm.validate()) {
throw new Error("请完善表单信息")
}
this.workflowPersonList.forEach(workflowPerson => {
workflowPerson.assignValue = workflowPerson.assignValue || [];
workflowPerson.assignValue = workflowPerson.assignValue.filter(userId => this.userList.find(u => u.userId === userId));
workflowPerson.origin.properties.assignValue = workflowPerson.assignValue;
if (workflowPerson.assignValue.length === 0) {
window.vtoast.fail({ message: `${workflowPerson.label}必填!` });
throw new Error("[prepareValidate] 审批人 false");
}
});
},
async confirmCreateWorkDialog() {
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
throw new Error("[confirmCreateFormDialog] 否");
}
},
prepareDoWorkItem() {
console.log('create', this.createFormList);
},
async doCreateWork() {
await window.jhMask.show();
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'insertTask',
actionData: {
formItemList: this.createFormList,
workflowId: this.createItem.workflowId,
workflowConfigCustom: JSON.stringify({ nodeListOfUserTaskNode: this.workflowPersonList })
}
}
}
})
await window.jhMask.hide();
await window.vtoast.success("申请成功");
},
async closeCreateDrawer() {
this.isCreateDrawerShown = false;
},
// ---------- 申请项目审核 >>>>>>>>>> --------
// ---------- <<<<<<<<<< jump --------
jumpUpdateWorkflow(item) {
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`;
},
jumpToCreateWorkflow() {
window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor';
} }
// ---------- jump >>>>>>>>>> -------- ],
validationRules: {
requireRules: [
v => !!v || 'This is required',
],
},
isTableLoading: false,
userList: [],
tableData: [],
headers: [
{text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
{text: '流程ID', value: 'workflowId'},
{text: '流程名称', value: 'workflowName'},
],
searchInput: '',
isHelpPageDrawerShown: false,
isTableZebraLineShown: true,
isCreateDrawerShown: false,
createFormList: [],
createItemWorkflowId: {},
workflowPersonList: [],
},
watch: {},
created() {
this.getTableData();
this.getUserList();
},
methods: {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'getTableData':
await this.getTableData();
break;
case 'startCreateWorkflow':
await this.prepareCreateFormData(uiActionData);
await this.openCreateDrawer();
break;
case 'createWorkflow':
await this.prepareCreateValidate();
await this.confirmCreateWorkDialog();
await this.prepareDoWorkItem();
await this.doCreateWork();
await this.closeCreateDrawer();
break;
case 'jumpToCreateWorkflow':
await this.jumpToCreateWorkflow();
break;
case 'jumpUpdateWorkflow':
await this.jumpUpdateWorkflow(uiActionData);
break;
default:
console.error("[doUiAction] uiActionId not find", {uiActionId});
break;
}
},
async getTableData() {
this.isTableLoading = true;
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectItemList',
actionData: {}
}
}
});
const rows = result.data.appData.resultData.rows;
rows.forEach(row => {
const workflowNodeList = JSON.parse(row.workflowConfig).nodeList;
workflowNodeList.forEach(node => {
node.isNeedAllApproval = true;
});
row.workflowPersonList = workflowNodeList.filter(node => node.id.includes('userTask-'));
row.workflowForm = JSON.parse(row.workflowForm);
});
this.tableData = rows;
this.isTableLoading = false;
},
async getUserList() {
const result = await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'selectUserList',
actionData: {},
orderBy: [{column: 'userId', order: 'asc'}]
}
}
});
const userList = result.data.appData.resultData.rows;
this.userList = userList;
},
// ---------- <<<<<<<<<< 申请项目审核 --------
async prepareCreateFormData(funObj) {
const {workflowForm, workflowPersonList, workflowId} = funObj;
this.createFormList = workflowForm;
this.workflowPersonList = workflowPersonList;
this.createItemWorkflowId = workflowId;
},
async openCreateDrawer() {
this.isCreateDrawerShown = true;
},
async prepareCreateValidate() {
if (!await this.$refs.createForm.validate()) {
throw new Error("请完善表单信息")
}
this.workflowPersonList.forEach(workflowPerson => {
if(!workflowPerson.assignValue) {
workflowPerson.assignValue = [];
}
workflowPerson.assignValue = workflowPerson.assignValue.filter(userId => {
return this.userList.find(user => user.userId === userId);
});
workflowPerson.origin.properties.assignValue = workflowPerson.assignValue;
if (workflowPerson.assignValue.length === 0) {
window.vtoast.fail({message: `${workflowPerson.label}必填!`});
throw new Error("[prepareValidate] 审批人 false");
}
});
},
async confirmCreateWorkDialog() {
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
throw new Error("[confirmCreateFormDialog] 否");
}
},
prepareDoWorkItem() {
console.log('create', this.createFormList);
},
async doCreateWork() {
await window.jhMask.show();
await window.jianghuAxios({
data: {
appData: {
pageId: 'workflowManagement',
actionId: 'insertTask',
actionData: {
formItemList: this.createFormList,
workflowId: this.createItemWorkflowId,
workflowConfigCustom: JSON.stringify({nodeListOfUserTaskNode: this.workflowPersonList})
}
}
}
})
await window.jhMask.hide();
await window.vtoast.success("申请成功");
},
async closeCreateDrawer() {
this.createFormList = null;
this.createItemWorkflowId = null;
this.isCreateDrawerShown = false;
},
// ---------- 申请项目审核 >>>>>>>>>> --------
// ---------- <<<<<<<<<< jump --------
jumpUpdateWorkflow(item) {
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?id=${item.id}`;
},
jumpToCreateWorkflow() {
window.location.href = '/<$ ctx.app.config.appId $>/page/workflowEditor';
} }
}) // ---------- jump >>>>>>>>>> --------
}
})
</script> </script>
<style scoped> <style scoped>
.work-item-box { .work-item-box {
padding: 50% 0; padding: 50% 0;
position: relative; position: relative;
} }
.work-item-content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
.work-item-content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
@media (max-width: 500px) {
body [xs='4'] {
flex: auto;
} }
@media (max-width: 500px) { }
body [xs='4'] {
flex: auto;
}
}
</style> </style>
{% endblock %} {% endblock %}
+2 -1
View File
@@ -8,7 +8,8 @@
"framework": "@jianghujs/jianghu" "framework": "@jianghujs/jianghu"
}, },
"dependencies": { "dependencies": {
"@jianghujs/jianghu": "4.0.9", "@jianghujs/jianghu": "4.0.14",
"dayjs": "^1.11.4",
"egg": "^2.15.1", "egg": "^2.15.1",
"egg-scripts": "^2.11.0" "egg-scripts": "^2.11.0"
}, },