This commit is contained in:
yuebenshan committed 2022-08-28 12:07:21 +08:00
1 parent e2c5bb996b
commit 2ecc8a46e9
15 files changed
+18705 -665

No files matched your search

-77
View File
@@ -1,77 +0,0 @@
<script type="text/x-template" id="classSelectDialog">
<span>
<v-select class="mr-4" @mouseup="classSelectDialog_shown = true" v-model="classSelectDialog_selected"
:items="classSelectDialog_dataList" readonly :label="classSelectDialog_title" hide-details dense
outlined hide-no-data hide-selected />
<v-dialog v-model="classSelectDialog_shown" scrollable max-width="500px">
<v-card>
<v-card-title>
<span>{{ classSelectDialog_title }}</span>
<v-text-field
label="搜索"
clearable
dense
v-model="classSelectDialog_filterText"
hide-details
prepend-inner-icon="mdi-text-search"
class="ma-2 pa-0"
outlined
></v-text-field>
</v-card-title>
<v-divider />
<div class="list">
<v-list rounded>
<v-list-item-group color="primary" active-class>
<v-list-item v-for="(item, index) in classSelectDialog_dataList_filter" :key="item.value" @click="selectItem({ item })">
<template #default="{ active }">
<v-list-item-content>
<v-list-item-title v-text="item.text" />
</v-list-item-content>
</template>
</v-list-item>
</v-list-item-group>
</v-list>
</div>
<v-divider />
<v-card-actions>
<v-spacer />
<v-btn color="primary" text @click="classSelectDialog_shown = false">取消</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</span>
</script>
<script>
Vue.component("classSelectDialog", {
template: "#classSelectDialog",
vueComponent: 'classSelectDialog',
mixins: [ window.jianghuUiActionMixins ],
data: () => (window.vueData),
computed: {
classSelectDialog_dataList_filter() {
const classSelectDialog_filterText = (this.classSelectDialog_filterText || '').toLowerCase();
let list = this.classSelectDialog_dataList.slice();
list = list.filter((item) =>
item.text &&
( item.text.toLowerCase().includes(classSelectDialog_filterText) ||
item.text.includes(classSelectDialog_filterText)
)
)
return list;
},
},
methods: {
selectItem({ item }) {
this.classSelectDialog_selected = item.value;
this.classSelectDialog_shown = false;
},
},
});
</script>
<style>
.list {
max-height: 700px;
overflow-y: scroll;
}
</style>
@@ -36,9 +36,7 @@
<script> <script>
Vue.component("form-item-list-render", { Vue.component("form-item-list-render", {
template: '#form-item-list-render', template: '#form-item-list-render',
mixins: [ window.jianghuUiActionMixins ],
vuetify: new Vuetify(), vuetify: new Vuetify(),
vueComponent: "formItemListRender",
name: 'form-item-list-render', name: 'form-item-list-render',
props: { props: {
formItemList: { formItemList: {
+15 -30
View File
@@ -7,7 +7,7 @@
<template slot="serverSearch"> <template slot="serverSearch">
<v-row class="ma-0 align-center" :class="{'pa-0': isMobile, 'pa-2': !isMobile}" style="justify-content: end"> <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-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-text-field v-model="serverSearchInput.workflowName" color="success" prefix="流程名称:" class="cus-v-input" :class="{'mr-2': !isMobile}" dense filled single-line></v-text-field>
</v-col> </v-col>
<v-col class="pl-0 pr-0" :class="{'pt-0': isMobile}" style="max-width: 57px"> <v-col class="pl-0 pr-0" :class="{'pt-0': isMobile}" style="max-width: 57px">
<v-btn <v-btn
@@ -26,7 +26,7 @@
<!-- 页面主要内容 --> <!-- 页面主要内容 -->
<v-card :class="{'px-2': isMobile}"> <v-card :class="{'px-2': isMobile}">
<v-data-table :headers="headers" <v-data-table :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -108,6 +108,7 @@
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
isFormValid: true, isFormValid: true,
requireRules: [ requireRules: [
@@ -118,9 +119,8 @@
}, },
serverSearchInput: { serverSearchInput: {
processName: null workflowName: null
}, },
currentTableGenderType: 'all',
isEditDrawerShow: false, isEditDrawerShow: false,
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
@@ -146,40 +146,25 @@
], ],
dialogSaveInfoAction: '' dialogSaveInfoAction: ''
}), }),
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() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
}, },
mounted() { }, mounted() { },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'startCreateItem': case 'startCreateItem':
await this.clearItemData(actionData); await this.clearItemData(uiActionData);
await this.openCreateItemDialog(actionData); await this.openCreateItemDialog(uiActionData);
break; break;
case 'createItem': case 'createItem':
await this.confirmCreateItemDialog(actionData); await this.confirmCreateItemDialog(uiActionData);
await this.doCreateItem(actionData); await this.doCreateItem(uiActionData);
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
await this.closeDrawerShow(actionData); await this.closeDrawerShow(uiActionData);
break; break;
default: default:
console.error("[doAction] uiActionId not find", { uiActionId }); console.error("[doAction] uiActionId not find", { uiActionId });
@@ -216,7 +201,7 @@
}, },
// startCreateItem // startCreateItem
async clearItemData({item: { workflowForm, workflowConfig, workflowId }}) { clearItemData({item: { workflowForm, workflowConfig, workflowId }}) {
this.editItem = {workflowForm, workflowFormData: {}, workflowId}; this.editItem = {workflowForm, workflowFormData: {}, workflowId};
}, },
@@ -237,14 +222,14 @@
* 新增数据 * 新增数据
*/ */
async doCreateItem() { async doCreateItem() {
delete this.computedEditItem.id; delete this.editItem.id;
await window.vtoast.loading("新增数据"); await window.vtoast.loading("新增数据");
await window.jianghuAxios({ await window.jianghuAxios({
data: { data: {
appData: { appData: {
pageId: 'taskCreateManagement', pageId: 'taskCreateManagement',
actionId: 'insertItem', actionId: 'insertItem',
actionData: this.computedEditItem actionData: this.editItem
} }
} }
}) })
+4 -19
View File
@@ -121,6 +121,7 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
step: 1, step: 1,
// 表格相关数据 // 表格相关数据
isFormValid: true, isFormValid: true,
@@ -135,11 +136,9 @@ new Vue({
serverSearchInput: { serverSearchInput: {
processName: null processName: null
}, },
currentTableGenderType: 'all',
isEditDrawerShow: false, isEditDrawerShow: false,
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
tableDataFromBackend: [],
headers: [ headers: [
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'}, {text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
@@ -173,20 +172,6 @@ new Vue({
taskStepperList: [], taskStepperList: [],
currentNode: {} 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: {}, watch: {},
async created() { async created() {
const searchParams = new URLSearchParams(location.search.substring(1)); const searchParams = new URLSearchParams(location.search.substring(1));
@@ -196,11 +181,11 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'submitNode': case 'submitNode':
await this.submitNode(actionData); await this.submitNode(uiActionData);
await this.getTaskHistoryList(actionData); await this.getTaskHistoryList(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", { uiActionId });
+6 -16
View File
@@ -10,7 +10,7 @@
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-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"> <v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span> <span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col> </v-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -21,7 +21,7 @@
</v-col> </v-col>
</v-row> </v-row>
<v-data-table :headers="headers" <v-data-table :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -50,6 +50,7 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
requireRules: [ requireRules: [
v => !!v || 'This is required', v => !!v || 'This is required',
@@ -75,17 +76,6 @@ new Vue({
{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'},
], ],
}), }),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
},
watch: {}, watch: {},
async created() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
@@ -93,13 +83,13 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'toTaskHistory': case 'toTaskHistory':
await this.toTaskHistory(actionData); await this.toTaskHistory(uiActionData);
break; break;
default: default:
console.error("[doAction] uiActionId not find", { uiActionId }); console.error("[doAction] uiActionId not find", { uiActionId });
+9 -23
View File
@@ -9,7 +9,7 @@
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-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"> <v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span> <span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col> </v-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -21,7 +21,7 @@
</v-row> </v-row>
<v-data-table fixed-header <v-data-table fixed-header
:headers="headers" :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -52,6 +52,7 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
isFormValid: true, isFormValid: true,
requireRules: [ requireRules: [
@@ -63,7 +64,6 @@ new Vue({
studentId: null, studentId: null,
classId: null classId: null
}, },
currentTableGenderType: 'all',
isEditDrawerShow: false, isEditDrawerShow: false,
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
@@ -92,20 +92,6 @@ new Vue({
], ],
dialogSaveInfoAction: '' dialogSaveInfoAction: ''
}), }),
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: {}, watch: {},
async created() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
@@ -113,18 +99,18 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'deleteItem': case 'deleteItem':
await this.confirmDeleteItemDialog(actionData); await this.confirmDeleteItemDialog(uiActionData);
await this.doDeleteItem(actionData); await this.doDeleteItem(uiActionData);
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'toTaskHistory': case 'toTaskHistory':
await this.toTaskHistory(actionData); await this.toTaskHistory(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", { uiActionId });
+6 -17
View File
@@ -10,7 +10,7 @@
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-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"> <v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span> <span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col> </v-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -22,7 +22,7 @@
</v-row> </v-row>
<v-data-table fixed-header <v-data-table fixed-header
:headers="headers" :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -51,11 +51,11 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
requireRules: [ requireRules: [
v => !!v || 'This is required', v => !!v || 'This is required',
], ],
currentTableGenderType: 'all',
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
tableDataFromBackend: [], tableDataFromBackend: [],
@@ -76,17 +76,6 @@ new Vue({
{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'},
], ],
}), }),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
},
watch: {}, watch: {},
async created() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
@@ -94,13 +83,13 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'toTaskHistory': case 'toTaskHistory':
await this.toTaskHistory(actionData); await this.toTaskHistory(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", { uiActionId });
+6 -17
View File
@@ -11,7 +11,7 @@
<v-row class="ma-0 align-center flex-none pt-0 " :class="{'pa-4': !isMobile, 'pb-0': !isMobile, 'pa-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"> <v-col cols="12" xs="4" sm="4" md="4" xl="4" class="pl-0">
<span class="body-2">共{{ tableData.length }}条记录</span> <span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col> </v-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -23,7 +23,7 @@
</v-row> </v-row>
<v-data-table fixed-header <v-data-table fixed-header
:headers="headers" :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -53,11 +53,11 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
requireRules: [ requireRules: [
v => !!v || 'This is required', v => !!v || 'This is required',
], ],
currentTableGenderType: 'all',
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
tableDataFromBackend: [], tableDataFromBackend: [],
@@ -78,17 +78,6 @@ new Vue({
{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'},
], ],
}), }),
computed: {
isMobile() {
return window.innerWidth < 600;
},
tableData() {
if (!this.currentTableGenderType || this.currentTableGenderType === 'all') {
return this.tableDataFromBackend;
}
return this.tableDataFromBackend.filter(({gender}) => gender === this.currentTableGenderType);
},
},
watch: {}, watch: {},
async created() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
@@ -96,13 +85,13 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'toTaskHistory': case 'toTaskHistory':
await this.toTaskHistory(actionData); await this.toTaskHistory(uiActionData);
break; break;
default: default:
console.error("[doAction] uiActionId not find", { uiActionId }); console.error("[doAction] uiActionId not find", { uiActionId });
+45 -76
View File
@@ -59,8 +59,8 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
isFormValid: true,
requireRules: [ requireRules: [
v => !!v || 'This is required', v => !!v || 'This is required',
], ],
@@ -70,75 +70,17 @@ new Vue({
workflowFormList: [] 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: {}, editItem: {},
tableButtonList: [
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
],
dialogSaveInfoAction: 'createItem', dialogSaveInfoAction: 'createItem',
dialog: false, 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: { watch: {
'editItem.workflowForm': { 'editItem.workflowForm': {
handler(val) { handler(val) {
if (!val) return if (!val) return
this.buildWorkflowFormList(val);
this.constantCollection.workflowFormList = [];
for (const item of val) {
this.constantCollection.workflowFormList.push({
text: item.component.outline,
value: item.id
})
}
if (!this.editItem.workflowConfig) return; if (!this.editItem.workflowConfig) return;
for (const config of this.editItem.workflowConfig.nodeList) { this.buildWorkflowConfig()
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, deep: true,
immediate: true immediate: true
@@ -148,15 +90,7 @@ new Vue({
const searchParams = new URLSearchParams(location.search.substring(1)); const searchParams = new URLSearchParams(location.search.substring(1));
const type = searchParams.get('type'); const type = searchParams.get('type');
if(type === 'edit') { if(type === 'edit') {
const workflowEditItem = sessionStorage.getItem('workflowEditItem'); this.syncEditItem()
if(workflowEditItem) {
this.dialogSaveInfoAction = 'updateItem';
this.editItem = JSON.parse(workflowEditItem);
sessionStorage.removeItem('workflowEditItem');
console.log(this.editItem);
} else {
history.back();
}
} else { } else {
this.clearItemData(); this.clearItemData();
} }
@@ -166,15 +100,15 @@ new Vue({
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'createItem': case 'createItem':
await this.confirmCreateItemDialog(actionData); await this.confirmCreateItemDialog(uiActionData);
await this.doCreateItem(actionData); await this.doCreateItem(uiActionData);
break; break;
case 'updateItem': case 'updateItem':
await this.confirmUpdateItemDialog(actionData); await this.confirmUpdateItemDialog(uiActionData);
await this.doUpdateItem(actionData); await this.doUpdateItem(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", { uiActionId });
@@ -196,6 +130,30 @@ new Vue({
return item; return item;
}, },
buildWorkflowFormList(val) {
this.constantCollection.workflowFormList = [];
for (const item of val) {
this.constantCollection.workflowFormList.push({
text: item.component.outline,
value: item.id
})
}
},
buildWorkflowConfig() {
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)
}
},
/** /**
* 获取表格数据 * 获取表格数据
*/ */
@@ -238,6 +196,17 @@ new Vue({
async clearItemData() { async clearItemData() {
this.editItem = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}}; this.editItem = {workflowForm: [], workflowConfig: {lineList: [], nodeList: []}};
}, },
syncEditItem() {
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();
}
},
// createItem // createItem
async confirmCreateItemDialog() { async confirmCreateItemDialog() {
@@ -250,7 +219,7 @@ new Vue({
* 新增数据 * 新增数据
*/ */
async doCreateItem() { async doCreateItem() {
delete this.computedEditItem.id; delete this.editItem.id;
const item = this.buildEditItem(); const item = this.buildEditItem();
await window.vtoast.loading("新增数据"); await window.vtoast.loading("新增数据");
await window.jianghuAxios({ await window.jianghuAxios({
+12 -23
View File
@@ -9,7 +9,7 @@
<v-col cols="12" xs="12" sm="4" md="4" xl="4" class="pl-0"> <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('createItem')">新增</v-btn> <v-btn color="success" dark class="elevation-0 mr-2" @click="doUiAction('createItem')">新增</v-btn>
<span class="body-2">共{{ tableData.length }}条记录</span> <span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
</v-col> </v-col>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-col cols="12" xs="12" sm="4" md="3" xl="3" class="px-0"> <v-col cols="12" xs="12" sm="4" md="3" xl="3" class="px-0">
@@ -19,7 +19,7 @@
</v-row> </v-row>
<v-data-table fixed-header <v-data-table fixed-header
:headers="headers" :headers="headers"
:items="tableData" :items="tableDataFromBackend"
:search="searchInput" :search="searchInput"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
:items-per-page="20" :items-per-page="20"
@@ -50,6 +50,7 @@ new Vue({
template: '#app-template', template: '#app-template',
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
isMobile: window.innerWidth < 600,
// 表格相关数据 // 表格相关数据
requireRules: [ requireRules: [
v => !!v || 'This is required', v => !!v || 'This is required',
@@ -58,7 +59,6 @@ new Vue({
studentId: null, studentId: null,
classId: null classId: null
}, },
currentTableGenderType: 'all',
isEditDrawerShow: false, isEditDrawerShow: false,
searchInput: null, searchInput: null,
isTableLoading: true, isTableLoading: true,
@@ -84,40 +84,29 @@ new Vue({
dialogSaveInfoAction: '', dialogSaveInfoAction: '',
dialog: false, 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);
},
},
async created() { async created() {
await this.doUiAction('refreshTableData'); await this.doUiAction('refreshTableData');
}, },
mounted() { mounted() {
}, },
methods: { methods: {
async doUiAction(uiActionId, actionData) { async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) { switch (uiActionId) {
case 'refreshTableData': case 'refreshTableData':
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
case 'createItem': case 'createItem':
await this.prepareValidate(actionData); await this.prepareValidate(uiActionData);
await this.doCreateItem(actionData); await this.doCreateItem(uiActionData);
break; break;
case 'updateItem': case 'updateItem':
await this.prepareValidate(actionData); await this.prepareValidate(uiActionData);
await this.doUpdateItem(actionData); await this.doUpdateItem(uiActionData);
break; break;
case 'deleteItem': case 'deleteItem':
await this.confirmDeleteItemDialog(actionData); await this.confirmDeleteItemDialog(uiActionData);
await this.doDeleteItem(actionData); await this.doDeleteItem(uiActionData);
await this.refreshTableData(actionData); await this.refreshTableData(uiActionData);
break; break;
default: default:
console.error("[doUiAction] uiActionId not find", { uiActionId }); console.error("[doUiAction] uiActionId not find", { uiActionId });
+1 -1
View File
@@ -28,7 +28,7 @@ module.exports = appInfo => {
port: 3306, port: 3306,
user: 'root', user: 'root',
password: '123456', password: '123456',
database: 'xianfeng-v1' database: 'jianghujs_workflow'
}, },
pool: { min: 0, max: 30 }, pool: { min: 0, max: 30 },
acquireConnectionTimeout: 30000 acquireConnectionTimeout: 30000
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = appInfo => {
port: '3306', port: '3306',
user: 'root', user: 'root',
password: '123456', password: '123456',
database: 'xianfeng-v1' database: 'jianghujs_workflow'
}, },
pool: { min: 0, max: 30 }, pool: { min: 0, max: 30 },
acquireConnectionTimeout: 30000 acquireConnectionTimeout: 30000
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = appInfo => {
port: '3306', port: '3306',
user: 'root', user: 'root',
password: '123456', password: '123456',
database: 'xianfeng-v1' database: 'jianghujs_workflow'
}, },
pool: { min: 0, max: 30 }, pool: { min: 0, max: 30 },
acquireConnectionTimeout: 30000, acquireConnectionTimeout: 30000,
+18598 -361
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -8,7 +8,7 @@
"framework": "@jianghujs/jianghu" "framework": "@jianghujs/jianghu"
}, },
"dependencies": { "dependencies": {
"@jianghujs/jianghu": "3.0.44", "@jianghujs/jianghu": "3.0.50",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"egg": "^2.15.1", "egg": "^2.15.1",
"egg-scripts": "^2.11.0" "egg-scripts": "^2.11.0"