Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
ca370650
提交
ca370650
编写于
6月 03, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充动态数据看板接口存储
上级
a75364ae
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
36 行增加
和
73 行删除
+36
-73
CONTROL-BASE.vue.ftl
@CONTROL/数据看板/CONTROL-BASE.vue.ftl
+1
-1
%APP_UTIL%-util-service-base.ts.ftl
...tilservice/%APP_UTIL%/%APP_UTIL%-util-service-base.ts.ftl
+35
-72
未找到文件。
@CONTROL/数据看板/CONTROL-BASE.vue.ftl
浏览文件 @
ca370650
...
@@ -237,7 +237,7 @@ import UtilService from '@/utilservice/util-service';
...
@@ -237,7 +237,7 @@ import UtilService from '@/utilservice/util-service';
public loadModel(){
public loadModel(){
if(this.isEnableCustomized){
if(this.isEnableCustomized){
this.utilService.getService(this.utilServiceName).then((service:any) =>{
this.utilService.getService(this.utilServiceName).then((service:any) =>{
service.loadModelData(JSON.parse(JSON.stringify(this.context)),{modelid:this.modelId}).then((res:any) =>{
service.loadModelData(JSON.parse(JSON.stringify(this.context)),{modelid:this.modelId
,utilServiceName:this.utilServiceName
}).then((res:any) =>{
if(res && res.status == 200){
if(res && res.status == 200){
const data:any = res.data;
const data:any = res.data;
if(data && data.length >0){
if(data && data.length >0){
...
...
APP/src/utilservice/%APP_UTIL%/%APP_UTIL%-util-service-base.ts.ftl
浏览文件 @
ca370650
...
@@ -89,27 +89,27 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
...
@@ -89,27 +89,27 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
*/
public loadModelData(context: any = {},data: any = {}, isloading?: boolean): Promise<any>{
public loadModelData(context: any = {},data: any = {}, isloading?: boolean): Promise<any>{
<#-- const {context:contextResult,data:dataResult} = this.handlePreParam(context,data); -->
return new Promise((resolve: any, reject: any) => {
return new Promise((resolve: any, reject: any) => {
let dataStr = window.localStorage.getItem(data.modelid);
//从接口加载
if(dataStr) {
if(data && data.utilServiceName){
const data: any = JSON.parse(dataStr);
const requestParam:any ={configType:data.utilServiceName,targetType:data.modelid};
resolve({status:200,data:data.model});
this.stoageDataService.getDynaModel(context,requestParam).then((res:any) =>{
} else {
if(res && res.status === 200){
resolve({status:200,data:[]});
const data: any = res.data;
}
resolve({status:200,data:data.model?data.model:[]});
<#-- let result: Promise<any>;
}
const _appEntityService: any = this.stoageDataService;
}).catch((error:any) =>{
if (_appEntityService[this.loadAction] && _appEntityService[this.loadAction] instanceof Function) {
reject(error);
result = _appEntityService[this.loadAction](contextResult,dataResult, isloading);
})
} else {
}else{
result = _appEntityService.Get(contextResult,dataResult, isloading);
let dataStr = window.localStorage.getItem(data.modelid);
if(dataStr) {
const data: any = JSON.parse(dataStr);
resolve({status:200,data:data.model});
} else {
resolve({status:200,data:[]});
}
}
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
}); -->
});
});
}
}
...
@@ -123,61 +123,24 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
...
@@ -123,61 +123,24 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
*/
public saveModelData(context: any = {},action:string,data: any = {}, isloading?: boolean):Promise<any>{
public saveModelData(context: any = {},action:string,data: any = {}, isloading?: boolean):Promise<any>{
<#-- const {context:contextResult,data:dataResult} = this.handlePreParam(context,data); -->
return new Promise((resolve: any, reject: any) => {
window.localStorage.setItem(data.modelid, JSON.stringify(data));
resolve({status:200,data:data.model});
<#-- let result: Promise<any> = Object.is(action,"Update") ? this.updateModelData(context,data,isloading):this.createdModelData(context,data,isloading);
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
}); -->
});
}
/**
* 新建模型数据
*
* @param context 应用上下文
* @param data 传入模型数据
* @param isloading 是否加载
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
public createdModelData(context: any = {},data: any = {}, isloading?: boolean):Promise<any>{
const {context:contextResult,data:dataResult} = this.handlePreParam(context,data);
return new Promise((resolve: any, reject: any) => {
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
// 存储到数据库
const _appEntityService: any = this.stoageDataService;
if(data && data.utilServiceName){
result = _appEntityService[this.createAction](contextResult,dataResult, isloading);
const requestParam:any ={configType:data.utilServiceName,targetType:data.modelid,model:data.model};
result.then((response) => {
this.stoageDataService.setDynaModel(context,requestParam).then((res:any) =>{
resolve(response);
if(res && res.status === 200){
}).catch(response => {
const data: any = res.data;
reject(response);
resolve({status:200,data:data.model});
});
}
});
}).catch((error:any) =>{
reject(error);
})
}else{
window.localStorage.setItem(data.modelid, JSON.stringify(data));
resolve({status:200,data:data.model});
}
});
}
}
/**
* 更新模型数据
*
* @param context 应用上下文
* @param data 传入模型数据
* @param isloading 是否加载
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
public updateModelData(context: any = {},data: any = {}, isloading?: boolean):Promise<any>{
const {context:contextResult,data:dataResult} = this.handlePreParam(context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.stoageDataService;
result = _appEntityService[this.updateAction](contextResult,dataResult, isloading);
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录