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

No files matched your search

+5 -20
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">
<template v-slot:activator="{on, attrs}">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-menu</v-icon> <v-icon>mdi-menu</v-icon>
</v-btn> </v-btn>
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> </template>
<v-list> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
<v-list-item>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch>
</v-list-item>
</v-list>
</v-menu> </v-menu>
</template> </template>
<!--表格底部右侧分页--> <!--表格底部右侧分页-->
@@ -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();
@@ -289,14 +282,6 @@
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}) {
this.createFormList = workflowForm; this.createFormList = workflowForm;
+5 -19
View File
@@ -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">
<template v-slot:activator="{on, attrs}">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-menu</v-icon> <v-icon>mdi-menu</v-icon>
</v-btn> </v-btn>
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> </template>
<v-list> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
<v-list-item>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" 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);
+5 -19
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">
<template v-slot:activator="{on, attrs}">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-menu</v-icon> <v-icon>mdi-menu</v-icon>
</v-btn> </v-btn>
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> </template>
<v-list> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
<v-list-item>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" 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);
+41 -50
View File
@@ -3,7 +3,7 @@
{% 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">
@@ -22,10 +22,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-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<!--搜索--> <!--搜索-->
<v-col cols="12" xs="8" sm="4" md="3" xl="2" class="pa-0"> <v-col cols="12" xs="8" sm="4" md="3" xl="2" class="pa-0">
@@ -58,15 +56,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">
<template v-slot:activator="{on, attrs}">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-menu</v-icon> <v-icon>mdi-menu</v-icon>
</v-btn> </v-btn>
<v-menu top offset-y :close-on-content-click="false" v-model="isTableZebraLineMenuShown" :position-x="tableZebraLineMenuPosition.x" :position-y="tableZebraLineMenuPosition.y"> </template>
<v-list> <v-switch v-model="isTableZebraLineShown" hide-details class="mx-3 my-2" label="显示斑马纹" dense flat></v-switch>
<v-list-item>
<v-switch v-model="isTableZebraLineShown" hide-details class="ma-0" label="显示斑马纹" dense flat></v-switch>
</v-list-item>
</v-list>
</v-menu> </v-menu>
</template> </template>
<!--表格底部右侧分页--> <!--表格底部右侧分页-->
@@ -112,7 +108,7 @@
</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>
@@ -152,7 +148,7 @@
<jh-mask /> <jh-mask />
<jh-confirm-dialog /> <jh-confirm-dialog />
</div> </div>
</script> </script>
<div id="app"> <div id="app">
@@ -168,7 +164,7 @@
<!-- <<<<<<<<<<<<< 加载页面组件 --> <!-- <<<<<<<<<<<<< 加载页面组件 -->
<script type="module"> <script type="module">
new Vue({ new Vue({
el: '#app', el: '#app',
template: '#app-template', template: '#app-template',
vueComponent: 'page', vueComponent: 'page',
@@ -194,19 +190,17 @@
userList: [], userList: [],
tableData: [], tableData: [],
headers: [ headers: [
{ text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed' }, {text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed'},
{ text: '流程ID', value: 'workflowId' }, {text: '流程ID', value: 'workflowId'},
{ text: '流程名称', value: 'workflowName' }, {text: '流程名称', value: 'workflowName'},
], ],
searchInput: '', searchInput: '',
isHelpPageDrawerShown: false, isHelpPageDrawerShown: false,
isTableZebraLineShown: true, isTableZebraLineShown: true,
isTableZebraLineMenuShown: false,
tableZebraLineMenuPosition: {x: null, y: null},
isCreateDrawerShown: false, isCreateDrawerShown: false,
createFormList: [], createFormList: [],
createItem: {}, createItemWorkflowId: {},
workflowPersonList: [], workflowPersonList: [],
}, },
watch: {}, watch: {},
@@ -220,9 +214,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();
@@ -241,7 +232,7 @@
await this.jumpUpdateWorkflow(uiActionData); await this.jumpUpdateWorkflow(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", {uiActionId});
break; break;
} }
}, },
@@ -279,7 +270,7 @@
pageId: 'workflowManagement', pageId: 'workflowManagement',
actionId: 'selectUserList', actionId: 'selectUserList',
actionData: {}, actionData: {},
orderBy: [{ column: 'userId', order: 'asc' }] orderBy: [{column: 'userId', order: 'asc'}]
} }
} }
}); });
@@ -288,35 +279,32 @@
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(funObj) {
const {workflowForm, workflowPersonList, workflowId} = funObj;
this.createFormList = workflowForm; this.createFormList = workflowForm;
this.workflowPersonList = workflowPersonList; this.workflowPersonList = workflowPersonList;
this.createItem.workflowId = workflowId; this.createItemWorkflowId = workflowId;
}, },
async openCreateDrawer() { async openCreateDrawer() {
this.isCreateDrawerShown = true; this.isCreateDrawerShown = true;
}, },
async prepareCreateValidate() { async prepareCreateValidate() {
if(!await this.$refs.createForm.validate()) { if (!await this.$refs.createForm.validate()) {
throw new Error("请完善表单信息") throw new Error("请完善表单信息")
} }
this.workflowPersonList.forEach(workflowPerson => { this.workflowPersonList.forEach(workflowPerson => {
workflowPerson.assignValue = workflowPerson.assignValue || []; if(!workflowPerson.assignValue) {
workflowPerson.assignValue = workflowPerson.assignValue.filter(userId => this.userList.find(u => u.userId === userId)); workflowPerson.assignValue = [];
}
workflowPerson.assignValue = workflowPerson.assignValue.filter(userId => {
return this.userList.find(user => user.userId === userId);
});
workflowPerson.origin.properties.assignValue = workflowPerson.assignValue; workflowPerson.origin.properties.assignValue = workflowPerson.assignValue;
if (workflowPerson.assignValue.length === 0) { if (workflowPerson.assignValue.length === 0) {
window.vtoast.fail({ message: `${workflowPerson.label}必填!` }); window.vtoast.fail({message: `${workflowPerson.label}必填!`});
throw new Error("[prepareValidate] 审批人 false"); throw new Error("[prepareValidate] 审批人 false");
} }
}); });
@@ -332,7 +320,6 @@
async doCreateWork() { async doCreateWork() {
await window.jhMask.show(); await window.jhMask.show();
await window.jianghuAxios({ await window.jianghuAxios({
data: { data: {
appData: { appData: {
@@ -340,8 +327,8 @@
actionId: 'insertTask', actionId: 'insertTask',
actionData: { actionData: {
formItemList: this.createFormList, formItemList: this.createFormList,
workflowId: this.createItem.workflowId, workflowId: this.createItemWorkflowId,
workflowConfigCustom: JSON.stringify({ nodeListOfUserTaskNode: this.workflowPersonList }) workflowConfigCustom: JSON.stringify({nodeListOfUserTaskNode: this.workflowPersonList})
} }
} }
} }
@@ -350,6 +337,8 @@
await window.vtoast.success("申请成功"); await window.vtoast.success("申请成功");
}, },
async closeCreateDrawer() { async closeCreateDrawer() {
this.createFormList = null;
this.createItemWorkflowId = null;
this.isCreateDrawerShown = false; this.isCreateDrawerShown = false;
}, },
// ---------- 申请项目审核 >>>>>>>>>> -------- // ---------- 申请项目审核 >>>>>>>>>> --------
@@ -365,27 +354,29 @@
} }
// ---------- jump >>>>>>>>>> -------- // ---------- 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 {
.work-item-content {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@media (max-width: 500px) {
@media (max-width: 500px) {
body [xs='4'] { body [xs='4'] {
flex: auto; 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"
}, },