提交 354c2493 编写于 作者: ibizdev's avatar ibizdev

zhouweidong@lab.ibiz5.com 发布系统代码

上级 e939fa21
## v7.0.0-alpha.13 [2020-7-12]
### Bug修复
修复表格设置更新默认值不生效
修复行编辑中文本字段修改数据保存无法生效
修复行编辑时的错误提示
修复表格开关部件保存异常问题
修复表单可以修改数据主键问题
修复表格操作列问题
#### 基础文件
优化关系界面逻辑
## v7.0.0-alpha.12 [2020-7-2] ## v7.0.0-alpha.12 [2020-7-2]
### Bug修复 ### Bug修复
...@@ -14,6 +34,14 @@ ...@@ -14,6 +34,14 @@
修复多行输入十行 高度问题 修复多行输入十行 高度问题
修复调整实体处理逻辑(参数name转化为codeName)
修复表单项更新值规则校验
修复单位部门选择器禁用功能
修复修复去掉某个子菜单后,主菜单不显示
### 功能新增及优化 ### 功能新增及优化
#### 模板 #### 模板
...@@ -24,14 +52,28 @@ ...@@ -24,14 +52,28 @@
新增状态向导面板(658) 新增状态向导面板(658)
优化门户操作栏 新增门户操作栏图标(654)
新增首页空白模式支持
新增表格支持列拖动
优化应用级数据状态同步功能 新增主状态操作标识权限逻辑
新增工具栏、表格操作列、表单分组主状态操作标识判断
优化应用级数据状态同步功能(654)
优化应用国际化部分
#### 基础文件 #### 基础文件
新增修改密码功能(654) 新增修改密码功能(654)
优化无权限错误信息友好提示
优化应用国际化部分
## v7.0.0-alpha.11 [2020-6-21] ## v7.0.0-alpha.11 [2020-6-21]
### Bug修复 ### Bug修复
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"@fullcalendar/vue": "^4.4.0", "@fullcalendar/vue": "^4.4.0",
"vuedraggable": "^2.23.2", "vuedraggable": "^2.23.2",
"async-validator": "^3.3.0", "async-validator": "^3.3.0",
"@popperjs/core": "^2.4.3",
"axios": "^0.19.1", "axios": "^0.19.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"echarts": "^4.6.0", "echarts": "^4.6.0",
......
...@@ -161,6 +161,7 @@ export default class Breadcrumb extends Vue { ...@@ -161,6 +161,7 @@ export default class Breadcrumb extends Vue {
if(item && item.meta && item.meta.viewType && Object.is(item.meta.viewType,"APPINDEX")){ if(item && item.meta && item.meta.viewType && Object.is(item.meta.viewType,"APPINDEX")){
let path: string | null = window.sessionStorage.getItem(Environment.AppName); let path: string | null = window.sessionStorage.getItem(Environment.AppName);
if (path) { if (path) {
this.$store.commit("removeAllPage");
this.$router.push({ path: path }); this.$router.push({ path: path });
} else { } else {
this.$router.push("/"); this.$router.push("/");
......
...@@ -271,6 +271,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -271,6 +271,7 @@ export default class AppFormDRUIPart extends Vue {
//设置顶层视图唯一标识 //设置顶层视图唯一标识
Object.assign(tempContext,this.context); Object.assign(tempContext,this.context);
Object.assign(tempContext,{srfparentdename:this.parentName,srfparentkey:_paramitem}); Object.assign(tempContext,{srfparentdename:this.parentName,srfparentkey:_paramitem});
Object.assign(tempParam,{srfparentdename:this.parentName,srfparentkey:_paramitem});
// 设置局部上下文 // 设置局部上下文
if(this.localContext && Object.keys(this.localContext).length >0){ if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localContext); let _context:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localContext);
...@@ -292,9 +293,9 @@ export default class AppFormDRUIPart extends Vue { ...@@ -292,9 +293,9 @@ export default class AppFormDRUIPart extends Vue {
} }
} }
if(!this.isForbidLoad){ if(!this.isForbidLoad){
this.$nextTick(() => { setTimeout(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}}); this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
}); }, 0);
} }
} }
......
...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue { ...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPicker * @memberof AppPicker
*/ */
@Watch('value') @Watch('value',{immediate:true})
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal; this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) { if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop, Watch, Model } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch, Model } from 'vue-property-decorator';
import moment from "moment";
@Component({}) @Component({})
export default class AppSpan extends Vue { export default class AppSpan extends Vue {
...@@ -18,6 +18,38 @@ export default class AppSpan extends Vue { ...@@ -18,6 +18,38 @@ export default class AppSpan extends Vue {
*/ */
@Prop() public value?: any; @Prop() public value?: any;
/**
* 数据类型
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public dataType?: string;
/**
* 单位名称
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public unitName?: string;
/**
* 精度
*
* @type {string}
* @memberof AppFormatData
*/
@Prop({default:'2'}) public precision?:string;
/**
* 日期值格式化
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public valueFormat?: string;
/** /**
* 当前表单项名称 * 当前表单项名称
* *
...@@ -158,12 +190,51 @@ export default class AppSpan extends Vue { ...@@ -158,12 +190,51 @@ export default class AppSpan extends Vue {
}else{ }else{
if(this.$util.isEmpty(this.value)){ if(this.$util.isEmpty(this.value)){
this.text = ''; this.text = '';
}else if(this.dataType){
this.currencyFormat();
}else if(this.valueFormat){
this.dateFormat();
}else{ }else{
this.text = this.value; this.text = this.value;
} }
}
}
/**
* 货币格式化
*
* @memberof AppSpan
*/
public currencyFormat(){
let number:any = Number(this.value);
let _unitName = this.unitName?this.unitName:'';
let _precision = Number(this.precision);
if(Object.is(this.dataType,"CURRENCY")){
this.text = Number(number.toFixed(_precision)).toLocaleString('en-US')+ ' '+ _unitName;
}else if(Object.is(this.dataType,"FLOAT") || Object.is(this.dataType,"DECIMAL")){
this.text = number.toFixed(_precision);
}else {
this.text = this.value;
} }
} }
/**
* 日期格式化
*
* @memberof AppSpan
*/
public dateFormat(){
if(this.valueFormat){
if(this.valueFormat.indexOf('%1$t') !== -1){
this.text= moment(this.data).format("YYYY-MM-DD HH:mm:ss");
}else if(this.valueFormat.indexOf('%1$s') == -1){
this.text= moment(this.data).format(this.valueFormat);
}else{
this.text= this.value;
}
}
}
} }
</script> </script>
......
...@@ -826,6 +826,7 @@ export default class IBZDepartmentMPickupViewBase extends Vue { ...@@ -826,6 +826,7 @@ export default class IBZDepartmentMPickupViewBase extends Vue {
* @memberof IBZDepartmentMPickupViewBase * @memberof IBZDepartmentMPickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -661,6 +661,7 @@ export default class IBZDepartmentPickupViewBase extends Vue { ...@@ -661,6 +661,7 @@ export default class IBZDepartmentPickupViewBase extends Vue {
* @memberof IBZDepartmentPickupViewBase * @memberof IBZDepartmentPickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -826,6 +826,7 @@ export default class IBZEmployeeMPickupViewBase extends Vue { ...@@ -826,6 +826,7 @@ export default class IBZEmployeeMPickupViewBase extends Vue {
* @memberof IBZEmployeeMPickupViewBase * @memberof IBZEmployeeMPickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -661,6 +661,7 @@ export default class IBZEmployeePickupViewBase extends Vue { ...@@ -661,6 +661,7 @@ export default class IBZEmployeePickupViewBase extends Vue {
* @memberof IBZEmployeePickupViewBase * @memberof IBZEmployeePickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -661,6 +661,7 @@ export default class IBZOrganizationPickupViewBase extends Vue { ...@@ -661,6 +661,7 @@ export default class IBZOrganizationPickupViewBase extends Vue {
* @memberof IBZOrganizationPickupViewBase * @memberof IBZOrganizationPickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -661,6 +661,7 @@ export default class IBZPostPickupViewBase extends Vue { ...@@ -661,6 +661,7 @@ export default class IBZPostPickupViewBase extends Vue {
* @memberof IBZPostPickupViewBase * @memberof IBZPostPickupViewBase
*/ */
public onClickCancel(): void { public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null); this.$emit('close', null);
} }
......
...@@ -48,7 +48,9 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -48,7 +48,9 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/ibzposts/${context.ibzpost}/select`,isloading); let res:any = Http.getInstance().get(`/ibzposts/${context.ibzpost}/select`,isloading);
return res;
} }
/** /**
...@@ -71,6 +73,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -71,6 +73,7 @@ export default class IBZPostServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibzposts`,data,isloading); let res:any = await Http.getInstance().post(`/ibzposts`,data,isloading);
return res; return res;
} }
...@@ -87,6 +90,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -87,6 +90,7 @@ export default class IBZPostServiceBase extends EntityService {
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibzposts/${context.ibzpost}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzposts/${context.ibzpost}`,data,isloading);
return res; return res;
} }
...@@ -100,7 +104,8 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -100,7 +104,8 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/ibzposts/${context.ibzpost}`,isloading); let res:any = Http.getInstance().delete(`/ibzposts/${context.ibzpost}`,isloading);
return res;
} }
/** /**
...@@ -114,6 +119,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -114,6 +119,7 @@ export default class IBZPostServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzposts/${context.ibzpost}`,isloading); let res:any = await Http.getInstance().get(`/ibzposts/${context.ibzpost}`,isloading);
return res; return res;
} }
...@@ -129,6 +135,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -129,6 +135,7 @@ export default class IBZPostServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzposts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/ibzposts/getdraft`,isloading);
res.data.ibzpost = data.ibzpost; res.data.ibzpost = data.ibzpost;
return res; return res;
} }
...@@ -142,7 +149,8 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -142,7 +149,8 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/ibzposts/${context.ibzpost}/checkkey`,data,isloading); let res:any = Http.getInstance().post(`/ibzposts/${context.ibzpost}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -158,6 +166,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -158,6 +166,7 @@ export default class IBZPostServiceBase extends EntityService {
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibzposts/${context.ibzpost}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzposts/${context.ibzpost}/save`,data,isloading);
return res; return res;
} }
...@@ -172,6 +181,21 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -172,6 +181,21 @@ export default class IBZPostServiceBase extends EntityService {
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/ibzposts/fetchdefault`,tempData,isloading); let res:any = Http.getInstance().get(`/ibzposts/fetchdefault`,tempData,isloading);
return res;
}
/**
* searchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBZPostServiceBase
*/
public async searchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/ibzposts/searchdefault`,tempData,isloading);
} }
} }
\ No newline at end of file
...@@ -48,7 +48,9 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -48,7 +48,9 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/ibzteams/${context.ibzteam}/select`,isloading); let res:any = Http.getInstance().get(`/ibzteams/${context.ibzteam}/select`,isloading);
return res;
} }
/** /**
...@@ -62,21 +64,6 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -62,21 +64,6 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let ibzteammembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers'),'undefined')){
ibzteammembersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers') as any);
if(ibzteammembersData && ibzteammembersData.length && ibzteammembersData.length > 0){
ibzteammembersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.teammemberid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.ibzteammembers = ibzteammembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -87,6 +74,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -87,6 +74,7 @@ export default class IBZTeamServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibzteams`,data,isloading); let res:any = await Http.getInstance().post(`/ibzteams`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers)); this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
...@@ -101,24 +89,9 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -101,24 +89,9 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let ibzteammembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers'),'undefined')){
ibzteammembersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers') as any);
if(ibzteammembersData && ibzteammembersData.length && ibzteammembersData.length > 0){
ibzteammembersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.teammemberid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.ibzteammembers = ibzteammembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibzteams/${context.ibzteam}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzteams/${context.ibzteam}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
...@@ -132,7 +105,8 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -132,7 +105,8 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/ibzteams/${context.ibzteam}`,isloading); let res:any = Http.getInstance().delete(`/ibzteams/${context.ibzteam}`,isloading);
return res;
} }
/** /**
...@@ -146,7 +120,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -146,7 +120,7 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzteams/${context.ibzteam}`,isloading); let res:any = await Http.getInstance().get(`/ibzteams/${context.ibzteam}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
...@@ -162,7 +136,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -162,7 +136,7 @@ export default class IBZTeamServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzteams/getdraft`,isloading); let res:any = await Http.getInstance().get(`/ibzteams/getdraft`,isloading);
res.data.ibzteam = data.ibzteam; res.data.ibzteam = data.ibzteam;
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
...@@ -176,7 +150,8 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -176,7 +150,8 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/ibzteams/${context.ibzteam}/checkkey`,data,isloading); let res:any = Http.getInstance().post(`/ibzteams/${context.ibzteam}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -190,24 +165,9 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -190,24 +165,9 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let ibzteammembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers'),'undefined')){
ibzteammembersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzteammembers') as any);
if(ibzteammembersData && ibzteammembersData.length && ibzteammembersData.length > 0){
ibzteammembersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.teammemberid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.ibzteammembers = ibzteammembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibzteams/${context.ibzteam}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzteams/${context.ibzteam}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
...@@ -222,6 +182,21 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -222,6 +182,21 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/ibzteams/fetchdefault`,tempData,isloading); let res:any = Http.getInstance().get(`/ibzteams/fetchdefault`,tempData,isloading);
return res;
}
/**
* searchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBZTeamServiceBase
*/
public async searchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/ibzteams/searchdefault`,tempData,isloading);
} }
} }
\ No newline at end of file
.el-popover { .app-popover-wrapper {
overflow-y: auto;
//z-index: 99 !important;
background: #ffffff;
border: 1px solid #dee0e4;
padding: 0px;
z-index: 2000;
color: var(--app-color-font-content);
line-height: 1.4;
text-align: justify;
font-size: 14px;
overflow-y: hidden;
overflow-x: hidden;
.el-card__header {
padding: 5px 10px;
border-bottom: 1px solid #dee0e4;
color: var(--app-color-font-content);
}
.el-card{
min-width: 150px;
border: none;
background-color: #ffffff;
color: var(--app-color-font-content);
}
.el-card__body {
padding: 0px;
overflow-x:hidden;
overflow-y: auto;
.viewcontainer2{
.content-container{
margin: 0;
}
}
}
}
.clearfix{
position: relative;
.cancel{
position: absolute; position: absolute;
right: 5px; top: 0;
top: 5px; right: 0;
bottom: 0;
left: 0;
.app-popover.app-popper {
border-radius: 5px;
overflow: auto;
border: 1px solid #e8e8e8;
padding: 5px;
background: #e8e8e8;
} }
} }
\ No newline at end of file
...@@ -7,18 +7,21 @@ ...@@ -7,18 +7,21 @@
<i-col v-show="detailsModel.n_deptcode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_deptcode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_deptcode_like' :itemRules="this.rules.n_deptcode_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_deptcode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_deptcode_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_deptcode_like' :itemRules="this.rules.n_deptcode_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_deptcode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_deptcode_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_deptcode_like" @enter="onEnter($event)" :disabled="detailsModel.n_deptcode_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_deptcode_like" @enter="onEnter($event)" :disabled="detailsModel.n_deptcode_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.n_deptname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_deptname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_deptname_like' :itemRules="this.rules.n_deptname_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_deptname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_deptname_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_deptname_like' :itemRules="this.rules.n_deptname_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_deptname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_deptname_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_deptname_like" @enter="onEnter($event)" :disabled="detailsModel.n_deptname_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_deptname_like" @enter="onEnter($event)" :disabled="detailsModel.n_deptname_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.n_bcode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_bcode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_bcode_like' :itemRules="this.rules.n_bcode_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_bcode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_bcode_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_bcode_like' :itemRules="this.rules.n_bcode_like" class='' :caption="$t('entities.ibzdepartment.default_searchform.details.n_bcode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_bcode_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_bcode_like" @enter="onEnter($event)" :disabled="detailsModel.n_bcode_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_bcode_like" @enter="onEnter($event)" :disabled="detailsModel.n_bcode_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
......
...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService { ...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
<i-col v-show="detailsModel.deptcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.deptcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptcode' :itemRules="this.rules.deptcode" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='deptcode' :itemRules="this.rules.deptcode" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.deptcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptcode.disabled" type='text' style=""></input-box> <input-box v-model="data.deptcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.deptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.deptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptname' :itemRules="this.rules.deptname" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='deptname' :itemRules="this.rules.deptname" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.deptname" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptname.disabled" type='text' style=""></input-box> <input-box v-model="data.deptname" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -30,18 +32,21 @@ ...@@ -30,18 +32,21 @@
<i-col v-show="detailsModel.shortname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.shortname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='shortname' :itemRules="this.rules.shortname" class='' :caption="$t('entities.ibzdepartment.main_form.details.shortname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.shortname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='shortname' :itemRules="this.rules.shortname" class='' :caption="$t('entities.ibzdepartment.main_form.details.shortname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.shortname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.shortname" @enter="onEnter($event)" unit="" :disabled="detailsModel.shortname.disabled" type='text' style=""></input-box> <input-box v-model="data.shortname" @enter="onEnter($event)" unit="" :disabled="detailsModel.shortname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.bcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.bcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='bcode' :itemRules="this.rules.bcode" class='' :caption="$t('entities.ibzdepartment.main_form.details.bcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='bcode' :itemRules="this.rules.bcode" class='' :caption="$t('entities.ibzdepartment.main_form.details.bcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.bcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.bcode.disabled" type='text' style=""></input-box> <input-box v-model="data.bcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.bcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.deptlevel.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.deptlevel.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptlevel' :itemRules="this.rules.deptlevel" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptlevel')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptlevel.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='deptlevel' :itemRules="this.rules.deptlevel" class='' :caption="$t('entities.ibzdepartment.main_form.details.deptlevel')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptlevel.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.deptlevel" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptlevel.disabled" type='number' style=""></input-box> <input-box v-model="data.deptlevel" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptlevel.disabled" type='number' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -69,20 +74,23 @@ ...@@ -69,20 +74,23 @@
<i-col v-show="detailsModel.showorder.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.showorder.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='showorder' :itemRules="this.rules.showorder" class='' :caption="$t('entities.ibzdepartment.main_form.details.showorder')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.showorder.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='showorder' :itemRules="this.rules.showorder" class='' :caption="$t('entities.ibzdepartment.main_form.details.showorder')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.showorder.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.showorder" @enter="onEnter($event)" unit="" :disabled="detailsModel.showorder.disabled" type='number' style=""></input-box> <input-box v-model="data.showorder" @enter="onEnter($event)" unit="" :disabled="detailsModel.showorder.disabled" type='number' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzdepartment.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzdepartment.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='createdate' :value="data.createdate" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='createdate' :value="data.createdate" valueFormat="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzdepartment.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzdepartment.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='updatedate' :value="data.updatedate" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='updatedate' :value="data.updatedate" valueFormat="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1483,9 +1491,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1483,9 +1491,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzdepartment){
Object.assign(this.context,{ibzdepartment:data.ibzdepartment})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -165,7 +165,6 @@ export default class MainService extends ControlService { ...@@ -165,7 +165,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -651,7 +651,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -651,7 +651,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['srfkey']; public defaultUpdateItems:Array<any> =[];
/** /**
* 选中行数据 * 选中行数据
...@@ -1695,7 +1695,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1695,7 +1695,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -60,6 +60,7 @@ export default class MainModel { ...@@ -60,6 +60,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'deptid', prop: 'deptid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'leadername', name: 'leadername',
......
...@@ -99,7 +99,7 @@ export default class MainService extends ControlService { ...@@ -99,7 +99,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -158,14 +158,14 @@ export default class MainService extends ControlService { ...@@ -158,14 +158,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -306,4 +306,40 @@ export default class MainService extends ControlService { ...@@ -306,4 +306,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
<i-col v-show="detailsModel.deptcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.deptcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptcode' :itemRules="this.rules.deptcode" class='' :caption="$t('entities.ibzdepartment.newform_form.details.deptcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='deptcode' :itemRules="this.rules.deptcode" class='' :caption="$t('entities.ibzdepartment.newform_form.details.deptcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.deptcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptcode.disabled" type='text' style=""></input-box> <input-box v-model="data.deptcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.deptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.deptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptname' :itemRules="this.rules.deptname" class='' :caption="$t('entities.ibzdepartment.newform_form.details.deptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='deptname' :itemRules="this.rules.deptname" class='' :caption="$t('entities.ibzdepartment.newform_form.details.deptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.deptname" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptname.disabled" type='text' style=""></input-box> <input-box v-model="data.deptname" @enter="onEnter($event)" unit="" :disabled="detailsModel.deptname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1280,9 +1282,6 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -1280,9 +1282,6 @@ export default class NewFormBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzdepartment){
Object.assign(this.context,{ibzdepartment:data.ibzdepartment})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -165,7 +165,6 @@ export default class NewFormService extends ControlService { ...@@ -165,7 +165,6 @@ export default class NewFormService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -1215,9 +1215,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1215,9 +1215,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzdeptmember){
Object.assign(this.context,{ibzdeptmember:data.ibzdeptmember})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -174,7 +174,6 @@ export default class MainService extends ControlService { ...@@ -174,7 +174,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='deptname' editorType="PICKER" :value="row.deptname"></app-span> <app-span name='deptname' editorType="PICKER" :value="row.deptname" dataType="PICKUPTEXT" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='postname' editorType="PICKER" :value="row.postname"></app-span> <app-span name='postname' editorType="PICKER" :value="row.postname" dataType="PICKUPTEXT" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='personname' editorType="PICKER" :value="row.personname"></app-span> <app-span name='personname' editorType="PICKER" :value="row.personname" dataType="PICKUPTEXT" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -160,10 +160,11 @@ ...@@ -160,10 +160,11 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box> </input-box>
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='deptid' editorType="HIDDEN" :value="row.deptid"></app-span> <app-span name='deptid' editorType="HIDDEN" :value="row.deptid" dataType="PICKUP" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -187,10 +188,11 @@ ...@@ -187,10 +188,11 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box> </input-box>
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='postid' editorType="HIDDEN" :value="row.postid"></app-span> <app-span name='postid' editorType="HIDDEN" :value="row.postid" dataType="PICKUP" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -214,10 +216,11 @@ ...@@ -214,10 +216,11 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box> </input-box>
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='userid' editorType="HIDDEN" :value="row.userid"></app-span> <app-span name='userid' editorType="HIDDEN" :value="row.userid" dataType="PICKUP" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -684,7 +687,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -684,7 +687,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['postid','deptid','postname','userid','personname','deptname','srfkey']; public defaultUpdateItems:Array<any> =[,,,,,,];
/** /**
* 选中行数据 * 选中行数据
...@@ -1694,7 +1697,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1694,7 +1697,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -30,31 +30,37 @@ export default class MainModel { ...@@ -30,31 +30,37 @@ export default class MainModel {
name: 'postid', name: 'postid',
prop: 'postid', prop: 'postid',
dataType: 'PICKUP', dataType: 'PICKUP',
isEditable:true
}, },
{ {
name: 'deptid', name: 'deptid',
prop: 'deptid', prop: 'deptid',
dataType: 'PICKUP', dataType: 'PICKUP',
isEditable:true
}, },
{ {
name: 'postname', name: 'postname',
prop: 'postname', prop: 'postname',
dataType: 'PICKUPTEXT', dataType: 'PICKUPTEXT',
isEditable:true
}, },
{ {
name: 'userid', name: 'userid',
prop: 'userid', prop: 'userid',
dataType: 'PICKUP', dataType: 'PICKUP',
isEditable:true
}, },
{ {
name: 'personname', name: 'personname',
prop: 'personname', prop: 'personname',
dataType: 'PICKUPTEXT', dataType: 'PICKUPTEXT',
isEditable:true
}, },
{ {
name: 'deptname', name: 'deptname',
prop: 'deptname', prop: 'deptname',
dataType: 'PICKUPTEXT', dataType: 'PICKUPTEXT',
isEditable:true
}, },
{ {
name: 'srfmajortext', name: 'srfmajortext',
...@@ -70,6 +76,7 @@ export default class MainModel { ...@@ -70,6 +76,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'memberid', prop: 'memberid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'ibzdeptmember', name: 'ibzdeptmember',
......
...@@ -135,7 +135,7 @@ export default class MainService extends ControlService { ...@@ -135,7 +135,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -194,14 +194,14 @@ export default class MainService extends ControlService { ...@@ -194,14 +194,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -342,4 +342,40 @@ export default class MainService extends ControlService { ...@@ -342,4 +342,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -7,18 +7,21 @@ ...@@ -7,18 +7,21 @@
<i-col v-show="detailsModel.n_usercode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_usercode_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_usercode_like' :itemRules="this.rules.n_usercode_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_usercode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_usercode_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_usercode_like' :itemRules="this.rules.n_usercode_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_usercode_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_usercode_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_usercode_like" @enter="onEnter($event)" :disabled="detailsModel.n_usercode_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_usercode_like" @enter="onEnter($event)" :disabled="detailsModel.n_usercode_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.n_personname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_personname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_personname_like' :itemRules="this.rules.n_personname_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_personname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_personname_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_personname_like' :itemRules="this.rules.n_personname_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_personname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_personname_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_personname_like" @enter="onEnter($event)" :disabled="detailsModel.n_personname_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_personname_like" @enter="onEnter($event)" :disabled="detailsModel.n_personname_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.n_mdeptname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_mdeptname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_mdeptname_like' :itemRules="this.rules.n_mdeptname_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_mdeptname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_mdeptname_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_mdeptname_like' :itemRules="this.rules.n_mdeptname_like" class='' :caption="$t('entities.ibzemployee.default_searchform.details.n_mdeptname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_mdeptname_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_mdeptname_like" @enter="onEnter($event)" :disabled="detailsModel.n_mdeptname_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_mdeptname_like" @enter="onEnter($event)" :disabled="detailsModel.n_mdeptname_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
......
...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService { ...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -174,7 +174,6 @@ export default class MainService extends ControlService { ...@@ -174,7 +174,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -603,7 +603,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -603,7 +603,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['srfkey']; public defaultUpdateItems:Array<any> =[];
/** /**
* 选中行数据 * 选中行数据
...@@ -1631,7 +1631,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1631,7 +1631,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -70,6 +70,7 @@ export default class MainModel { ...@@ -70,6 +70,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'userid', prop: 'userid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'loginname', name: 'loginname',
......
...@@ -99,7 +99,7 @@ export default class MainService extends ControlService { ...@@ -99,7 +99,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -158,14 +158,14 @@ export default class MainService extends ControlService { ...@@ -158,14 +158,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -306,4 +306,40 @@ export default class MainService extends ControlService { ...@@ -306,4 +306,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -9,18 +9,21 @@ ...@@ -9,18 +9,21 @@
<i-col v-show="detailsModel.usercode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.usercode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='usercode' :itemRules="this.rules.usercode" class='' :caption="$t('entities.ibzemployee.newform_form.details.usercode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.usercode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='usercode' :itemRules="this.rules.usercode" class='' :caption="$t('entities.ibzemployee.newform_form.details.usercode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.usercode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.usercode" @enter="onEnter($event)" unit="" :disabled="detailsModel.usercode.disabled" type='text' style=""></input-box> <input-box v-model="data.usercode" @enter="onEnter($event)" unit="" :disabled="detailsModel.usercode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.personname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.personname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='personname' :itemRules="this.rules.personname" class='' :caption="$t('entities.ibzemployee.newform_form.details.personname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.personname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='personname' :itemRules="this.rules.personname" class='' :caption="$t('entities.ibzemployee.newform_form.details.personname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.personname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.personname" @enter="onEnter($event)" unit="" :disabled="detailsModel.personname.disabled" type='text' style=""></input-box> <input-box v-model="data.personname" @enter="onEnter($event)" unit="" :disabled="detailsModel.personname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.loginname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.loginname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='loginname' :itemRules="this.rules.loginname" class='' :caption="$t('entities.ibzemployee.newform_form.details.loginname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.loginname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='loginname' :itemRules="this.rules.loginname" class='' :caption="$t('entities.ibzemployee.newform_form.details.loginname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.loginname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.loginname" @enter="onEnter($event)" unit="" :disabled="detailsModel.loginname.disabled" type='text' style=""></input-box> <input-box v-model="data.loginname" @enter="onEnter($event)" unit="" :disabled="detailsModel.loginname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1371,9 +1374,6 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -1371,9 +1374,6 @@ export default class NewFormBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzemployee){
Object.assign(this.context,{ibzemployee:data.ibzemployee})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -174,7 +174,6 @@ export default class NewFormService extends ControlService { ...@@ -174,7 +174,6 @@ export default class NewFormService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
<i-col v-show="detailsModel.orgcode.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.orgcode.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.default_searchform.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.default_searchform.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orgcode" @enter="onEnter($event)" :disabled="detailsModel.orgcode.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.orgcode" @enter="onEnter($event)" :disabled="detailsModel.orgcode.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.n_orgname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }"> <i-col v-show="detailsModel.n_orgname_like.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='n_orgname_like' :itemRules="this.rules.n_orgname_like" class='' :caption="$t('entities.ibzorganization.default_searchform.details.n_orgname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_orgname_like.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='n_orgname_like' :itemRules="this.rules.n_orgname_like" class='' :caption="$t('entities.ibzorganization.default_searchform.details.n_orgname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_orgname_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_orgname_like" @enter="onEnter($event)" :disabled="detailsModel.n_orgname_like.disabled" type='text' style="width:100px;"></input-box> <input-box v-model="data.n_orgname_like" @enter="onEnter($event)" :disabled="detailsModel.n_orgname_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
......
...@@ -153,7 +153,6 @@ export default class DefaultService extends ControlService { ...@@ -153,7 +153,6 @@ export default class DefaultService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
<i-col v-show="detailsModel.orgcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.orgcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.main_form.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.main_form.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orgcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgcode.disabled" type='text' style=""></input-box> <input-box v-model="data.orgcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.orgname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.orgname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgname' :itemRules="this.rules.orgname" class='' :caption="$t('entities.ibzorganization.main_form.details.orgname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orgname' :itemRules="this.rules.orgname" class='' :caption="$t('entities.ibzorganization.main_form.details.orgname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orgname" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgname.disabled" type='text' style=""></input-box> <input-box v-model="data.orgname" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -24,32 +26,37 @@ ...@@ -24,32 +26,37 @@
<i-col v-show="detailsModel.orglevel.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.orglevel.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orglevel' :itemRules="this.rules.orglevel" class='' :caption="$t('entities.ibzorganization.main_form.details.orglevel')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orglevel.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orglevel' :itemRules="this.rules.orglevel" class='' :caption="$t('entities.ibzorganization.main_form.details.orglevel')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orglevel.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orglevel" @enter="onEnter($event)" unit="" :disabled="detailsModel.orglevel.disabled" type='number' style=""></input-box> <input-box v-model="data.orglevel" @enter="onEnter($event)" unit="" :disabled="detailsModel.orglevel.disabled" type='number' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.shortname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.shortname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='shortname' :itemRules="this.rules.shortname" class='' :caption="$t('entities.ibzorganization.main_form.details.shortname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.shortname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='shortname' :itemRules="this.rules.shortname" class='' :caption="$t('entities.ibzorganization.main_form.details.shortname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.shortname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.shortname" @enter="onEnter($event)" unit="" :disabled="detailsModel.shortname.disabled" type='text' style=""></input-box> <input-box v-model="data.shortname" @enter="onEnter($event)" unit="" :disabled="detailsModel.shortname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.showorder.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.showorder.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='showorder' :itemRules="this.rules.showorder" class='' :caption="$t('entities.ibzorganization.main_form.details.showorder')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.showorder.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='showorder' :itemRules="this.rules.showorder" class='' :caption="$t('entities.ibzorganization.main_form.details.showorder')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.showorder.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.showorder" @enter="onEnter($event)" unit="" :disabled="detailsModel.showorder.disabled" type='number' style=""></input-box> <input-box v-model="data.showorder" @enter="onEnter($event)" unit="" :disabled="detailsModel.showorder.disabled" type='number' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzorganization.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzorganization.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='createdate' :value="data.createdate" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='createdate' :value="data.createdate" valueFormat="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzorganization.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzorganization.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='updatedate' :value="data.updatedate" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='updatedate' :value="data.updatedate" valueFormat="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1332,9 +1339,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1332,9 +1339,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzorganization){
Object.assign(this.context,{ibzorganization:data.ibzorganization})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -153,7 +153,6 @@ export default class MainService extends ControlService { ...@@ -153,7 +153,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -603,7 +603,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -603,7 +603,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['srfkey']; public defaultUpdateItems:Array<any> =[];
/** /**
* 选中行数据 * 选中行数据
...@@ -1615,7 +1615,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1615,7 +1615,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -55,6 +55,7 @@ export default class MainModel { ...@@ -55,6 +55,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'orgid', prop: 'orgid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'srfdataaccaction', name: 'srfdataaccaction',
......
...@@ -99,7 +99,7 @@ export default class MainService extends ControlService { ...@@ -99,7 +99,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -158,14 +158,14 @@ export default class MainService extends ControlService { ...@@ -158,14 +158,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -306,4 +306,40 @@ export default class MainService extends ControlService { ...@@ -306,4 +306,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
<i-col v-show="detailsModel.orgcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.orgcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.newform_form.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.newform_form.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orgcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgcode.disabled" type='text' style=""></input-box> <input-box v-model="data.orgcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.orgname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.orgname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgname' :itemRules="this.rules.orgname" class='' :caption="$t('entities.ibzorganization.newform_form.details.orgname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='orgname' :itemRules="this.rules.orgname" class='' :caption="$t('entities.ibzorganization.newform_form.details.orgname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.orgname" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgname.disabled" type='text' style=""></input-box> <input-box v-model="data.orgname" @enter="onEnter($event)" unit="" :disabled="detailsModel.orgname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1223,9 +1225,6 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -1223,9 +1225,6 @@ export default class NewFormBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzorganization){
Object.assign(this.context,{ibzorganization:data.ibzorganization})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -153,7 +153,6 @@ export default class NewFormService extends ControlService { ...@@ -153,7 +153,6 @@ export default class NewFormService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService { ...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
<i-col v-show="detailsModel.postcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.postcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='postcode' :itemRules="this.rules.postcode" class='' :caption="$t('entities.ibzpost.main_form.details.postcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.postcode.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='postcode' :itemRules="this.rules.postcode" class='' :caption="$t('entities.ibzpost.main_form.details.postcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.postcode.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.postcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.postcode.disabled" type='text' style=""></input-box> <input-box v-model="data.postcode" @enter="onEnter($event)" unit="" :disabled="detailsModel.postcode.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.postname.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.postname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='postname' :itemRules="this.rules.postname" class='' :caption="$t('entities.ibzpost.main_form.details.postname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.postname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='postname' :itemRules="this.rules.postname" class='' :caption="$t('entities.ibzpost.main_form.details.postname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.postname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.postname" @enter="onEnter($event)" unit="" :disabled="detailsModel.postname.disabled" type='text' style=""></input-box> <input-box v-model="data.postname" @enter="onEnter($event)" unit="" :disabled="detailsModel.postname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1180,9 +1182,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1180,9 +1182,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzpost){
Object.assign(this.context,{ibzpost:data.ibzpost})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -150,7 +150,6 @@ export default class MainService extends ControlService { ...@@ -150,7 +150,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -519,7 +519,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -519,7 +519,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['srfkey']; public defaultUpdateItems:Array<any> =[];
/** /**
* 选中行数据 * 选中行数据
...@@ -1475,7 +1475,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1475,7 +1475,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -55,6 +55,7 @@ export default class MainModel { ...@@ -55,6 +55,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'postid', prop: 'postid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'ibzpost', name: 'ibzpost',
......
...@@ -99,7 +99,7 @@ export default class MainService extends ControlService { ...@@ -99,7 +99,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -158,14 +158,14 @@ export default class MainService extends ControlService { ...@@ -158,14 +158,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -306,4 +306,40 @@ export default class MainService extends ControlService { ...@@ -306,4 +306,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -1259,9 +1259,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1259,9 +1259,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzteammember){
Object.assign(this.context,{ibzteammember:data.ibzteammember})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -174,7 +174,6 @@ export default class MainService extends ControlService { ...@@ -174,7 +174,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='personname' editorType="PICKER" :value="row.personname"></app-span> <app-span name='personname' editorType="PICKER" :value="row.personname" dataType="PICKUPTEXT" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='postname' editorType="PICKER" :value="row.postname"></app-span> <app-span name='postname' editorType="PICKER" :value="row.postname" dataType="PICKUPTEXT" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -120,10 +120,11 @@ ...@@ -120,10 +120,11 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box> </input-box>
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='postid' editorType="HIDDEN" :value="row.postid"></app-span> <app-span name='postid' editorType="HIDDEN" :value="row.postid" dataType="PICKUP" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -147,10 +148,11 @@ ...@@ -147,10 +148,11 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box> </input-box>
</app-form-item> </app-form-item>
</template> </template>
<template v-if="!actualIsOpenEdit"> <template v-if="!actualIsOpenEdit">
<app-span name='userid' editorType="HIDDEN" :value="row.userid"></app-span> <app-span name='userid' editorType="HIDDEN" :value="row.userid" dataType="PICKUP" precision="0" ></app-span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -617,7 +619,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -617,7 +619,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['postid','postname','userid','personname','srfkey']; public defaultUpdateItems:Array<any> =[,,,,];
/** /**
* 选中行数据 * 选中行数据
...@@ -1601,7 +1603,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1601,7 +1603,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -30,6 +30,7 @@ export default class MainModel { ...@@ -30,6 +30,7 @@ export default class MainModel {
name: 'postid', name: 'postid',
prop: 'postid', prop: 'postid',
dataType: 'PICKUP', dataType: 'PICKUP',
isEditable:true
}, },
{ {
name: 'teamid', name: 'teamid',
...@@ -40,16 +41,19 @@ export default class MainModel { ...@@ -40,16 +41,19 @@ export default class MainModel {
name: 'postname', name: 'postname',
prop: 'postname', prop: 'postname',
dataType: 'PICKUPTEXT', dataType: 'PICKUPTEXT',
isEditable:true
}, },
{ {
name: 'userid', name: 'userid',
prop: 'userid', prop: 'userid',
dataType: 'PICKUP', dataType: 'PICKUP',
isEditable:true
}, },
{ {
name: 'personname', name: 'personname',
prop: 'personname', prop: 'personname',
dataType: 'PICKUPTEXT', dataType: 'PICKUPTEXT',
isEditable:true
}, },
{ {
name: 'srfmajortext', name: 'srfmajortext',
...@@ -65,6 +69,7 @@ export default class MainModel { ...@@ -65,6 +69,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'teammemberid', prop: 'teammemberid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'ibzteammember', name: 'ibzteammember',
......
...@@ -123,7 +123,7 @@ export default class MainService extends ControlService { ...@@ -123,7 +123,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -182,14 +182,14 @@ export default class MainService extends ControlService { ...@@ -182,14 +182,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -330,4 +330,40 @@ export default class MainService extends ControlService { ...@@ -330,4 +330,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService { ...@@ -150,7 +150,6 @@ export default class DefaultService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
<i-col v-show="detailsModel.teamname.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }"> <i-col v-show="detailsModel.teamname.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='teamname' :itemRules="this.rules.teamname" class='' :caption="$t('entities.ibzteam.main_form.details.teamname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.teamname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='teamname' :itemRules="this.rules.teamname" class='' :caption="$t('entities.ibzteam.main_form.details.teamname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.teamname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.teamname" @enter="onEnter($event)" unit="" :disabled="detailsModel.teamname.disabled" type='text' style=""></input-box> <input-box v-model="data.teamname" @enter="onEnter($event)" unit="" :disabled="detailsModel.teamname.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.memo.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }"> <i-col v-show="detailsModel.memo.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='memo' :itemRules="this.rules.memo" class='' :caption="$t('entities.ibzteam.main_form.details.memo')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.memo.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='memo' :itemRules="this.rules.memo" class='' :caption="$t('entities.ibzteam.main_form.details.memo')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.memo.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.memo" @enter="onEnter($event)" unit="" :disabled="detailsModel.memo.disabled" type='text' style=""></input-box> <input-box v-model="data.memo" @enter="onEnter($event)" unit="" :disabled="detailsModel.memo.disabled" type='text' style=""></input-box>
</app-form-item> </app-form-item>
</i-col> </i-col>
...@@ -1191,9 +1193,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1191,9 +1193,6 @@ export default class MainBase extends Vue implements ControlInterface {
} }
const data = response.data; const data = response.data;
if(data.ibzteam){
Object.assign(this.context,{ibzteam:data.ibzteam})
}
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft'); this.onFormLoad(data,'loadDraft');
this.$emit('load', data); this.$emit('load', data);
......
...@@ -150,7 +150,6 @@ export default class MainService extends ControlService { ...@@ -150,7 +150,6 @@ export default class MainService extends ControlService {
}); });
} }
/** /**
* 添加数据 * 添加数据
* *
......
...@@ -507,7 +507,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -507,7 +507,7 @@ export default class MainBase extends Vue implements ControlInterface {
* *
* @memberof MainBase * @memberof MainBase
*/ */
public defaultUpdateItems:Array<any> =['srfkey']; public defaultUpdateItems:Array<any> =[];
/** /**
* 选中行数据 * 选中行数据
...@@ -1455,7 +1455,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1455,7 +1455,7 @@ export default class MainBase extends Vue implements ControlInterface {
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)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+(this.$t('app.commonWords.saveFailed') as string)+'!' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
...@@ -50,6 +50,7 @@ export default class MainModel { ...@@ -50,6 +50,7 @@ export default class MainModel {
name: 'srfkey', name: 'srfkey',
prop: 'teamid', prop: 'teamid',
dataType: 'TEXT', dataType: 'TEXT',
isEditable:true
}, },
{ {
name: 'ibzteam', name: 'ibzteam',
......
...@@ -99,7 +99,7 @@ export default class MainService extends ControlService { ...@@ -99,7 +99,7 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
...@@ -158,14 +158,14 @@ export default class MainService extends ControlService { ...@@ -158,14 +158,14 @@ export default class MainService extends ControlService {
*/ */
@Errorlog @Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
let result: Promise<any>; let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading); result = _appEntityService[action](Context,Data,isloading);
}else{ }else{
result =_appEntityService.Update(Data,Context,isloading); result =_appEntityService.Update(Context,Data,isloading);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
...@@ -306,4 +306,40 @@ export default class MainService extends ControlService { ...@@ -306,4 +306,40 @@ export default class MainService extends ControlService {
}) })
} }
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
} }
\ No newline at end of file
...@@ -9,47 +9,47 @@ zuul: ...@@ -9,47 +9,47 @@ zuul:
routes: routes:
ibzdeptmember: ibzdeptmember:
path: /ibzdeptmembers/** path: /ibzdeptmembers/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzteammember: ibzteammember:
path: /ibzteammembers/** path: /ibzteammembers/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzdept: ibzdept:
path: /ibzdepartments/** path: /ibzdepartments/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzemp: ibzemp:
path: /ibzemployees/** path: /ibzemployees/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzorg: ibzorg:
path: /ibzorganizations/** path: /ibzorganizations/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzpost: ibzpost:
path: /ibzposts/** path: /ibzposts/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzteam: ibzteam:
path: /ibzteams/** path: /ibzteams/**
serviceId: ibzou-api serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
loginv7: loginv7:
path: /v7/login path: /v7/login
serviceId: ibzuaa-api serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false stripPrefix: false
changepwd: changepwd:
path: /v7/changepwd path: /v7/changepwd
serviceId: ibzuaa-api serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false stripPrefix: false
uaa: uaa:
path: /uaa/** path: /uaa/**
serviceId: ibzuaa-api serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false stripPrefix: false
config: config:
path: /config/** path: /config/**
serviceId: ibzuaa-api serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false stripPrefix: false
sensitive-headers: sensitive-headers:
- Cookie,Set-Cookie,Authorization - Cookie,Set-Cookie,Authorization
spring: spring:
profiles: profiles:
include: sys , web-prod include: sys ,nacos, web-prod
application: application:
name: ibzou-web name: ibzou-web
spring: spring:
profiles: profiles:
include: sys , web-dev, api-dev, dev include: sys ,nacos, web-dev, api-dev, dev
application: application:
name: ibzou name: ibzou
main: main:
......
...@@ -77,6 +77,9 @@ ...@@ -77,6 +77,9 @@
<!--baomidou-jobs定时服务 --> <!--baomidou-jobs定时服务 -->
<baomidou-jobs.version>1.0.3</baomidou-jobs.version> <baomidou-jobs.version>1.0.3</baomidou-jobs.version>
<!-- eureka微服务注册中心 -->
<eureka-client.version>2.2.1.RELEASE</eureka-client.version>
<oracle.version>11.2.0.3</oracle.version> <oracle.version>11.2.0.3</oracle.version>
<postgresql.version>42.2.6</postgresql.version> <postgresql.version>42.2.6</postgresql.version>
...@@ -314,6 +317,13 @@ ...@@ -314,6 +317,13 @@
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
</dependency> </dependency>
<!-- eureka服务注册中心 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>${eureka-client.version}</version>
</dependency>
<!-- Oracle驱动包 --> <!-- Oracle驱动包 -->
<dependency> <dependency>
<groupId>com.oracle</groupId> <groupId>com.oracle</groupId>
...@@ -332,6 +342,7 @@ ...@@ -332,6 +342,7 @@
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
spring: spring:
profiles: profiles:
include: sys , api-prod include: sys ,nacos, api-prod
application: application:
name: ibzou-api name: ibzou-api
\ No newline at end of file
...@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@FeignClient(value = "ibzou-api",fallback = IBZOUFallback.class) @FeignClient(value = "${ibiz.ref.service.ou:ibzou-api}",fallback = IBZOUFallback.class)
public interface IBZOUFeignClient public interface IBZOUFeignClient
{ {
/** /**
......
...@@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@FeignClient(value = "ibzuaa-api",fallback = IBZUAAFallback.class) @FeignClient(value = "${ibiz.ref.service.uaa:ibzuaa-api}",fallback = IBZUAAFallback.class)
public interface IBZUAAFeignClient public interface IBZUAAFeignClient
{ {
/** /**
......
...@@ -4,7 +4,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -4,7 +4,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
@FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class) @FeignClient(value = "${ibiz.ref.service.wf:ibzwf-api}",fallback = IBZWFFallback.class)
public interface IBZWFFeignClient public interface IBZWFFeignClient
{ {
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks") @RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks")
......
...@@ -4,9 +4,9 @@ import lombok.Data; ...@@ -4,9 +4,9 @@ import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Data
@Component @Component
@ConfigurationProperties(prefix = "spring.datasource") @ConfigurationProperties(prefix = "spring.datasource")
@Data
public class LiquibaseProp{ public class LiquibaseProp{
private String url; private String url;
......
此差异已折叠。
#nacos配置中心
spring:
cloud:
nacos:
discovery:
server-addr: 172.16.102.211:8848
enabled: true
eureka:
client:
enabled: false
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册