提交 394e56fb 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 9580ea95
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="false" :isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="" updateAction=""
removeAction="Remove" removeAction="Remove"
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="true" :isOpenEdit="true"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="Update" updateAction="Update"
removeAction="Remove" removeAction="Remove"
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="false" :isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="" updateAction=""
removeAction="Remove" removeAction="Remove"
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="false" :isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="" updateAction=""
removeAction="Remove" removeAction="Remove"
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="false" :isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="" updateAction=""
removeAction="Remove" removeAction="Remove"
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="false" :isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="" updateAction=""
removeAction="Remove" removeAction="Remove"
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
:showBusyIndicator="true" :showBusyIndicator="true"
:isOpenEdit="true" :isOpenEdit="true"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
updateAction="Update" updateAction="Update"
removeAction="Remove" removeAction="Remove"
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
> .ivu-card-body { > .ivu-card-body {
// height: 50%; // height: 50%;
// flex-grow: 1; // flex-grow: 1;
height: calc(100% - 62px); height: calc(100% - 74px);
padding: 0px; padding: 0px;
> .content-container { > .content-container {
height: 100%; height: 100%;
......
...@@ -479,11 +479,12 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -479,11 +479,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
} }
...@@ -491,15 +492,19 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -491,15 +492,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -522,6 +527,13 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -522,6 +527,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
}); });
} }
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -738,7 +750,6 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -738,7 +750,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -782,7 +793,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -782,7 +793,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -440,6 +440,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -440,6 +440,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1697,7 +1705,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1697,7 +1705,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -476,6 +476,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -476,6 +476,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1699,7 +1707,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1699,7 +1707,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -435,11 +435,12 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -435,11 +435,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
} }
...@@ -447,15 +448,19 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -447,15 +448,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -478,6 +483,13 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -478,6 +483,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
}); });
} }
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -694,7 +706,6 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -694,7 +706,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -738,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -738,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -392,6 +392,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -392,6 +392,14 @@ export default class MainBase extends Vue implements ControlInterface {
return this.selections[0]; return this.selections[0];
} }
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1633,7 +1641,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1633,7 +1641,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -449,11 +449,12 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -449,11 +449,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
} }
...@@ -461,15 +462,19 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -461,15 +462,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -492,6 +497,13 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -492,6 +497,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
}); });
} }
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -708,7 +720,6 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -708,7 +720,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -752,7 +763,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -752,7 +763,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -392,6 +392,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -392,6 +392,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1617,7 +1625,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1617,7 +1625,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -327,11 +327,12 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -327,11 +327,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
} }
...@@ -339,15 +340,19 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -339,15 +340,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -370,6 +375,13 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -370,6 +375,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
}); });
} }
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -586,7 +598,6 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -586,7 +598,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -630,7 +641,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -630,7 +641,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -308,6 +308,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -308,6 +308,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1477,7 +1485,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1477,7 +1485,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -408,6 +408,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -408,6 +408,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1605,7 +1613,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1605,7 +1613,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -327,11 +327,12 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -327,11 +327,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
} }
...@@ -339,15 +340,19 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -339,15 +340,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase * @memberof DefaultBase
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -370,6 +375,13 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -370,6 +375,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
}); });
} }
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -586,7 +598,6 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -586,7 +598,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -630,7 +641,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -630,7 +641,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -296,6 +296,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -296,6 +296,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public opendata: any; @Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1457,7 +1465,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1457,7 +1465,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册