提交 a55fa6b6 编写于 作者: laizhilong's avatar laizhilong

角色表单保存完成之前,保存按钮禁用

上级 925fe18e
<template>
<div class="view-container deeditview sys-role-edit-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="sysroleeditview"></app-studioaction>
<card class='view-card ' :disHover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.sysrole.editviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrole.editviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction1.visabled" :disabled="toolBarModels.deuiaction1.disabled" class='' @click="toolbar_click({ tag: 'deuiaction1' }, $event)">
<i class='fa fa-sign-out'></i>
<span class='caption'>{{$t('entities.sysrole.editviewtoolbar_toolbar.deuiaction1.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrole.editviewtoolbar_toolbar.deuiaction1.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sysrole.editviewtoolbar_toolbar.tbitem14.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrole.editviewtoolbar_toolbar.tbitem14.tip')}}</div>
</tooltip>
</div>
</div>
<div class='view-top-messages'>
</div>
<div class="content-container">
<div class='view-body-messages'>
</div>
<view_form :viewState="viewState" :viewparams="viewparams" :context="context" :autosave="false" :viewtag="viewtag" :showBusyIndicator="true" updateAction="Update" removeAction="Remove" loaddraftAction="GetDraft" loadAction="Get" createAction="Create" WFSubmitAction="" WFStartAction="" style='' name="form" ref='form' @save="form_save($event)" @remove="form_remove($event)" @load="form_load($event)" @closeview="closeView($event)">
</view_form>
</div>
<div class='view-bottom-messages'>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Component } from "vue-property-decorator";
import SysRoleEditViewBase from "./sys-role-edit-view-base.vue";
import { Component } from "vue-property-decorator";
import SysRoleEditViewBase from "./sys-role-edit-view-base.vue";
import view_form from "@widgets/sys-role/main-form/main-form.vue";
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if (!Object.is(vm.navModel, "route")) {
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit("addCurPageViewtag", {
fullPath: to.fullPath,
viewtag: vm.viewtag,
});
});
},
})
export default class SysRoleEditView extends SysRoleEditViewBase {
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRoleEditViewBase
*/
public Save(
args: any[],
contextJO?: any,
params?: any,
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string
) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
// 禁用保存按钮
_this.toolBarModels.tbitem3.disabled = true;
xData.save().then((response: any) => {
// 启用保存按钮
_this.toolBarModels.tbitem3.disabled = false;
if (!response || response.status !== 200) {
return;
}
_this.$emit("viewdataschange", [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
import view_form from "@widgets/sys-role/main-form/main-form.vue";
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if (!Object.is(vm.navModel, "route")) {
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit("addCurPageViewtag", {
fullPath: to.fullPath,
viewtag: vm.viewtag,
});
});
},
})
export default class SysRoleEditView extends SysRoleEditViewBase {
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRoleEditViewBase
*/
public Save(
args: any[],
contextJO?: any,
params?: any,
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string
) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
// 禁用保存按钮
_this.toolBarModels.tbitem3.disabled = true;
xData.save().then((response: any) => {
// 启用保存按钮
_this.toolBarModels.tbitem3.disabled = false;
if (!response || response.status !== 200) {
return;
}
_this.$emit("viewdataschange", [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册