提交 640f703e 编写于 作者: ibizdev's avatar ibizdev

tony001 发布系统代码 [后台服务,演示应用]

上级 94a22b7c
...@@ -364,6 +364,14 @@ ...@@ -364,6 +364,14 @@
} }
] ]
}, },
{
"srfkey": "ORDERENTITYDATA",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"IBIZOrder",
"appdedataset":"FetchDefault",
"items": []
},
{ {
"srfkey": "ORDERTYPE", "srfkey": "ORDERTYPE",
"emptytext": "未定义", "emptytext": "未定义",
......
...@@ -40,6 +40,7 @@ export class CodeListRegister { ...@@ -40,6 +40,7 @@ export class CodeListRegister {
*/ */
protected init(): void { protected init(): void {
this.allCodeList.set('SysOperator', () => import('@/codelist/sys-operator')); this.allCodeList.set('SysOperator', () => import('@/codelist/sys-operator'));
this.allCodeList.set('ORDERENTITYDATA', () => import('@/codelist/orderentitydata'));
this.allCodeList.set('ORDERTYPE', () => import('@/codelist/ordertype')); this.allCodeList.set('ORDERTYPE', () => import('@/codelist/ordertype'));
} }
......
import IBIZOrderService from '@service/ibizorder/ibizorder-service';
/**
* 代码表--订单实体数据
*
* @export
* @class ORDERENTITYDATA
*/
export default class ORDERENTITYDATA {
/**
* 是否启用缓存
*
* @type boolean
* @memberof ORDERENTITYDATA
*/
public isEnableCache:boolean = true;
/**
* 过期时间
*
* @type any
* @memberof ORDERENTITYDATA
*/
public static expirationTime:any;
/**
* 预定义类型
*
* @type string
* @memberof ORDERENTITYDATA
*/
public predefinedType:string ='';
/**
* 缓存超长时长
*
* @type any
* @memberof ORDERENTITYDATA
*/
public cacheTimeout:any = -1;
/**
* 代码表模型对象
*
* @type any
* @memberof ORDERENTITYDATA
*/
public codelistModel:any = {
codelistid:"ORDERENTITYDATA"
};
/**
* 获取过期时间
*
* @type any
* @memberof ORDERENTITYDATA
*/
public getExpirationTime(){
return ORDERENTITYDATA.expirationTime;
}
/**
* 设置过期时间
*
* @type any
* @memberof ORDERENTITYDATA
*/
public setExpirationTime(value:any){
ORDERENTITYDATA.expirationTime = value;
}
/**
* 自定义参数集合
*
* @type any
* @memberof ORDERENTITYDATA
*/
public userParamNames:any ={
}
/**
* 查询参数集合
*
* @type any
* @memberof ORDERENTITYDATA
*/
public queryParamNames:any ={
}
/**
* 订单应用实体服务对象
*
* @type {IBIZOrderService}
* @memberof ORDERENTITYDATA
*/
public ibizorderService: IBIZOrderService = new IBIZOrderService();
/**
* 处理数据
*
* @public
* @param {any[]} items
* @returns {any[]}
* @memberof ORDERENTITYDATA
*/
public doItems(items: any[]): any[] {
let _items: any[] = [];
if(items && items instanceof Array && items.length >0){
items.forEach((item: any) => {
let itemdata:any = {};
Object.assign(itemdata,{id:item.ibizorderid});
Object.assign(itemdata,{value:item.ibizorderid});
Object.assign(itemdata,{text:item.ibizordername});
Object.assign(itemdata,{label:item.ibizordername});
_items.push(itemdata);
});
}
return _items;
}
/**
* 获取数据项
*
* @param {*} context
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ORDERENTITYDATA
*/
public getItems(context: any={}, data: any={}, isloading?: boolean): Promise<any> {
return new Promise((resolve, reject) => {
data = this.handleQueryParam(data);
const promise: Promise<any> = this.ibizorderService.FetchDefault(context, data, isloading);
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
resolve(this.doItems(data));
} else {
resolve([]);
}
}).catch((response: any) => {
console.error(response);
reject(response);
});
});
}
/**
* 处理查询参数
* @param data 传入data
* @memberof ORDERENTITYDATA
*/
public handleQueryParam(data:any){
let tempData:any = data?JSON.parse(JSON.stringify(data)):{};
if(this.userParamNames && Object.keys(this.userParamNames).length >0){
Object.keys(this.userParamNames).forEach((name: string) => {
if (!name) {
return;
}
let value: string | null = this.userParamNames[name];
if (value && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
if (this.codelistModel && this.codelistModel.hasOwnProperty(key)) {
value = (this.codelistModel[key] !== null && this.codelistModel[key] !== undefined) ? this.codelistModel[key] : null;
} else {
value = null;
}
}
Object.assign(tempData, { [name]: value });
});
}
Object.assign(tempData,{page: 0, size: 1000});
if(this.queryParamNames && Object.keys(this.queryParamNames).length > 0){
Object.assign(tempData,this.queryParamNames);
}
return tempData;
}
}
...@@ -51,6 +51,9 @@ export default { ...@@ -51,6 +51,9 @@ export default {
"40": "未通过", "40": "未通过",
"empty": "" "empty": ""
}, },
ORDERENTITYDATA: {
"empty": "",
},
ORDERTYPE: { ORDERTYPE: {
"empty": "", "empty": "",
}, },
......
...@@ -51,6 +51,9 @@ export default { ...@@ -51,6 +51,9 @@ export default {
"40": "未通过", "40": "未通过",
"empty": "", "empty": "",
}, },
ORDERENTITYDATA: {
"empty": "",
},
ORDERTYPE: { ORDERTYPE: {
"empty": "", "empty": "",
}, },
......
...@@ -1980,9 +1980,11 @@ export default { ...@@ -1980,9 +1980,11 @@ export default {
tip: "数据导入", tip: "数据导入",
}, },
}, },
treeexpbar_tree_treeview: { treeexp_treeview: {
nodata:"", nodata:"",
nodes: { nodes: {
root: "默认根节点",
top1: "一级节点",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -1979,9 +1979,11 @@ export default { ...@@ -1979,9 +1979,11 @@ export default {
tip: "数据导入", tip: "数据导入",
}, },
}, },
treeexpbar_tree_treeview: { treeexp_treeview: {
nodata:"", nodata:"",
nodes: { nodes: {
root: "默认根节点",
top1: "一级节点",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -372,6 +372,14 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => { ...@@ -372,6 +372,14 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
}, },
] ]
}, },
{
"srfkey": "ORDERENTITYDATA",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"IBIZOrder",
"appdedataset":"FetchDefault",
"items": []
},
{ {
"srfkey": "ORDERTYPE", "srfkey": "ORDERTYPE",
"emptytext": "未定义", "emptytext": "未定义",
......
...@@ -250,7 +250,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -250,7 +250,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
{ {
id:'dritem2', id:'dritem2',
localContext:{CONTEXTPARAM1:"%orderstate%"}, localContext:{CONTEXTPARAM1:"%orderstate%"},
localViewParam:{param2:"1111111"} localViewParam:{param2:"%orderstate%"}
} }
]; ];
......
...@@ -268,7 +268,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -268,7 +268,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
{ {
id:'dritem2', id:'dritem2',
localContext:{CONTEXTPARAM1:"%orderstate%"}, localContext:{CONTEXTPARAM1:"%orderstate%"},
localViewParam:{param2:"1111111"} localViewParam:{param2:"%orderstate%"}
} }
]; ];
......
...@@ -511,7 +511,7 @@ tag='SysOperator' codelistType='DYNAMIC' :data="data" :context="context" :viewpa ...@@ -511,7 +511,7 @@ tag='SysOperator' codelistType='DYNAMIC' :data="data" :context="context" :viewpa
:ownerid="data.srfkey" :ownerid="data.srfkey"
:show-ocrview="false" :show-ocrview="false"
:show-preview="true" :show-preview="true"
:persistence="false" :persistence="true"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</disk-image-upload> </disk-image-upload>
</app-form-item> </app-form-item>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册