提交 02df494b 编写于 作者: tony001's avatar tony001

Merge remote-tracking branch 'local/master' into dev --- fix3

上级 353a236c
......@@ -133,6 +133,20 @@ import CodeListService from "@service/app/codelist-service";
</#list>
</#if>
/**
* 界面行为模型
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ActionModel:any ={
<#if ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as item>
${item.getUIActionTag()}: { name: '${item.getUIActionTag()}',disabled: false, visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode(view)??>${item.getNoPrivDisplayMode(view)}</#if>,dataaccaction: '<#if item.getDataAccessAction()??>${item.getDataAccessAction()}</#if>', target: '${item.getActionTarget()}'}<#if item_has_next>,</#if>
</#list>
</#if>
};
/**
* 显示处理提示
*
......@@ -459,11 +473,11 @@ import CodeListService from "@service/app/codelist-service";
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected load(opt: any = {}, pageReset: boolean = false): void {
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(pageReset){
......@@ -483,20 +497,27 @@ import CodeListService from "@service/app/codelist-service";
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections
// 清空selections,gridItemsModel
this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.items.forEach((item:any)=>{
Object.assign(item,this.getActionState(item));
});
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
......@@ -526,10 +547,30 @@ import CodeListService from "@service/app/codelist-service";
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
/**
* 表格模型集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gridItemsModel: any[] = [];
/**
* 获取界面行为权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getActionState(data:any){
let targetData:any = this.transformData(data);
let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel));
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
return tempActionModel;
}
/**
* 删除
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册