review 细节调整
This commit is contained in:
1 parent
15131347f4
commit
367fbdc2e3
6 files changed
+212
-212
No files matched your search
@@ -201,7 +201,7 @@
|
||||
userList: [],
|
||||
tableData: [],
|
||||
headers: [
|
||||
{ text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: '操作', value: 'action', sortable: false, width: 130, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: '流程ID', value: 'workflowId' },
|
||||
{ text: '流程名称', value: 'workflowName' },
|
||||
],
|
||||
@@ -293,7 +293,7 @@
|
||||
},
|
||||
|
||||
// ---------- <<<<<<<<<< 申请项目审核 --------
|
||||
async prepareCreateFormData({workflowForm, workflowPersonList, workflowId}) {
|
||||
async prepareCreateFormData({ workflowForm, workflowPersonList, workflowId }) {
|
||||
this.createFormList = workflowForm;
|
||||
this.workflowPersonList = workflowPersonList;
|
||||
this.createItem.workflowId = workflowId;
|
||||
@@ -303,7 +303,7 @@
|
||||
this.isCreateDrawerShown = true;
|
||||
},
|
||||
async prepareCreateValidate() {
|
||||
if(!await this.$refs.createForm.validate()) {
|
||||
if (!await this.$refs.createForm.validate()) {
|
||||
throw new Error("请完善表单信息")
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
});
|
||||
},
|
||||
async confirmCreateWorkDialog() {
|
||||
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
|
||||
if (await window.confirmDialog({ title: "新增", content: "确定新增吗?" }) === false) {
|
||||
throw new Error("[confirmCreateFormDialog] 否");
|
||||
}
|
||||
},
|
||||
@@ -368,6 +368,7 @@
|
||||
padding: 50% 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.work-item-content {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -376,11 +377,11 @@
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
body [xs='4'] {
|
||||
flex: auto;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -55,7 +55,7 @@
|
||||
</template>
|
||||
<!--表格行操作按钮-->
|
||||
<template v-slot:item.action="{ item }">
|
||||
<span role="button" class="success--text jh-font-size-3 pr-2" @click="doUiAction('startUpdateItem', item)">
|
||||
<span role="button" class="success--text jh-font-size-3" @click="doUiAction('startUpdateItem', item)">
|
||||
<v-icon size="16" class="success--text">mdi-text-box-outline</v-icon>
|
||||
查看
|
||||
</span>
|
||||
@@ -94,19 +94,17 @@
|
||||
class="elevation-24">
|
||||
<v-form v-if="isViewDrawerShown" ref="updateForm" lazy-validation>
|
||||
<!--抽屉标题-->
|
||||
<v-row>
|
||||
<span class="title pa-6 pl-8">历史审核记录</span>
|
||||
<v-row class="ma-0">
|
||||
<span class="text-h6 pa-4">历史审核记录</span>
|
||||
</v-row>
|
||||
<!--抽屉表单-->
|
||||
<v-row class="mt-0 px-6">
|
||||
<v-col cols="12" sm="12" md="4" v-for="(item, index) in viewItem.taskFormInput.formList" :key="index">
|
||||
<v-row class="mt-0 px-4">
|
||||
<v-col cols="12" sm="12" v-for="(item, index) in viewItem.taskFormInput.formList" :key="index">
|
||||
<form-item :form-item="item" readonly></form-item>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<span class="jh-input-label">审核申请信息</span>
|
||||
<task-history :task-id="viewItem.taskId"></task-history>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<span class="jh-input-label px-4">审核申请信息</span>
|
||||
<task-history :task-id="viewItem.taskId"></task-history>
|
||||
</v-form>
|
||||
|
||||
<!--抽屉关闭按钮-->
|
||||
@@ -161,8 +159,8 @@
|
||||
data: {
|
||||
// 面包屑
|
||||
breadcrumbs: [
|
||||
{text: '首页', disabled: true,},
|
||||
{text: '全部任务列表', disabled: true,}
|
||||
{ text: '首页', disabled: true, },
|
||||
{ text: '全部任务列表', disabled: true, }
|
||||
],
|
||||
isHelpPageDrawerShown: false,
|
||||
// 表格相关数据
|
||||
@@ -177,8 +175,8 @@
|
||||
isTableLoading: true,
|
||||
tableData: [],
|
||||
headers: [
|
||||
{ text: '操作', value: 'action', align: 'center', sortable: false, width: 80, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: "审批项", value: "taskTitle" },
|
||||
{ text: '操作', value: 'action', sortable: false, width: 80, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: "审批项", value: "taskTitle", width: 150 },
|
||||
{ text: "审核状态", value: "taskStatus" },
|
||||
{ text: "操作者", value: "operationByUser", width: 120 },
|
||||
{ text: "操作时间", value: "operationAt", width: 250 }
|
||||
@@ -257,4 +255,3 @@
|
||||
<style scoped>
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
+164
-164
@@ -118,11 +118,11 @@
|
||||
<v-navigation-drawer v-model="isSubmitDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%" class="elevation-24">
|
||||
<v-form v-if="isSubmitDrawerShown" ref="updateForm" lazy-validation>
|
||||
<!--抽屉标题-->
|
||||
<v-row>
|
||||
<span class="title pa-6 pl-8">审核信息</span>
|
||||
<v-row class="ma-0">
|
||||
<span class="title pa-4">审核信息</span>
|
||||
</v-row>
|
||||
<!--抽屉表单-->
|
||||
<v-row class="mt-0 px-6">
|
||||
<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">
|
||||
<form-item :form-item="formItem" readonly></form-item>
|
||||
</v-col>
|
||||
@@ -139,13 +139,13 @@
|
||||
{{ lineTypeItem.type }}
|
||||
</v-btn>
|
||||
</v-row>
|
||||
<v-row class="mt-0 px-6">
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<span class="jh-input-label">审核历史</span>
|
||||
<task-history :task-id="updateItem.taskId" @line-type-list="setLineTypeList"></task-history>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-form>
|
||||
<v-row class="mt-0">
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<span class="jh-input-label px-4">审核历史</span>
|
||||
<task-history :task-id="updateItem.taskId" @line-type-list="setLineTypeList"></task-history>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!--抽屉关闭按钮-->
|
||||
<v-btn elevation="0" color="success" fab absolute top left small tile class="drawer-close-float-btn"
|
||||
@@ -192,170 +192,170 @@
|
||||
<!-- <<<<<<<<<<<<< 加载页面组件 -->
|
||||
|
||||
<script type="module">
|
||||
new Vue({
|
||||
el: '#app',
|
||||
template: '#app-template',
|
||||
vueComponent: 'page',
|
||||
vuetify: new Vuetify(),
|
||||
data: {
|
||||
// 面包屑
|
||||
breadcrumbs: [
|
||||
{text: '首页', disabled: true,},
|
||||
{text: '待办、已处理的任务', disabled: true,}
|
||||
],
|
||||
isHelpPageDrawerShown: false,
|
||||
|
||||
// 表格相关数据
|
||||
isTableZebraLineShown: true,
|
||||
// 生日日期选择
|
||||
validationRules: {
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
new Vue({
|
||||
el: '#app',
|
||||
template: '#app-template',
|
||||
vueComponent: 'page',
|
||||
vuetify: new Vuetify(),
|
||||
data: {
|
||||
// 面包屑
|
||||
breadcrumbs: [
|
||||
{ text: '首页', disabled: true, },
|
||||
{ text: '待办、已处理的任务', disabled: true, }
|
||||
],
|
||||
},
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
tableData: [],
|
||||
historyData: [],
|
||||
headers: [
|
||||
{text: '操作', value: 'action', align: 'center', sortable: false, width: 80, class: 'fixed', cellClass: 'fixed'},
|
||||
{text: "审批项", value: "taskTitle"},
|
||||
{text: "操作者", value: "operationByUser", width: 120},
|
||||
{text: "操作时间", value: "operationAt", width: 250}
|
||||
],
|
||||
isHelpPageDrawerShown: false,
|
||||
|
||||
isSubmitDrawerShown: false,
|
||||
updateItem: {},
|
||||
workflowType: 'todo', // todo, history
|
||||
lineTypeList: [],
|
||||
userId: '<$ ctx.userInfo.userId $>'
|
||||
},
|
||||
// 计算
|
||||
computed: {
|
||||
tableDataList() {
|
||||
return this.workflowType === 'todo' ? this.tableData : this.historyData;
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.doUiAction('getTableData');
|
||||
this.doUiAction('getHistoryData');
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'getTableData':
|
||||
await this.getTableData();
|
||||
break;
|
||||
case 'getHistoryData':
|
||||
await this.getHistoryData();
|
||||
break;
|
||||
case 'openDataPicker':
|
||||
await this.openDataPicker(uiActionData);
|
||||
break;
|
||||
case 'startUpdateItem':
|
||||
await this.prepareUpdateFormData(uiActionData);
|
||||
await this.openUpdateDrawer();
|
||||
break;
|
||||
case 'submitNode':
|
||||
await this.confirmSubmitDialog();
|
||||
await this.submitForReview(uiActionData);
|
||||
await this.closeSubmitDrawer();
|
||||
this.getTableData();
|
||||
this.getHistoryData();
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", {uiActionId});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 表格相关数据
|
||||
isTableZebraLineShown: true,
|
||||
// 生日日期选择
|
||||
validationRules: {
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
],
|
||||
},
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
tableData: [],
|
||||
historyData: [],
|
||||
headers: [
|
||||
{ text: '操作', value: 'action', sortable: false, width: 80, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: "审批项", value: "taskTitle" },
|
||||
{ text: "操作者", value: "operationByUser", width: 120 },
|
||||
{ text: "操作时间", value: "operationAt", width: 250 }
|
||||
],
|
||||
|
||||
async getTableData() {
|
||||
this.isTableLoading = true;
|
||||
const result = await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'selectItemList',
|
||||
actionData: {},
|
||||
where: {taskStatus: 'running'},
|
||||
whereLike: {taskEditUserList: this.userId},
|
||||
orderBy: [{column: 'operationAt', order: 'desc'}]
|
||||
}
|
||||
isSubmitDrawerShown: false,
|
||||
updateItem: {},
|
||||
workflowType: 'todo', // todo, history
|
||||
lineTypeList: [],
|
||||
userId: '<$ ctx.userInfo.userId $>'
|
||||
},
|
||||
// 计算
|
||||
computed: {
|
||||
tableDataList() {
|
||||
return this.workflowType === 'todo' ? this.tableData : this.historyData;
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.doUiAction('getTableData');
|
||||
this.doUiAction('getHistoryData');
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'getTableData':
|
||||
await this.getTableData();
|
||||
break;
|
||||
case 'getHistoryData':
|
||||
await this.getHistoryData();
|
||||
break;
|
||||
case 'openDataPicker':
|
||||
await this.openDataPicker(uiActionData);
|
||||
break;
|
||||
case 'startUpdateItem':
|
||||
await this.prepareUpdateFormData(uiActionData);
|
||||
await this.openUpdateDrawer();
|
||||
break;
|
||||
case 'submitNode':
|
||||
await this.confirmSubmitDialog();
|
||||
await this.submitForReview(uiActionData);
|
||||
await this.closeSubmitDrawer();
|
||||
this.getTableData();
|
||||
this.getHistoryData();
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
break;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
rows.forEach(row => {
|
||||
row.taskFormInput = JSON.parse(row.taskFormInput);
|
||||
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
this.tableData = rows.filter(item => !item.taskEditedUserList || !item.taskEditedUserList.includes(this.userId));
|
||||
this.isTableLoading = false;
|
||||
},
|
||||
async getHistoryData() {
|
||||
this.isTableLoading = true;
|
||||
const result = await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'selectHistoryList',
|
||||
actionData: {},
|
||||
where: {taskStatus: 'running'},
|
||||
whereLike: {taskEditUserList: '<$ ctx.userInfo.userId $>', taskConfigId: 'userTask-'},
|
||||
orderBy: [{column: 'id', order: 'desc'}]
|
||||
async getTableData() {
|
||||
this.isTableLoading = true;
|
||||
const result = await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'selectItemList',
|
||||
actionData: {},
|
||||
where: { taskStatus: 'running' },
|
||||
whereLike: { taskEditUserList: this.userId },
|
||||
orderBy: [{ column: 'operationAt', order: 'desc' }]
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
rows.forEach(row => {
|
||||
row.taskFormInput = JSON.parse(row.taskFormInput);
|
||||
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
this.historyData = rows;
|
||||
},
|
||||
// ---------- 审核、查看 uiAction >>>>>>>>>>>> --------
|
||||
async prepareUpdateFormData(funObj) {
|
||||
this.updateItem = _.cloneDeep(funObj);
|
||||
this.updateItem.taskHistoryList = []; // 审核历史
|
||||
this.updateItem.taskComment = ''; // 备注
|
||||
this.lineTypeList = []; // 所有操作按钮
|
||||
},
|
||||
|
||||
async openUpdateDrawer() {
|
||||
this.isSubmitDrawerShown = true;
|
||||
},
|
||||
|
||||
async confirmSubmitDialog() {
|
||||
if (await window.confirmDialog({title: "审核", content: "确定提交审核吗?"}) === false) {
|
||||
throw new Error("[confirmSubmitDialog] 否");
|
||||
}
|
||||
},
|
||||
|
||||
async submitForReview(lineType) {
|
||||
await window.vtoast.loading("提交审核");
|
||||
await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'submitNode',
|
||||
actionData: {type: lineType, id: this.updateItem.id, taskId: this.updateItem.taskId, taskComment: this.updateItem.taskComment}
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
rows.forEach(row => {
|
||||
row.taskFormInput = JSON.parse(row.taskFormInput);
|
||||
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
this.tableData = rows.filter(item => !item.taskEditedUserList || !item.taskEditedUserList.includes(this.userId));
|
||||
this.isTableLoading = false;
|
||||
},
|
||||
async getHistoryData() {
|
||||
this.isTableLoading = true;
|
||||
const result = await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'selectHistoryList',
|
||||
actionData: {},
|
||||
where: { taskStatus: 'running' },
|
||||
whereLike: { taskEditUserList: '<$ ctx.userInfo.userId $>', taskConfigId: 'userTask-' },
|
||||
orderBy: [{ column: 'id', order: 'desc' }]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
rows.forEach(row => {
|
||||
row.taskFormInput = JSON.parse(row.taskFormInput);
|
||||
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
this.historyData = rows;
|
||||
},
|
||||
// ---------- 审核、查看 uiAction >>>>>>>>>>>> --------
|
||||
async prepareUpdateFormData(funObj) {
|
||||
this.updateItem = _.cloneDeep(funObj);
|
||||
this.updateItem.taskHistoryList = []; // 审核历史
|
||||
this.updateItem.taskComment = ''; // 备注
|
||||
this.lineTypeList = []; // 所有操作按钮
|
||||
},
|
||||
|
||||
async openUpdateDrawer() {
|
||||
this.isSubmitDrawerShown = true;
|
||||
},
|
||||
|
||||
async confirmSubmitDialog() {
|
||||
if (await window.confirmDialog({ title: "审核", content: "确定提交审核吗?" }) === false) {
|
||||
throw new Error("[confirmSubmitDialog] 否");
|
||||
}
|
||||
})
|
||||
await window.vtoast.success("提交审核成功");
|
||||
},
|
||||
async closeSubmitDrawer() {
|
||||
this.isSubmitDrawerShown = false;
|
||||
this.updateItem = {};
|
||||
},
|
||||
setLineTypeList(lineTypeList) {
|
||||
this.lineTypeList = _.uniqBy((lineTypeList || '').split(",").map(lineType => ({type: lineType, label: lineType})), 'type');
|
||||
},
|
||||
// ---------- <<<<<<<<<<< 审核、查看 uiAction --------
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async submitForReview(lineType) {
|
||||
await window.vtoast.loading("提交审核");
|
||||
await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'todo',
|
||||
actionId: 'submitNode',
|
||||
actionData: { type: lineType, id: this.updateItem.id, taskId: this.updateItem.taskId, taskComment: this.updateItem.taskComment }
|
||||
}
|
||||
}
|
||||
})
|
||||
await window.vtoast.success("提交审核成功");
|
||||
},
|
||||
async closeSubmitDrawer() {
|
||||
this.isSubmitDrawerShown = false;
|
||||
this.updateItem = {};
|
||||
},
|
||||
setLineTypeList(lineTypeList) {
|
||||
this.lineTypeList = _.uniqBy((lineTypeList || '').split(",").map(lineType => ({ type: lineType, label: lineType })), 'type');
|
||||
},
|
||||
// ---------- <<<<<<<<<<< 审核、查看 uiAction --------
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
tableDataFromBackend: [],
|
||||
tableData: [],
|
||||
headers: [
|
||||
{ text: '操作', value: 'action', align: 'center', sortable: false, width: 120, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: '操作', value: 'action', sortable: false, width: 130, class: 'fixed', cellClass: 'fixed' },
|
||||
{ text: '流程ID', value: 'workflowId' },
|
||||
{ text: '流程名称', value: 'workflowName' },
|
||||
],
|
||||
@@ -218,9 +218,9 @@
|
||||
await this.openCreateDrawer();
|
||||
break;
|
||||
case 'createWorkflow':
|
||||
await this.prepareDoCreateWork();
|
||||
await this.prepareCreateValidate();
|
||||
await this.confirmCreateWorkDialog();
|
||||
await this.prepareDoWorkItem();
|
||||
await this.doCreateWork();
|
||||
await this.closeCreateDrawer();
|
||||
break;
|
||||
@@ -283,7 +283,6 @@
|
||||
|
||||
// ---------- <<<<<<<<<< 申请项目审核 --------
|
||||
async prepareCreateFormData(funObj) {
|
||||
console.log(funObj);
|
||||
const { workflowForm, workflowPersonList, workflowId } = funObj;
|
||||
this.currentWorkflowForm = workflowForm;
|
||||
this.currentWorkflowPersonList = workflowPersonList;
|
||||
@@ -293,11 +292,7 @@
|
||||
async openCreateDrawer() {
|
||||
this.isCreateDrawerShown = true;
|
||||
},
|
||||
async prepareCreateValidate() {
|
||||
if (!await this.$refs.createForm.validate()) {
|
||||
throw new Error("请完善表单信息")
|
||||
}
|
||||
|
||||
async prepareDoCreateWork() {
|
||||
this.currentWorkflowPersonList.forEach(workflowPersonItem => {
|
||||
if (!workflowPersonItem.assignValue) {
|
||||
workflowPersonItem.assignValue = [];
|
||||
@@ -308,6 +303,13 @@
|
||||
if (!workflowPersonItem.origin) workflowPersonItem['origin'] = {};
|
||||
if (!workflowPersonItem.origin.properties) workflowPersonItem.origin['properties'] = {};
|
||||
workflowPersonItem.origin.properties.assignValue = workflowPersonItem.assignValue;
|
||||
});
|
||||
},
|
||||
async prepareCreateValidate() {
|
||||
if (!await this.$refs.createForm.validate()) {
|
||||
throw new Error("请完善表单信息")
|
||||
}
|
||||
this.currentWorkflowPersonList.forEach(workflowPersonItem => {
|
||||
if (workflowPersonItem.assignValue.length === 0) {
|
||||
window.vtoast.fail({ message: `${workflowPersonItem.label}必填!` });
|
||||
throw new Error("[prepareValidate] 审批人 false");
|
||||
@@ -319,9 +321,6 @@
|
||||
throw new Error("[confirmCreateFormDialog] 否");
|
||||
}
|
||||
},
|
||||
prepareDoWorkItem() {
|
||||
console.log('create', this.currentWorkflowForm);
|
||||
},
|
||||
|
||||
async doCreateWork() {
|
||||
await window.jhMask.show();
|
||||
|
||||
+20
-17
@@ -1,52 +1,55 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const assert = require('assert');
|
||||
|
||||
const { middleware, middlewareMatch } = require('@jianghujs/jianghu/config/middlewareConfig');
|
||||
|
||||
const jianghuPathTemp = require.resolve('@jianghujs/jianghu');
|
||||
const jianghuPath = path.join(jianghuPathTemp, '../');
|
||||
const eggJianghuDirResolve = require.resolve('@jianghujs/jianghu');
|
||||
const eggJianghuDir = path.join(eggJianghuDirResolve, '../');
|
||||
|
||||
module.exports = appInfo => {
|
||||
assert(appInfo);
|
||||
|
||||
const appId = 'xianfeng-v1';
|
||||
const uploadDir = path.join(appInfo.baseDir, 'upload');
|
||||
const downloadBasePath = `/${appId}/upload`;
|
||||
|
||||
return {
|
||||
appId,
|
||||
appTitle: '工单管理',
|
||||
appLogo: `${appId}/public/img/logo.png`,
|
||||
appType: 'single',
|
||||
appDirectoryLink: '/',
|
||||
appLogo: `${appId}/public/img/logo.svg`,
|
||||
|
||||
indexPage: `/${appId}/page/workflowManagement`,
|
||||
loginPage: `/${appId}/page/login`,
|
||||
helpPage: `/${appId}/page/help`,
|
||||
uploadDir,
|
||||
downloadBasePath,
|
||||
|
||||
uploadDir: path.join(appInfo.baseDir, 'upload'),
|
||||
downloadBasePath: `/${appId}/upload`,
|
||||
|
||||
primaryColor: "#4caf50",
|
||||
primaryColorA80: "#EEF7EE",
|
||||
|
||||
static: {
|
||||
maxAge: 0,
|
||||
buffer: false,
|
||||
dynamic: true,
|
||||
preload: false,
|
||||
maxFiles: 0,
|
||||
maxAge: 31536000,
|
||||
buffer: true,
|
||||
dir: [
|
||||
{ prefix: `/${appId}/public/`, dir: path.join(appInfo.baseDir, 'app/public') },
|
||||
{ prefix: `/${appId}/public/`, dir: path.join(jianghuPath, 'app/public') },
|
||||
{ prefix: `/${appId}/upload/`, dir: uploadDir },
|
||||
{ prefix: `/${appId}/public/`, dir: path.join(eggJianghuDir, 'app/public') },
|
||||
],
|
||||
},
|
||||
jianghuConfig: {
|
||||
enableUploadStaticFileCache: true,
|
||||
enableUploadStaticFileAuthorization: false,
|
||||
},
|
||||
|
||||
view: {
|
||||
defaultViewEngine: 'nunjucks',
|
||||
mapping: { '.html': 'nunjucks' },
|
||||
root: [
|
||||
path.join(appInfo.baseDir, 'app/view'),
|
||||
path.join(jianghuPath, 'app/view'),
|
||||
path.join(eggJianghuDir, 'app/view'),
|
||||
].join(','),
|
||||
},
|
||||
|
||||
middleware,
|
||||
...middlewareMatch,
|
||||
};
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
"framework": "@jianghujs/jianghu"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jianghujs/jianghu": "4.0.14",
|
||||
"@jianghujs/jianghu": "4.0.15",
|
||||
"dayjs": "^1.11.4",
|
||||
"egg": "^2.15.1",
|
||||
"egg-scripts": "^2.11.0"
|
||||
|
||||
Reference in new issue
Block a user