doAction
This commit is contained in:
1 parent
7708f1b72f
commit
1362008dcd
9 files changed
+521
-19063
No files matched your search
@@ -107,7 +107,6 @@
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
isFormValid: true,
|
isFormValid: true,
|
||||||
@@ -167,6 +166,26 @@
|
|||||||
},
|
},
|
||||||
mounted() { },
|
mounted() { },
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'startCreateItem':
|
||||||
|
await this.clearItemData(actionData);
|
||||||
|
await this.openCreateItemDialog(actionData);
|
||||||
|
break;
|
||||||
|
case 'createItem':
|
||||||
|
await this.confirmCreateItemDialog(actionData);
|
||||||
|
await this.doCreateItem(actionData);
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
await this.closeDrawerShow(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
@@ -209,7 +228,9 @@
|
|||||||
|
|
||||||
// createItem
|
// createItem
|
||||||
async confirmCreateItemDialog() {
|
async confirmCreateItemDialog() {
|
||||||
return window.confirmDialog({ title: '新增', content: '确定新增吗?' })
|
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
|
||||||
|
throw new Error("[confirmCreateFormDialog] 否");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -232,73 +253,6 @@
|
|||||||
|
|
||||||
async closeDrawerShow() {
|
async closeDrawerShow() {
|
||||||
this.isEditDrawerShow = false;
|
this.isEditDrawerShow = false;
|
||||||
},
|
|
||||||
|
|
||||||
// startUpdateItem
|
|
||||||
async prepareItemData({ item }) {
|
|
||||||
this.editItem = { ...item };
|
|
||||||
},
|
|
||||||
|
|
||||||
async openUpdateDialog() {
|
|
||||||
this.currentClickButton = { action: 'edit', title: '修改' };
|
|
||||||
this.isEditDrawerShow = true;
|
|
||||||
this.dialogSaveInfoAction = 'updateItem';
|
|
||||||
},
|
|
||||||
|
|
||||||
// updateItem
|
|
||||||
async confirmUpdateItemDialog() {
|
|
||||||
return window.confirmDialog({ title: '修改', content: '确定修改吗?' });
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存数据
|
|
||||||
*/
|
|
||||||
async doUpdateItem() {
|
|
||||||
const id = this.computedEditItem.id;
|
|
||||||
delete this.computedEditItem.id;
|
|
||||||
await window.vtoast.loading("修改数据");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'taskManagement',
|
|
||||||
actionId: 'updateItem',
|
|
||||||
actionData: this.computedEditItem,
|
|
||||||
where: { id: id }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
await window.vtoast.success("修改数据成功");
|
|
||||||
},
|
|
||||||
|
|
||||||
// updateItem
|
|
||||||
async confirmDeleteItemDialog() {
|
|
||||||
return window.confirmDialog({ title: '删除', content: '确定删除吗?' });
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除数据
|
|
||||||
*/
|
|
||||||
async doDeleteItem({ item }) {
|
|
||||||
const { id } = item;
|
|
||||||
await window.vtoast.loading("删除数据");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'taskManagement',
|
|
||||||
actionId: 'deleteItem',
|
|
||||||
actionData: {},
|
|
||||||
where: { id: id }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await window.vtoast.success("删除数据成功");
|
|
||||||
},
|
|
||||||
getConstantCollectionItemText(key, _value) {
|
|
||||||
const constantCollectionItemFind = this.constantCollection[key].length ? this.constantCollection[key].find(e => e && e.value+'' === _value+'') : '';
|
|
||||||
if (constantCollectionItemFind) {
|
|
||||||
return constantCollectionItemFind.text;
|
|
||||||
}
|
|
||||||
return _value || '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
:disabled="currentNode && currentNode.id && currentNode.id.includes('end-')" :rows="4"/>
|
:disabled="currentNode && currentNode.id && currentNode.id.includes('end-')" :rows="4"/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" style="text-align: center;" class="mb-3">
|
<v-col cols="12" style="text-align: center;" class="mb-3">
|
||||||
<v-btn color="success" class="mx-4" v-for="item in nextLineList" @click="submitNode(item.type)">
|
<v-btn color="success" class="mx-4" v-for="item in nextLineList" @click="doUiAction('submitNode', item.type)">
|
||||||
{{ item.type }}-{{ item.label }}
|
{{ item.type }}-{{ item.label }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -120,7 +120,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
step: 1,
|
step: 1,
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
@@ -197,26 +196,16 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
async doUiAction(actionId, actionData) {
|
||||||
* 获取表格数据
|
switch (actionId) {
|
||||||
*/
|
case 'submitNode':
|
||||||
async refreshTableData() {
|
await this.submitNode(actionData);
|
||||||
this.isTableLoading = true;
|
await this.getTaskHistoryList(actionData);
|
||||||
const serverSearchInput = _.pickBy(this.serverSearchInput, value => !!value);
|
break;
|
||||||
const {data: {appData: {rows}}} = await window.jianghuAxios({
|
default:
|
||||||
data: {
|
console.error("[doUiAction] actionId not find", { actionId });
|
||||||
appData: {
|
break;
|
||||||
pageId: 'taskCreateManagement',
|
|
||||||
actionId: 'selectProcessList',
|
|
||||||
actionData: {},
|
|
||||||
where: {},
|
|
||||||
whereLike: serverSearchInput,
|
|
||||||
orderBy: [{column: 'operationAt', order: 'desc'}]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
this.tableDataFromBackend = _.groupBy(rows, 'categoryId');
|
|
||||||
this.isTableLoading = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -253,22 +242,6 @@ new Vue({
|
|||||||
this.step = step;
|
this.step = step;
|
||||||
},
|
},
|
||||||
|
|
||||||
// startCreateItem
|
|
||||||
async clearItemData({processVersionId}) {
|
|
||||||
this.editItem = {processVersionId};
|
|
||||||
},
|
|
||||||
|
|
||||||
async openCreateItemDialog() {
|
|
||||||
this.currentClickButton = {action: 'add', title: '新增'};
|
|
||||||
this.isEditDrawerShow = true;
|
|
||||||
this.dialogSaveInfoAction = 'createItem';
|
|
||||||
},
|
|
||||||
|
|
||||||
// createItem
|
|
||||||
async confirmCreateItemDialog() {
|
|
||||||
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增数据
|
* 新增数据
|
||||||
*/
|
*/
|
||||||
@@ -284,79 +257,8 @@ new Vue({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
await window.vtoast.success("提交数据成功");
|
await window.vtoast.success("提交数据成功");
|
||||||
this.getTaskHistoryList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async closeDrawerShow() {
|
|
||||||
this.isEditDrawerShow = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// startUpdateItem
|
|
||||||
async prepareItemData({item}) {
|
|
||||||
this.editItem = {...item};
|
|
||||||
},
|
|
||||||
|
|
||||||
async openUpdateDialog() {
|
|
||||||
this.currentClickButton = {action: 'edit', title: '修改'};
|
|
||||||
this.isEditDrawerShow = true;
|
|
||||||
this.dialogSaveInfoAction = 'updateItem';
|
|
||||||
},
|
|
||||||
|
|
||||||
// updateItem
|
|
||||||
async confirmUpdateItemDialog() {
|
|
||||||
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存数据
|
|
||||||
*/
|
|
||||||
async doUpdateItem() {
|
|
||||||
const id = this.computedEditItem.id;
|
|
||||||
delete this.computedEditItem.id;
|
|
||||||
await window.vtoast.loading("修改数据");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'taskManagement',
|
|
||||||
actionId: 'updateItem',
|
|
||||||
actionData: this.computedEditItem,
|
|
||||||
where: {id: id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
await window.vtoast.success("修改数据成功");
|
|
||||||
},
|
|
||||||
|
|
||||||
// updateItem
|
|
||||||
async confirmDeleteItemDialog() {
|
|
||||||
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除数据
|
|
||||||
*/
|
|
||||||
async doDeleteItem({item}) {
|
|
||||||
const {id} = item;
|
|
||||||
await window.vtoast.loading("删除数据");
|
|
||||||
await window.jianghuAxios({
|
|
||||||
data: {
|
|
||||||
appData: {
|
|
||||||
pageId: 'taskManagement',
|
|
||||||
actionId: 'deleteItem',
|
|
||||||
actionData: {},
|
|
||||||
where: {id: id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await window.vtoast.success("删除数据成功");
|
|
||||||
},
|
|
||||||
getConstantCollectionItemText(key, _value) {
|
|
||||||
const constantCollectionItemFind = this.constantCollection[key].find(e => e.value + '' === _value + '');
|
|
||||||
if (constantCollectionItemFind) {
|
|
||||||
return constantCollectionItemFind.text;
|
|
||||||
}
|
|
||||||
return _value;
|
|
||||||
},
|
|
||||||
formTitlePrefix(title, type) {
|
formTitlePrefix(title, type) {
|
||||||
if (type === 'prev') {
|
if (type === 'prev') {
|
||||||
return '历史-' + title;
|
return '历史-' + title;
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
requireRules: [
|
requireRules: [
|
||||||
@@ -94,6 +93,19 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'toTaskHistory':
|
||||||
|
await this.toTaskHistory(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
isFormValid: true,
|
isFormValid: true,
|
||||||
@@ -114,6 +113,24 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'deleteItem':
|
||||||
|
await this.confirmDeleteItemDialog(actionData);
|
||||||
|
await this.doDeleteItem(actionData);
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'toTaskHistory':
|
||||||
|
await this.toTaskHistory(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doUiAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
@@ -137,7 +154,9 @@ new Vue({
|
|||||||
|
|
||||||
// updateItem
|
// updateItem
|
||||||
async confirmDeleteItemDialog() {
|
async confirmDeleteItemDialog() {
|
||||||
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
|
if (await window.confirmDialog({title: "删除", content: "确定删除吗?"}) === false) {
|
||||||
|
throw new Error("[confirmDeleteItemDialog] 否");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -158,6 +177,7 @@ new Vue({
|
|||||||
});
|
});
|
||||||
await window.vtoast.success("删除数据成功");
|
await window.vtoast.success("删除数据成功");
|
||||||
},
|
},
|
||||||
|
// 跳转
|
||||||
toTaskHistory({item}) {
|
toTaskHistory({item}) {
|
||||||
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
|
location.href = `/${window.appInfo.appId}/page/taskHistoryManagement?taskId=${item.taskId}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
requireRules: [
|
requireRules: [
|
||||||
@@ -95,6 +94,19 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'toTaskHistory':
|
||||||
|
await this.toTaskHistory(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doUiAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
requireRules: [
|
requireRules: [
|
||||||
@@ -97,6 +96,19 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'toTaskHistory':
|
||||||
|
await this.toTaskHistory(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
isFormValid: true,
|
isFormValid: true,
|
||||||
@@ -167,6 +166,21 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'createItem':
|
||||||
|
await this.confirmCreateItemDialog(actionData);
|
||||||
|
await this.doCreateItem(actionData);
|
||||||
|
break;
|
||||||
|
case 'updateItem':
|
||||||
|
await this.confirmUpdateItemDialog(actionData);
|
||||||
|
await this.doUpdateItem(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doUiAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
buildEditItem() {
|
buildEditItem() {
|
||||||
const item = {
|
const item = {
|
||||||
workflowId: this.editItem.workflowId || null,
|
workflowId: this.editItem.workflowId || null,
|
||||||
@@ -227,13 +241,11 @@ new Vue({
|
|||||||
|
|
||||||
// createItem
|
// createItem
|
||||||
async confirmCreateItemDialog() {
|
async confirmCreateItemDialog() {
|
||||||
return window.confirmDialog({title: '新增', content: '确定新增吗?'})
|
if (await window.confirmDialog({title: "新增", content: "确定新增吗?"}) === false) {
|
||||||
},
|
throw new Error("[confirmCreateFormDialog] 否");
|
||||||
validate() {
|
|
||||||
if (!this.editItem.workflowId || !this.editItem.workflowId) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增数据
|
* 新增数据
|
||||||
*/
|
*/
|
||||||
@@ -255,7 +267,9 @@ new Vue({
|
|||||||
|
|
||||||
// updateItem
|
// updateItem
|
||||||
async confirmUpdateItemDialog() {
|
async confirmUpdateItemDialog() {
|
||||||
return window.confirmDialog({title: '修改', content: '确定修改吗?'});
|
if (await window.confirmDialog({title: "修改", content: "确定修改吗?"}) === false) {
|
||||||
|
throw new Error("[confirmUpdateItemDialog] 否");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,7 +8,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="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('startCreateItem')">新增</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">共{{ tableData.length }}条记录</span>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
@@ -49,7 +49,6 @@ new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
template: '#app-template',
|
template: '#app-template',
|
||||||
vuetify: new Vuetify(),
|
vuetify: new Vuetify(),
|
||||||
mixins: [window.jianghuUiActionMixins],
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// 表格相关数据
|
// 表格相关数据
|
||||||
requireRules: [
|
requireRules: [
|
||||||
@@ -79,7 +78,7 @@ new Vue({
|
|||||||
currentClickButton: {title: '新增', action: 'add'},
|
currentClickButton: {title: '新增', action: 'add'},
|
||||||
editItem: {},
|
editItem: {},
|
||||||
tableButtonList: [
|
tableButtonList: [
|
||||||
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
|
{text: '修改', buttonType: 'edit', color: 'success', action: 'updateItem'},
|
||||||
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
|
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
|
||||||
],
|
],
|
||||||
dialogSaveInfoAction: '',
|
dialogSaveInfoAction: '',
|
||||||
@@ -102,6 +101,29 @@ new Vue({
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doUiAction(actionId, actionData) {
|
||||||
|
switch (actionId) {
|
||||||
|
case 'refreshTableData':
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
case 'createItem':
|
||||||
|
await this.prepareValidate(actionData);
|
||||||
|
await this.doCreateItem(actionData);
|
||||||
|
break;
|
||||||
|
case 'updateItem':
|
||||||
|
await this.prepareValidate(actionData);
|
||||||
|
await this.doUpdateItem(actionData);
|
||||||
|
break;
|
||||||
|
case 'deleteItem':
|
||||||
|
await this.confirmDeleteItemDialog(actionData);
|
||||||
|
await this.doDeleteItem(actionData);
|
||||||
|
await this.refreshTableData(actionData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.error("[doUiAction] actionId not find", { actionId });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取表格数据
|
* 获取表格数据
|
||||||
*/
|
*/
|
||||||
@@ -128,27 +150,28 @@ new Vue({
|
|||||||
this.isTableLoading = false;
|
this.isTableLoading = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// startCreateItem
|
async prepareValidate() {
|
||||||
async clearItemData() {
|
if(this.isMobile) {
|
||||||
if(this.isMobile) {
|
window.vtoast.fail({message: '该功能只能在电脑使用'})
|
||||||
window.vtoast.fail({message: '该功能只能在电脑使用'})
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// CreateItem
|
||||||
|
async doCreateItem() {
|
||||||
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=add`;
|
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=add`;
|
||||||
},
|
},
|
||||||
|
|
||||||
// startUpdateItem
|
// UpdateItem
|
||||||
async prepareItemData({item}) {
|
async doUpdateItem({item}) {
|
||||||
if(this.isMobile) {
|
|
||||||
window.vtoast.fail({message: '该功能只能在电脑使用'})
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
|
sessionStorage.setItem('workflowEditItem', JSON.stringify(item))
|
||||||
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=edit`;
|
window.location.href = `/${window.appInfo.appId}/page/workflowEditor?type=edit`;
|
||||||
},
|
},
|
||||||
|
|
||||||
async confirmDeleteItemDialog() {
|
async confirmDeleteItemDialog() {
|
||||||
return window.confirmDialog({title: '删除', content: '确定删除吗?'});
|
if (await window.confirmDialog({title: "删除", content: "确定删除吗?"}) === false) {
|
||||||
|
throw new Error("[confirmDeleteItemDialog] 否");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Generated
+367
-18858
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user