review
This commit is contained in:
1 parent
e2c5bb996b
commit
2ecc8a46e9
15 files changed
+18707
-667
No files matched your search
@@ -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>
|
||||
Vue.component("form-item-list-render", {
|
||||
template: '#form-item-list-render',
|
||||
mixins: [ window.jianghuUiActionMixins ],
|
||||
vuetify: new Vuetify(),
|
||||
vueComponent: "formItemListRender",
|
||||
name: 'form-item-list-render',
|
||||
props: {
|
||||
formItemList: {
|
||||
@@ -63,7 +61,7 @@
|
||||
watch: {
|
||||
form: {
|
||||
deep: true,
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
destroyed() {},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<template slot="serverSearch">
|
||||
<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-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 class="pl-0 pr-0" :class="{'pt-0': isMobile}" style="max-width: 57px">
|
||||
<v-btn
|
||||
@@ -26,7 +26,7 @@
|
||||
<!-- 页面主要内容 -->
|
||||
<v-card :class="{'px-2': isMobile}">
|
||||
<v-data-table :headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -108,6 +108,7 @@
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
isFormValid: true,
|
||||
requireRules: [
|
||||
@@ -118,9 +119,8 @@
|
||||
},
|
||||
|
||||
serverSearchInput: {
|
||||
processName: null
|
||||
workflowName: null
|
||||
},
|
||||
currentTableGenderType: 'all',
|
||||
isEditDrawerShow: false,
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
@@ -146,40 +146,25 @@
|
||||
],
|
||||
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() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'startCreateItem':
|
||||
await this.clearItemData(actionData);
|
||||
await this.openCreateItemDialog(actionData);
|
||||
await this.clearItemData(uiActionData);
|
||||
await this.openCreateItemDialog(uiActionData);
|
||||
break;
|
||||
case 'createItem':
|
||||
await this.confirmCreateItemDialog(actionData);
|
||||
await this.doCreateItem(actionData);
|
||||
await this.refreshTableData(actionData);
|
||||
await this.closeDrawerShow(actionData);
|
||||
await this.confirmCreateItemDialog(uiActionData);
|
||||
await this.doCreateItem(uiActionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
await this.closeDrawerShow(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doAction] uiActionId not find", { uiActionId });
|
||||
@@ -216,7 +201,7 @@
|
||||
},
|
||||
|
||||
// startCreateItem
|
||||
async clearItemData({item: { workflowForm, workflowConfig, workflowId }}) {
|
||||
clearItemData({item: { workflowForm, workflowConfig, workflowId }}) {
|
||||
this.editItem = {workflowForm, workflowFormData: {}, workflowId};
|
||||
},
|
||||
|
||||
@@ -237,14 +222,14 @@
|
||||
* 新增数据
|
||||
*/
|
||||
async doCreateItem() {
|
||||
delete this.computedEditItem.id;
|
||||
delete this.editItem.id;
|
||||
await window.vtoast.loading("新增数据");
|
||||
await window.jianghuAxios({
|
||||
data: {
|
||||
appData: {
|
||||
pageId: 'taskCreateManagement',
|
||||
actionId: 'insertItem',
|
||||
actionData: this.computedEditItem
|
||||
actionData: this.editItem
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -121,6 +121,7 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
step: 1,
|
||||
// 表格相关数据
|
||||
isFormValid: true,
|
||||
@@ -135,11 +136,9 @@ new Vue({
|
||||
serverSearchInput: {
|
||||
processName: null
|
||||
},
|
||||
currentTableGenderType: 'all',
|
||||
isEditDrawerShow: false,
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
tableDataFromBackend: [],
|
||||
headers: [
|
||||
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
|
||||
|
||||
@@ -173,20 +172,6 @@ new Vue({
|
||||
taskStepperList: [],
|
||||
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: {},
|
||||
async created() {
|
||||
const searchParams = new URLSearchParams(location.search.substring(1));
|
||||
@@ -196,11 +181,11 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'submitNode':
|
||||
await this.submitNode(actionData);
|
||||
await this.getTaskHistoryList(actionData);
|
||||
await this.submitNode(uiActionData);
|
||||
await this.getTaskHistoryList(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
|
||||
@@ -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-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-spacer></v-spacer>
|
||||
@@ -21,7 +21,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-data-table :headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -50,6 +50,7 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
@@ -75,17 +76,6 @@ new Vue({
|
||||
{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: {},
|
||||
async created() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
@@ -93,13 +83,13 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'toTaskHistory':
|
||||
await this.toTaskHistory(actionData);
|
||||
await this.toTaskHistory(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doAction] uiActionId not find", { uiActionId });
|
||||
|
||||
@@ -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-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-spacer></v-spacer>
|
||||
@@ -21,7 +21,7 @@
|
||||
</v-row>
|
||||
<v-data-table fixed-header
|
||||
:headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -52,6 +52,7 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
isFormValid: true,
|
||||
requireRules: [
|
||||
@@ -63,7 +64,6 @@ new Vue({
|
||||
studentId: null,
|
||||
classId: null
|
||||
},
|
||||
currentTableGenderType: 'all',
|
||||
isEditDrawerShow: false,
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
@@ -92,20 +92,6 @@ new Vue({
|
||||
],
|
||||
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() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
@@ -113,18 +99,18 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'deleteItem':
|
||||
await this.confirmDeleteItemDialog(actionData);
|
||||
await this.doDeleteItem(actionData);
|
||||
await this.refreshTableData(actionData);
|
||||
await this.confirmDeleteItemDialog(uiActionData);
|
||||
await this.doDeleteItem(uiActionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'toTaskHistory':
|
||||
await this.toTaskHistory(actionData);
|
||||
await this.toTaskHistory(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
|
||||
@@ -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-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-spacer></v-spacer>
|
||||
@@ -22,7 +22,7 @@
|
||||
</v-row>
|
||||
<v-data-table fixed-header
|
||||
:headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -51,11 +51,11 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
],
|
||||
currentTableGenderType: 'all',
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
tableDataFromBackend: [],
|
||||
@@ -76,17 +76,6 @@ new Vue({
|
||||
{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: {},
|
||||
async created() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
@@ -94,13 +83,13 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'toTaskHistory':
|
||||
await this.toTaskHistory(actionData);
|
||||
await this.toTaskHistory(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
|
||||
@@ -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-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-spacer></v-spacer>
|
||||
@@ -23,7 +23,7 @@
|
||||
</v-row>
|
||||
<v-data-table fixed-header
|
||||
:headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -53,11 +53,11 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
],
|
||||
currentTableGenderType: 'all',
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
tableDataFromBackend: [],
|
||||
@@ -78,17 +78,6 @@ new Vue({
|
||||
{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: {},
|
||||
async created() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
@@ -96,13 +85,13 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'toTaskHistory':
|
||||
await this.toTaskHistory(actionData);
|
||||
await this.toTaskHistory(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doAction] uiActionId not find", { uiActionId });
|
||||
|
||||
@@ -59,8 +59,8 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
isFormValid: true,
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
],
|
||||
@@ -70,75 +70,17 @@ new Vue({
|
||||
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: {},
|
||||
tableButtonList: [
|
||||
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
|
||||
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
|
||||
],
|
||||
dialogSaveInfoAction: 'createItem',
|
||||
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: {
|
||||
'editItem.workflowForm': {
|
||||
handler(val) {
|
||||
if (!val) return
|
||||
|
||||
this.constantCollection.workflowFormList = [];
|
||||
for (const item of val) {
|
||||
this.constantCollection.workflowFormList.push({
|
||||
text: item.component.outline,
|
||||
value: item.id
|
||||
})
|
||||
}
|
||||
this.buildWorkflowFormList(val);
|
||||
if (!this.editItem.workflowConfig) return;
|
||||
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)
|
||||
}
|
||||
|
||||
this.buildWorkflowConfig()
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
@@ -148,15 +90,7 @@ new Vue({
|
||||
const searchParams = new URLSearchParams(location.search.substring(1));
|
||||
const type = searchParams.get('type');
|
||||
if(type === 'edit') {
|
||||
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();
|
||||
}
|
||||
this.syncEditItem()
|
||||
} else {
|
||||
this.clearItemData();
|
||||
}
|
||||
@@ -166,15 +100,15 @@ new Vue({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'createItem':
|
||||
await this.confirmCreateItemDialog(actionData);
|
||||
await this.doCreateItem(actionData);
|
||||
await this.confirmCreateItemDialog(uiActionData);
|
||||
await this.doCreateItem(uiActionData);
|
||||
break;
|
||||
case 'updateItem':
|
||||
await this.confirmUpdateItemDialog(actionData);
|
||||
await this.doUpdateItem(actionData);
|
||||
await this.confirmUpdateItemDialog(uiActionData);
|
||||
await this.doUpdateItem(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
@@ -196,6 +130,30 @@ new Vue({
|
||||
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() {
|
||||
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
|
||||
async confirmCreateItemDialog() {
|
||||
@@ -250,7 +219,7 @@ new Vue({
|
||||
* 新增数据
|
||||
*/
|
||||
async doCreateItem() {
|
||||
delete this.computedEditItem.id;
|
||||
delete this.editItem.id;
|
||||
const item = this.buildEditItem();
|
||||
await window.vtoast.loading("新增数据");
|
||||
await window.jianghuAxios({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<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>
|
||||
<span class="body-2">共{{ tableData.length }}条记录</span>
|
||||
<span class="body-2">共{{ tableDataFromBackend.length }}条记录</span>
|
||||
</v-col>
|
||||
<v-spacer></v-spacer>
|
||||
<v-col cols="12" xs="12" sm="4" md="3" xl="3" class="px-0">
|
||||
@@ -19,7 +19,7 @@
|
||||
</v-row>
|
||||
<v-data-table fixed-header
|
||||
:headers="headers"
|
||||
:items="tableData"
|
||||
:items="tableDataFromBackend"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
@@ -50,6 +50,7 @@ new Vue({
|
||||
template: '#app-template',
|
||||
vuetify: new Vuetify(),
|
||||
data: () => ({
|
||||
isMobile: window.innerWidth < 600,
|
||||
// 表格相关数据
|
||||
requireRules: [
|
||||
v => !!v || 'This is required',
|
||||
@@ -58,7 +59,6 @@ new Vue({
|
||||
studentId: null,
|
||||
classId: null
|
||||
},
|
||||
currentTableGenderType: 'all',
|
||||
isEditDrawerShow: false,
|
||||
searchInput: null,
|
||||
isTableLoading: true,
|
||||
@@ -84,40 +84,29 @@ new Vue({
|
||||
dialogSaveInfoAction: '',
|
||||
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() {
|
||||
await this.doUiAction('refreshTableData');
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doUiAction(uiActionId, actionData) {
|
||||
async doUiAction(uiActionId, uiActionData) {
|
||||
switch (uiActionId) {
|
||||
case 'refreshTableData':
|
||||
await this.refreshTableData(actionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
case 'createItem':
|
||||
await this.prepareValidate(actionData);
|
||||
await this.doCreateItem(actionData);
|
||||
await this.prepareValidate(uiActionData);
|
||||
await this.doCreateItem(uiActionData);
|
||||
break;
|
||||
case 'updateItem':
|
||||
await this.prepareValidate(actionData);
|
||||
await this.doUpdateItem(actionData);
|
||||
await this.prepareValidate(uiActionData);
|
||||
await this.doUpdateItem(uiActionData);
|
||||
break;
|
||||
case 'deleteItem':
|
||||
await this.confirmDeleteItemDialog(actionData);
|
||||
await this.doDeleteItem(actionData);
|
||||
await this.refreshTableData(actionData);
|
||||
await this.confirmDeleteItemDialog(uiActionData);
|
||||
await this.doDeleteItem(uiActionData);
|
||||
await this.refreshTableData(uiActionData);
|
||||
break;
|
||||
default:
|
||||
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
||||
@@ -156,7 +145,7 @@ new Vue({
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// CreateItem
|
||||
async doCreateItem() {
|
||||
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=add`;
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = appInfo => {
|
||||
port: 3306,
|
||||
user: 'root',
|
||||
password: '123456',
|
||||
database: 'xianfeng-v1'
|
||||
database: 'jianghujs_workflow'
|
||||
},
|
||||
pool: { min: 0, max: 30 },
|
||||
acquireConnectionTimeout: 30000
|
||||
|
||||
@@ -29,7 +29,7 @@ module.exports = appInfo => {
|
||||
port: '3306',
|
||||
user: 'root',
|
||||
password: '123456',
|
||||
database: 'xianfeng-v1'
|
||||
database: 'jianghujs_workflow'
|
||||
},
|
||||
pool: { min: 0, max: 30 },
|
||||
acquireConnectionTimeout: 30000
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = appInfo => {
|
||||
port: '3306',
|
||||
user: 'root',
|
||||
password: '123456',
|
||||
database: 'xianfeng-v1'
|
||||
database: 'jianghujs_workflow'
|
||||
},
|
||||
pool: { min: 0, max: 30 },
|
||||
acquireConnectionTimeout: 30000,
|
||||
|
||||
Generated
+18598
-361
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -8,7 +8,7 @@
|
||||
"framework": "@jianghujs/jianghu"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jianghujs/jianghu": "3.0.44",
|
||||
"@jianghujs/jianghu": "3.0.50",
|
||||
"dayjs": "^1.11.4",
|
||||
"egg": "^2.15.1",
|
||||
"egg-scripts": "^2.11.0"
|
||||
|
||||
Reference in new issue
Block a user