提交 4dad0628 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 3b0048e2
[
]
\ No newline at end of file
{
"srfkey": "SysOperator",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"",
"appdedataset":"",
"items": []
}
]
\ No newline at end of file
/**
* 代码表--云系统操作者
*
* @export
* @class SysOperator
*/
export default class SysOperator {
/**
* 获取数据项
*
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysOperator
*/
public getItems(data: any={}, isloading?: boolean): Promise<any> {
return Promise.reject([]);
}
}
export default {
views: {
editview9: {
caption: "客户",
},
meditview9: {
caption: "客户",
},
},
form_form: {
details: {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户标识",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
customerid: "客户标识",
},
uiactions: {
},
},
editview9toolbar_toolbar: {
},
};
\ No newline at end of file
export default {
views: {
editview9: {
caption: '客户',
},
meditview9: {
caption: '客户',
},
},
form_form: {
details: {
srfupdatedate: '更新时间',
srforikey: '',
srfkey: '客户标识',
srfmajortext: '客户名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
customerid: '客户标识',
},
uiactions: {
},
},
editview9toolbar_toolbar: {
},
};
\ No newline at end of file
......@@ -8,5 +8,13 @@ const Random = Mock.Random;
mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
let status = MockAdapter.mockStatus(config);
return [status, [
]];
{
"srfkey": "SysOperator",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"",
"appdedataset":"",
"items": []
}
]];
});
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"28","orgusername":null,"cidname":"Test","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"28","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"29","orgusername":null,"cidname":"Test(1)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"29","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"30","orgusername":null,"cidname":"Test(2)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"30","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"31","orgusername":null,"cidname":"Test(3)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"31","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"32","orgusername":null,"cidname":"Test(4)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"32","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:53:45","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"33","orgusername":null,"cidname":"Test(5)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"33","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"}
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"28","orgusername":null,"cidname":"Test","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"28","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"29","orgusername":null,"cidname":"Test(1)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"29","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"30","orgusername":null,"cidname":"Test(2)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"30","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"31","orgusername":null,"cidname":"Test(3)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"31","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"32","orgusername":null,"cidname":"Test(4)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"32","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"zbzl":null,"jqxde":null,"clzl":null,"jqxdqfs":null,"createdate":"2020-03-10 14:59:27","qdlx":null,"jqxdqfl":null,"updateman":"示例操作者","fdjh":null,"cdrq":null,"abl":null,"srfkey":"33","orgusername":null,"cidname":"Test(5)","ywly":null,"orgid":null,"orgname":null,"hpzl":null,"jqxdb":null,"syx":null,"cidid":"33","cldl":null,"hdzk":null,"cllxms":null,"orguserid":null,"syxde":null,"syxdb":null,"dycpxh":null,"cpxhid":null,"clsjjz":null,"hdzzl":null,"jqx":null,"syxdqfl":null,"xcgzj":null,"gl":null,"syxz":null,"cphm":null,"cjh":null,"pl":null,"cpxhname":null,"syxdqfs":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"16","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"16","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"17","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"17","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(1)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"18","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"18","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(2)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"19","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"19","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(3)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"20","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"20","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(4)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"21","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"21","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(5)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:53:45","pp":null,"createman":"示例操作者"}
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"16","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"16","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"17","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"17","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(1)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"18","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"18","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(2)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"19","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"19","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(3)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"20","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"20","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(4)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"},
{"ssnf":null,"zbzl":null,"bz":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","abl":null,"sccs":null,"srfkey":"21","bm":null,"hdzk":null,"cllxms":null,"cxdm":null,"dycpxh":null,"cpxhid":"21","clsjjz":null,"cx":null,"hdzzl":null,"xcgzj":null,"gl":null,"cpxhname":"Test(5)","pl":null,"hpds":null,"updatedate":"2020-03-10 14:59:27","pp":null,"createman":"示例操作者"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"4","customerid":"4","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets"},
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"5","customerid":"5","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets(1)"},
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"6","customerid":"6","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets(2)"},
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"7","customerid":"7","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets(3)"},
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"8","customerid":"8","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets(4)"},
{"csny":null,"createdate":"2020-03-10 14:53:45","khlx":null,"updateman":"示例操作者","srfkey":"9","customerid":"9","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者","nl":null,"customername":"Tets(5)"}
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"4","customerid":"4","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets"},
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"5","customerid":"5","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets(1)"},
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"6","customerid":"6","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets(2)"},
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"7","customerid":"7","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets(3)"},
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"8","customerid":"8","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets(4)"},
{"csny":null,"createdate":"2020-03-10 14:59:27","khlx":null,"updateman":"示例操作者","srfkey":"9","customerid":"9","xb":null,"zjhm":null,"zjlx":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者","nl":null,"customername":"Tets(5)"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test","tkmc":null,"srfkey":"10","tkdm":null,"jqxxxid":"10","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(1)","tkmc":null,"srfkey":"11","tkdm":null,"jqxxxid":"11","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(2)","tkmc":null,"srfkey":"12","tkdm":null,"jqxxxid":"12","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(3)","tkmc":null,"srfkey":"13","tkdm":null,"jqxxxid":"13","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(4)","tkmc":null,"srfkey":"14","tkdm":null,"jqxxxid":"14","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(5)","tkmc":null,"srfkey":"15","tkdm":null,"jqxxxid":"15","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:53:45","createman":"示例操作者"}
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test","tkmc":null,"srfkey":"10","tkdm":null,"jqxxxid":"10","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(1)","tkmc":null,"srfkey":"11","tkdm":null,"jqxxxid":"11","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(2)","tkmc":null,"srfkey":"12","tkdm":null,"jqxxxid":"12","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(3)","tkmc":null,"srfkey":"13","tkdm":null,"jqxxxid":"13","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(4)","tkmc":null,"srfkey":"14","tkdm":null,"jqxxxid":"14","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"jqxxxname":"Test(5)","tkmc":null,"srfkey":"15","tkdm":null,"jqxxxid":"15","jzbf":null,"flxs":null,"sjbf":null,"cidid":null,"updatedate":"2020-03-10 14:59:27","createman":"示例操作者"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"orgid":"40","orgname":"Test","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"40"},
{"orgid":"41","orgname":"Test(1)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"41"},
{"orgid":"42","orgname":"Test(2)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"42"},
{"orgid":"43","orgname":"Test(3)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"43"},
{"orgid":"44","orgname":"Test(4)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"44"},
{"orgid":"45","orgname":"Test(5)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","srfkey":"45"}
{"orgid":"40","orgname":"Test","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"40"},
{"orgid":"41","orgname":"Test(1)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"41"},
{"orgid":"42","orgname":"Test(2)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"42"},
{"orgid":"43","orgname":"Test(3)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"43"},
{"orgid":"44","orgname":"Test(4)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"44"},
{"orgid":"45","orgname":"Test(5)","porgid":null,"porgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","srfkey":"45"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"orguserid":"22","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test","srfkey":"22"},
{"orguserid":"23","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test(1)","srfkey":"23"},
{"orguserid":"24","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test(2)","srfkey":"24"},
{"orguserid":"25","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test(3)","srfkey":"25"},
{"orguserid":"26","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test(4)","srfkey":"26"},
{"orguserid":"27","orgid":null,"orgname":null,"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","orgusername":"Test(5)","srfkey":"27"}
{"orguserid":"22","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test","srfkey":"22"},
{"orguserid":"23","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test(1)","srfkey":"23"},
{"orguserid":"24","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test(2)","srfkey":"24"},
{"orguserid":"25","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test(3)","srfkey":"25"},
{"orguserid":"26","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test(4)","srfkey":"26"},
{"orguserid":"27","orgid":null,"orgname":null,"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","orgusername":"Test(5)","srfkey":"27"}
];
......@@ -4,11 +4,11 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"34","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test","sjbf":null,"cidid":null,"syxxxid":"34","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"35","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(1)","sjbf":null,"cidid":null,"syxxxid":"35","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"36","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(2)","sjbf":null,"cidid":null,"syxxxid":"36","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"37","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(3)","sjbf":null,"cidid":null,"syxxxid":"37","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"38","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(4)","sjbf":null,"cidid":null,"syxxxid":"38","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:53:45","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"39","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(5)","sjbf":null,"cidid":null,"syxxxid":"39","updatedate":"2020-03-10 14:53:45","createman":"示例操作者","ptfhxs":null}
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"34","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test","sjbf":null,"cidid":null,"syxxxid":"34","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"35","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(1)","sjbf":null,"cidid":null,"syxxxid":"35","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"36","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(2)","sjbf":null,"cidid":null,"syxxxid":"36","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"37","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(3)","sjbf":null,"cidid":null,"syxxxid":"37","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"38","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(4)","sjbf":null,"cidid":null,"syxxxid":"38","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null},
{"createdate":"2020-03-10 14:59:27","updateman":"示例操作者","zrxe":null,"tkmc":null,"zzxs":null,"srfkey":"39","tkdm":null,"bjmp":null,"jzbf":null,"fl":null,"syxxxname":"Test(5)","sjbf":null,"cidid":null,"syxxxid":"39","updatedate":"2020-03-10 14:59:27","createman":"示例操作者","ptfhxs":null}
];
......@@ -4,8 +4,8 @@ const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
{"tymc":null,"tbydkid":"1","tbydkname":"Test","createdate":"2020-03-10 14:53:45","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:53:45","tynr":null,"createman":"示例操作者","srfkey":"1"},
{"tymc":null,"tbydkid":"2","tbydkname":"Test(1)","createdate":"2020-03-10 14:53:45","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:53:45","tynr":null,"createman":"示例操作者","srfkey":"2"},
{"tymc":null,"tbydkid":"3","tbydkname":"Test(2)","createdate":"2020-03-10 14:53:45","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:53:45","tynr":null,"createman":"示例操作者","srfkey":"3"}
{"tymc":null,"tbydkid":"1","tbydkname":"Test","createdate":"2020-03-10 14:59:27","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:59:27","tynr":null,"createman":"示例操作者","srfkey":"1"},
{"tymc":null,"tbydkid":"2","tbydkname":"Test(1)","createdate":"2020-03-10 14:59:27","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:59:27","tynr":null,"createman":"示例操作者","srfkey":"2"},
{"tymc":null,"tbydkid":"3","tbydkname":"Test(2)","createdate":"2020-03-10 14:59:27","updateman":"示例操作者","lb":null,"updatedate":"2020-03-10 14:59:27","tynr":null,"createman":"示例操作者","srfkey":"3"}
];
<template>
<div class="view-container customeredit-view9">
<card class='view-card' :disHover="true" :bordered="false">
<p slot='title'>
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</p>
<div slot="extra">
<div class='toolbar-container'>
</div>
</div>
<div class="content-container">
<div class='view-top-messages'>
</div>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction=""
removeAction=""
loaddraftAction=""
loadAction=""
createAction=""
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
<div class='view-bottom-messages'>
</div>
</div>
</card>
</div>
</template>
<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool } from '@/utils';
import { Subject } from 'rxjs';
import CUSTOMERService from '@/service/customer/customer-service';
import EditView9Engine from '@engine/view/edit-view9-engine';
@Component({
components: {
},
})
export default class CUSTOMEREditView9Base extends Vue {
/**
* 实体服务对象
*
* @type {CUSTOMERService}
* @memberof CUSTOMEREditView9Base
*/
protected appEntityService: CUSTOMERService = new CUSTOMERService;
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof CUSTOMEREditView9Base
*/
@Emit()
protected viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof CUSTOMEREditView9Base
*/
@Prop() protected viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof CUSTOMEREditView9Base
*/
@Prop() protected viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof CUSTOMEREditView9Base
*/
@Prop({ default: true }) protected viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof CUSTOMEREditView9Base
*/
protected viewtag: string = '63420f7facfada394dd5ef8a31e22d29';
/**
* 视图模型数据
*
* @type {*}
* @memberof CUSTOMEREditView9Base
*/
protected model: any = {
srfTitle: '客户编辑视图',
srfCaption: 'customer.views.editview9.caption',
srfSubCaption: '',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof CUSTOMEREditView9Base
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof CUSTOMEREditView9Base
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
_this.parseViewParam();
_this.engine.load();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof CUSTOMEREditView9Base
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 视图状态订阅对象
*
* @private
* @type {Subject<{action: string, data: any}>}
* @memberof CUSTOMEREditView9Base
*/
protected viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof CUSTOMEREditView9
*/
public toolBarModels: any = {
};
/**
* 视图引擎
*
* @private
* @type {Engine}
* @memberof CUSTOMEREditView9Base
*/
private engine: EditView9Engine = new EditView9Engine();
/**
* 引擎初始化
*
* @private
* @memberof CUSTOMEREditView9Base
*/
private engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'customer',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof CUSTOMEREditView9Base
*/
protected context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof CUSTOMEREditView9Base
*/
protected viewparams:any = {};
/**
* 解析视图参数
*
* @private
* @memberof CUSTOMEREditView9Base
*/
private parseViewParam(): void {
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.context,this.viewparams);
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
}
/**
* Vue声明周期
*
* @memberof CUSTOMEREditView9Base
*/
protected created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof CUSTOMEREditView9Base
*/
protected afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof CUSTOMEREditView9Base
*/
protected beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof CUSTOMEREditView9Base
*/
protected mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof CUSTOMEREditView9Base
*/
protected afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.panelState){
this.panelState.subscribe((res:any) =>{
if(Object.is(res.tag,'meditviewpanel')){
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'form', action: 'save', data:res.data});
}
if(Object.is(res.action,'remove')){
this.viewState.next({ tag:'form', action: 'remove', data:res.data});
}
}
});
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof CUSTOMEREditView9Base
*/
protected form_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof CUSTOMEREditView9Base
*/
protected form_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof CUSTOMEREditView9Base
*/
protected form_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof CUSTOMEREditView9Base
*/
protected closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof CUSTOMEREditView9Base
*/
protected destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof CUSTOMEREditView9Base
*/
protected afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
/**
* meditview9状态下发变量
*
* @memberof IBZSAM02MobEditView
*/
@Prop() public panelState ?:Subject<ViewState>;
}
</script>
<style lang='less'>
@import './customeredit-view9.less';
</style>
\ No newline at end of file
.view-card {
>.ivu-card-extra {
top: 5px;
right: 0px;
}
}
// this is less
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import CUSTOMEREditView9Base from './customeredit-view9-base.vue';
import view_form from '@widgets/customer/form-form/form-form.vue';
@Component({
components: {
view_form,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class CUSTOMEREditView9 extends CUSTOMEREditView9Base {
}
</script>
\ No newline at end of file
<template>
<div class="view-container customermedit-view9">
<card class='view-card' :disHover="true" :padding="0" :bordered="false">
<p slot="title">
客户
</p>
<div class="content-container">
<view_meditviewpanel
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
:saveRefView="saveRefView"
@viewdatadirty="onViewDataDirty"
@drdatasaved="onDRDataSaved"
updateAction=""
removeAction=""
loaddraftAction="GetDraftTemp"
loadAction=""
createAction=""
fetchAction=""
name="meditviewpanel"
ref='meditviewpanel'
@closeview="closeView($event)">
</view_meditviewpanel>
</div>
</card>
</div>
</template>
<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool } from '@/utils';
import { Subject } from 'rxjs';
import CUSTOMERService from '@/service/customer/customer-service';
@Component({
components: {
},
})
export default class CUSTOMERMEditView9Base extends Vue {
/**
* 实体服务对象
*
* @type {CUSTOMERService}
* @memberof CUSTOMERMEditView9Base
*/
protected appEntityService: CUSTOMERService = new CUSTOMERService;
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof CUSTOMERMEditView9Base
*/
@Emit()
protected viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof CUSTOMERMEditView9Base
*/
@Prop() protected viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof CUSTOMERMEditView9Base
*/
@Prop() protected viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof CUSTOMERMEditView9Base
*/
@Prop({ default: true }) protected viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof CUSTOMERMEditView9Base
*/
protected viewtag: string = '88a6ffc1d3a5aed1f79e5b2fa8e3b396';
/**
* 视图模型数据
*
* @type {*}
* @memberof CUSTOMERMEditView9Base
*/
protected model: any = {
srfTitle: '客户多表单编辑视图',
srfCaption: 'customer.views.meditview9.caption',
srfSubCaption: '',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof CUSTOMERMEditView9Base
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof CUSTOMERMEditView9Base
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
_this.parseViewParam();
_this.engine.load();
}
if(!Object.is(newVal, oldVal) ){
_this.parseViewParam();
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.context });
}
}
/**
* 容器模型
*
* @type {*}
* @memberof CUSTOMERMEditView9Base
*/
protected containerModel: any = {
view_meditviewpanel: { name: 'meditviewpanel', type: 'MULTIEDITVIEWPANEL' },
};
/**
* 视图状态订阅对象
*
* @private
* @type {Subject<{action: string, data: any}>}
* @memberof CUSTOMERMEditView9Base
*/
protected viewState: Subject<ViewState> = new Subject();
/**
* 引擎初始化
*
* @private
* @memberof CUSTOMERMEditView9Base
*/
private engineInit(): void {
}
/**
* 应用上下文
*
* @type {*}
* @memberof CUSTOMERMEditView9Base
*/
protected context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof CUSTOMERMEditView9Base
*/
protected viewparams:any = {};
/**
* 解析视图参数
*
* @private
* @memberof CUSTOMERMEditView9Base
*/
private parseViewParam(): void {
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.context,this.viewparams);
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
}
/**
* Vue声明周期
*
* @memberof CUSTOMERMEditView9Base
*/
protected created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof CUSTOMERMEditView9Base
*/
protected afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof CUSTOMERMEditView9Base
*/
protected beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof CUSTOMERMEditView9Base
*/
protected mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof CUSTOMERMEditView9Base
*/
protected afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.formDruipart){
this.formDruipart.subscribe((res) =>{
if(Object.is(res.action,'save')){
let opt ={data:res.data};
Object.assign(opt,this.context);
this.viewState.next({ tag:'meditviewpanel', action: 'save', data: opt });
}
if(Object.is(res.action,'remove')){
let opt ={data:res.data};
Object.assign(opt,this.context);
this.viewState.next({ tag:'meditviewpanel', action: 'remove', data: opt });
}
});
}
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.context });
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [$event]
* @param {*} [xData]
* @memberof CUSTOMERMEditView9
*/
protected newdata(args: any[], params?: any, $event?: any, xData?: any) {
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [$event]
* @param {*} [xData]
* @memberof CUSTOMERMEditView9
*/
protected opendata(args: any[], params?: any, $event?: any, xData?: any) {
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof CUSTOMERMEditView9Base
*/
protected closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof CUSTOMERMEditView9Base
*/
protected destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof CUSTOMERMEditView9Base
*/
protected afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof IBZSAM02MobMEditView9
*/
@Prop() public formDruipart!: Subject<ViewState>;
/**
* 刷新数据参数
*
* @type {number}
* @memberof CUSTOMERMEditView9
*/
@Prop() public saveRefView?: number;
/**
* 关系数据变化
*
* @param {*} $event
* @memberof CUSTOMERMEditView9
*/
public onViewDataDirty($event: any) {
this.$emit('drdatachange', $event);
}
/**
* 关系数据保存执行完成
*
* @param {*} $event
* @memberof CUSTOMERMEditView9
*/
public onDRDataSaved($event: any) {
this.$emit('drdatasaved', $event);
}
}
</script>
<style lang='less'>
@import './customermedit-view9.less';
</style>
\ No newline at end of file
// this is less
.customermedit-view9{
width:100%;
}
\ No newline at end of file
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import CUSTOMERMEditView9Base from './customermedit-view9-base.vue';
import view_meditviewpanel from '@widgets/customer/main-multieditviewpanel/main-multieditviewpanel.vue';
@Component({
components: {
view_meditviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class CUSTOMERMEditView9 extends CUSTOMERMEditView9Base {
}
</script>
\ No newline at end of file
import SysOperator from '@/codelist/sys-operator';
import { Store } from 'vuex';
/**
......@@ -32,6 +33,14 @@ export default class CodeListService {
}
/**
* 代码表--云系统操作者
*
* @type {SysOperator}
* @memberof CodeListService
*/
public SysOperator: SysOperator = new SysOperator();
/**
* 获取动态代码表
*
......
......@@ -3,6 +3,25 @@
*/
export const viewstate: any = {
appviews: [
{
viewtag: '63420f7facfada394dd5ef8a31e22d29',
viewmodule: 'Module',
viewname: 'CUSTOMEREditView9',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: '88a6ffc1d3a5aed1f79e5b2fa8e3b396',
viewmodule: 'Module',
viewname: 'CUSTOMERMEditView9',
viewaction: '',
viewdatachange: false,
refviews: [
'63420f7facfada394dd5ef8a31e22d29',
],
},
],
createdviews: [],
}
\ No newline at end of file
<template>
<i-form :model="this.data" class='app-form' ref='form' style="">
<input style="display:none;" />
<row >
<tabs :animated="false" name='form' :value="detailsModel.form.activiedPage"
@on-click="detailsModel.form.clickPage($event)">
</tabs>
</row>
</i-form>
</template>
<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UICounter,UIActionTool } from '@/utils';
import CUSTOMERService from '@/service/customer/customer-service';
import EditFormService from './form-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
@Component({
components: {
}
})
export default class EditFormBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof EditForm
*/
@Prop() protected viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof EditForm
*/
@Prop() protected context: any;
/**
* 视图参数
*
* @type {*}
* @memberof EditForm
*/
@Prop() protected viewparams: any;
/**
* 视图状态事件
*
* @protected
* @type {(Subscription | undefined)}
* @memberof EditForm
*/
protected viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof EditForm
*/
protected getControlType(): string {
return 'FORM'
}
/**
* 建构部件服务对象
*
* @type {EditFormService}
* @memberof EditForm
*/
protected service: EditFormService = new EditFormService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {CUSTOMERService}
* @memberof EditForm
*/
protected appEntityService: CUSTOMERService = new CUSTOMERService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any[]} args
* @memberof EditForm
*/
protected closeView(args: any[]): void {
let _this: any = this;
_this.$emit('closeview', args);
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof EditForm
*/
public getDatas(): any[] {
return [this.data];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof EditForm
*/
public getData(): any {
return this.data;
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof EditForm
*/
@Prop({ default: false }) protected autosave?: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof EditForm
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 部件行为--submit
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected WFSubmitAction!: string;
/**
* 部件行为--start
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected WFStartAction!: string;
/**
* 部件行为--update
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected updateAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected removeAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected loaddraftAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected createAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected searchAction!: string;
/**
* 视图标识
*
* @type {string}
* @memberof EditForm
*/
@Prop() protected viewtag!: string;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof EditForm
*/
protected formState: Subject<any> = new Subject();
/**
* 忽略表单项值变化
*
* @type {boolean}
* @memberof EditForm
*/
protected ignorefieldvaluechange: boolean = false;
/**
* 数据变化
*
* @private
* @type {Subject<any>}
* @memberof EditForm
*/
private dataChang: Subject<any> = new Subject();
/**
* 视图状态事件
*
* @private
* @type {(Subscription | undefined)}
* @memberof EditForm
*/
private dataChangEvent: Subscription | undefined;
/**
* 原始数据
*
* @private
* @type {*}
* @memberof EditForm
*/
private oldData: any = {};
/**
* 表单数据对象
*
* @type {*}
* @memberof EditForm
*/
protected data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
customerid: null,
customer:null,
};
/**
* 当前执行的行为逻辑
*
* @type {string}
* @memberof EditForm
*/
protected currentAction: string = "";
/**
* 关系界面计数器
*
* @type {number}
* @memberof EditForm
*/
protected drcounter: number = 0;
/**
* 表单保存回调存储对象
*
* @type {any}
* @memberof EditForm
*/
protected saveState:any ;
/**
* 属性值规则
*
* @type {*}
* @memberof EditForm
*/
protected rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '客户标识 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户标识 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户标识 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户名称 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
customerid: [
{ type: 'string', message: '客户标识 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户标识 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户标识 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof EditForm
*/
protected detailsModel: any = {
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '客户标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '客户名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
customerid: new FormItemModel({ caption: '客户标识', detailType: 'FORMITEM', name: 'customerid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
};
/**
* 监控表单属性 srfupdatedate 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfupdatedate')
onSrfupdatedateChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfupdatedate', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srforikey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srforikey')
onSrforikeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srforikey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfkey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfkey')
onSrfkeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfkey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfmajortext 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfmajortext')
onSrfmajortextChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfmajortext', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srftempmode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srftempmode')
onSrftempmodeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srftempmode', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfuf 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfuf')
onSrfufChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfuf', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfdeid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfdeid')
onSrfdeidChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfdeid', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 srfsourcekey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.srfsourcekey')
onSrfsourcekeyChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'srfsourcekey', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 customerid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
@Watch('data.customerid')
onCustomeridChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'customerid', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
*
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof EditForm
*/
private resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 置空对象
*
* @param {any[]} args
* @memberof EditForm
*/
protected ResetData(_datas:any){
if(Object.keys(_datas).length >0){
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = null;
}
});
}
}
/**
* 表单逻辑
*
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof EditForm
*/
private formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
* 表单值变化
*
* @private
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @memberof EditForm
*/
private formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
if (this.ignorefieldvaluechange) {
return;
}
this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
this.dataChang.next(JSON.stringify(this.data));
}
/**
* 表单加载完成
*
* @private
* @param {*} [data={}]
* @memberof EditForm
*/
private onFormLoad(data: any = {}): void {
this.setFormEnableCond(data);
this.fillForm(data);
this.oldData = {};
Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.formLogic({ name: '', newVal: null, oldVal: null });
}
/**
* 值填充
*
* @param {*} [_datas={}]
* @memberof EditForm
*/
protected fillForm(_datas: any = {}): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
}
/**
* 设置表单项是否启用
*
* @protected
* @param {*} data
* @memberof EditForm
*/
protected setFormEnableCond(data: any): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setEnableCond(data.srfuf);
});
}
/**
* 重置草稿表单状态
*
* @private
* @memberof EditForm
*/
private resetDraftFormStates(): void {
const form: any = this.$refs.form;
if (form) {
form.resetFields();
}
}
/**
* 重置校验结果
*
* @memberof EditForm
*/
protected resetValidates(): void {
Object.values(this.detailsModel).forEach((detail: any) => {
if (!Object.is(detail.detailType, 'FORMITEM')) {
return;
}
const formItem: FormItemModel = detail;
formItem.setError('');
});
}
/**
* 填充校验结果 (后台)
*
* @param {any[]} fieldErrors
* @memberof EditForm
*/
protected fillValidates(fieldErrors: any[]): void {
fieldErrors.forEach((error: any) => {
const formItem: FormItemModel = this.detailsModel[error.field];
if (!formItem) {
return;
}
this.$nextTick(() => {
formItem.setError(error.message);
});
});
}
/**
* 表单校验状态
*
* @returns {boolean}
* @memberof EditForm
*/
protected formValidateStatus(): boolean {
const form: any = this.$refs.form;
let validatestate: boolean = true;
form.validate((valid: boolean) => {
validatestate = valid ? true : false;
});
return validatestate
}
/**
* 获取全部值
*
* @returns {*}
* @memberof EditForm
*/
protected getValues(): any {
return this.data;
}
/**
* 表单项值变更
*
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof EditForm
*/
protected onFormItemValueChange($event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !this.data.hasOwnProperty($event.name)) {
return;
}
this.data[$event.name] = $event.value;
}
/**
* 设置数据项值
*
* @param {string} name
* @param {*} value
* @returns {void}
* @memberof EditForm
*/
protected setDataItemValue(name: string, value: any): void {
if (!name || Object.is(name, '') || !this.data.hasOwnProperty(name)) {
return;
}
if (Object.is(this.data[name], value)) {
return;
}
this.data[name] = value;
}
/**
* 分组界面行为事件
*
* @param {*} $event
* @memberof EditForm
*/
protected groupUIActionClick($event: any): void {
if (!$event) {
return;
}
const item:any = $event.item;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof EditForm
*/
protected created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof EditForm
*/
protected afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('autoload', action)) {
this.autoLoad(data);
}
if (Object.is('load', action)) {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('saveandexit', action)) {
this.saveAndExit(data);
}
if (Object.is('saveandnew', action)) {
this.saveAndNew(data);
}
if (Object.is('removeandexit', action)) {
this.removeAndExit(data);
}
if (Object.is('refresh', action)) {
this.refresh(data);
}
});
}
this.dataChang
.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe((data: any) => {
if (this.autosave) {
this.autoSave();
}
const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
});
}
/**
* vue 生命周期
*
* @memberof EditForm
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof EditForm
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if (this.dataChangEvent) {
this.dataChangEvent.unsubscribe();
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof EditForm
*/
protected copy(arg: any = {}): void {
this.loadDraft(arg);
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof EditForm
*/
protected refresh(args: any[]): void {
let arg: any = {};
Object.assign(arg,args[0]);
if (this.data.srfkey && !Object.is(this.data.srfkey, '')) {
Object.assign(arg, { srfkey: this.data.srfkey });
this.load(arg);
return;
}
if (this.data.srfkeys && !Object.is(this.data.srfkeys, '')) {
Object.assign(arg, { srfkey: this.data.srfkeys });
this.load(arg);
return;
}
}
/**
* 自动加载
*
* @param {*} [arg={}]
* @returns {void}
* @memberof EditForm
*/
protected autoLoad(arg: any = {}): void {
if (arg.srfkey && !Object.is(arg.srfkey, '')) {
Object.assign(arg, { srfkey: arg.srfkey });
this.load(arg);
return;
}
if (arg.srfkeys && !Object.is(arg.srfkeys, '')) {
Object.assign(arg, { srfkey: arg.srfkeys });
this.load(arg);
return;
}
this.loadDraft(arg);
}
/**
* 加载
*
* @private
* @param {*} [opt={}]
* @memberof EditForm
*/
private load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单loadAction参数未配置' });
return;
}
const arg: any = { ...opt };
const get: Promise<any> = this.service.get(this.loadAction,this.context,arg, this.showBusyIndicator);
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data);
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
/**
* 加载草稿
*
* @param {*} [opt={}]
* @memberof EditForm
*/
protected loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单loaddraftAction参数未配置' });
return;
}
const arg: any = { ...opt } ;
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,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 });
}
return;
}
const data = response.data;
if(data.customer){
Object.assign(this.context,{customer:data.customer})
}
this.resetDraftFormStates();
this.onFormLoad(data);
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
form.fields.forEach((field: any) => {
field.validateMessage = "";
field.validateState = "";
field.validateStatus = false;
});
}
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
const { data: _data } = response;
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof EditForm
*/
protected autoSave(opt: any = {}): void {
if (!this.formValidateStatus()) {
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.add(action, 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 });
}
return;
}
const data = response.data;
this.onFormLoad(data);
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
/**
* 保存
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @param {boolean} [ifStateNext] formState是否下发通知
* @returns {Promise<any>}
* @memberof EditForm
*/
protected async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
opt.saveEmit = opt.saveEmit === undefined ? true :false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return;
}
const arg: any = { ...opt };
const data = this.getValues();
Object.assign(arg, data);
Object.assign(arg, this.context);
if (ifStateNext) {
this.drcounter = 0;
if(this.drcounter !== 0){
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
this.saveState = resolve;
return;
}
}
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单'+actionName+'参数未配置' });
return;
}
Object.assign(arg,this.viewparams);
const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, this.context,arg, this.showBusyIndicator):this.service.add(action,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 });
}
return;
}
const data = response.data;
this.onFormLoad(data);
if(!opt.saveEmit){
this.$emit('save', data);
}
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
if (showResultInfo) {
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功!' });
}
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(response);
});
})
}
/**
* 删除
*
* @private
* @param {*} [opt={}]
* @memberof EditForm
*/
private remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单removeAction参数未配置' });
return;
}
const arg: any = opt[0];
const _this: any = this;
Object.assign(arg,this.viewparams);
this.service.delete(_this.removeAction, this.context,arg, showResultInfo).then((response: any) => {
if (response) {
const data = response.data;
this.$emit('remove',data);
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
resolve(response);
}
}).catch((error: any) => {
const { data: _data } = error;
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(error);
});
});
}
/**
* 工作流启动
*
* @param {*} [data={}]
* @returns {Promise<any>}
* @memberof EditForm
*/
protected async wfstart(data: any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.WFStartAction){
this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
return;
}
const _this: any = this;
const arg: any = data[0];
const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(this.updateAction, this.context,arg, this.showBusyIndicator):this.service.add(this.createAction,this.context,arg, this.showBusyIndicator);
post.then((response:any) =>{
const arg:any = response.data;
if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams});
}
const result: Promise<any> = this.service.wfstart(_this.WFStartAction, this.context,arg, this.showBusyIndicator);
result.then((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.info });
return;
}
this.$Notice.info({ title: '', desc: '工作流启动成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(response);
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(response);
})
});
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @returns {Promise<any>}
* @memberof EditForm
*/
protected async wfsubmit(data: any): Promise<any> {
if(!this.WFSubmitAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMEREditView9视图表单WFSubmitAction参数未配置' });
return;
}
const _this: any = this;
const arg: any = data[0];
if (!arg.customer || Object.is(arg.customer, '')) {
return;
}
const post: Promise<any> = this.service.wfsubmit(_this.WFSubmitAction,this.context, arg, this.showBusyIndicator);
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.info });
return;
}
this.$Notice.info({ title: '', desc: '工作流提交成功' });
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
reject(response);
});
});
}
/**
* 表单项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof EditForm
*/
protected updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
const arg: any = { ...data };
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(mode,this.context,arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
return;
}
const data = response.data;
const _data: any = {};
updateDetails.forEach((name: string) => {
if (!data.hasOwnProperty(name)) {
return;
}
Object.assign(_data, { [name]: data[name] });
});
this.setFormEnableCond(_data);
this.fillForm(_data);
this.formLogic({ name: '', newVal: null, oldVal: null });
this.dataChang.next(JSON.stringify(this.data));
this.$nextTick(() => {
this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
const { data: _data } = response;
if (Object.is(_data.status, 'BAD_REQUEST') && _data.parameters && _data.parameters.fieldErrors) {
this.resetValidates();
this.fillValidates(_data.parameters.fieldErrors)
}
this.$Notice.error({ title: _data.title, desc: _data.message });
});
}
/**
* 回车事件
*
* @param {*} $event
* @memberof EditForm
*/
protected onEnter($event: any): void {
}
/**
* 保存并退出
*
* @param {any[]} args
* @memberof EditForm
*/
protected saveAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.currentAction = "saveAndExit";
_this.save([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 保存并新建
*
* @param {any[]} args
* @memberof EditForm
*/
protected saveAndNew(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.currentAction = "saveAndNew";
_this.save([arg]).then((res) =>{
_this.ResetData(res);
_this.loadDraft({});
}).catch((error) =>{
reject(error);
})
})
}
/**
* 删除并退出
*
* @param {any[]} args
* @memberof EditForm
*/
protected removeAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.remove([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
}
/**
* 关系界面数据保存完成
*
* @param {any} $event
* @memberof EditForm
*/
protected drdatasaved($event:any){
let _this = this;
this.drcounter--;
if(this.drcounter > 0){
return;
}
this.save({}, undefined, false).then((res) =>{
this.saveState(res);
if(Object.is(_this.currentAction, "saveAndNew")){
_this.ResetData(res);
_this.loadDraft({});
}else if(Object.is(_this.currentAction, "saveAndExit")){
if(res){
_this.closeView(res.data);
}
}
});
}
}
</script>
<style lang='less'>
@import './form-form.less';
</style>
\ No newline at end of file
/**
* EditForm 部件模型
*
* @export
* @class EditFormModel
*/
export default class EditFormModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof EditFormModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'customerid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'customername',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'customerid',
prop: 'customerid',
dataType: 'GUID',
},
]
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 334, column 14]
----
\ No newline at end of file
.ivu-tabs-no-animation>.ivu-tabs-content{
padding: 0 16px;
}
.ivu-card-head{
padding: 14px 0;
}
.app-form {
> .ivu-row {
> .ivu-tabs {
height: 100%;
display: flex;
flex-direction: column;
> .ivu-tabs-content {
flex-grow: 1;
overflow: auto;
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
}
}
.app-tabpanel-flex {
height: 100%;
> .ivu-tabs-content {
height: calc(100% - 52px);
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
.app-form {
>.ivu-row:nth-child(2) {
>.ivu-col:nth-child(1) {
>.ivu-row.app-form-group.app-group-hiddden-caption:nth-child(1) {
margin-top: 12px;
}
}
}
}
// this is less
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import EditFormBase from './form-form-base.vue';
@Component({
components: {
}
})
export default class EditForm extends EditFormBase {
}
</script>
\ No newline at end of file
<template>
<div class='items multieditviewpanel'>
<div v-for="item in items" class='item' :key="item.id">
<customeredit-view9
class="viewcontainer2"
:viewdata ="viewdata(item)"
:viewDefaultUsage="false"
:panelState="panelState"
@viewdataschange="viewDataChange"
@viewload="viewload"
@viewdirty="viewdirty(item,$event)">
</customeredit-view9>
<divider />
</div>
<div>
<i-button type="primary" @click="handleAdd" style="float: right;">
增加
</i-button>
</div>
</div>
</template>
<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UICounter,UIActionTool } from '@/utils';
import CUSTOMERService from '@/service/customer/customer-service';
import MainService from './main-multieditviewpanel-service';
@Component({
components: {
}
})
export default class MainBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Main
*/
@Prop() protected name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Main
*/
@Prop() protected viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Main
*/
@Prop() protected context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Main
*/
@Prop() protected viewparams: any;
/**
* 视图状态事件
*
* @protected
* @type {(Subscription | undefined)}
* @memberof Main
*/
protected viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Main
*/
protected getControlType(): string {
return 'MULTIEDITVIEWPANEL'
}
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof Main
*/
protected service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {CUSTOMERService}
* @memberof Main
*/
protected appEntityService: CUSTOMERService = new CUSTOMERService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any[]} args
* @memberof Main
*/
protected closeView(args: any[]): void {
let _this: any = this;
_this.$emit('closeview', args);
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Main
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Main
*/
public getData(): any {
return null;
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Main
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof Main
*/
@Prop() protected updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Main
*/
@Prop() protected fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Main
*/
@Prop() protected removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Main
*/
@Prop() protected loadAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Main
*/
@Prop() protected loaddraftAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Main
*/
@Prop() protected createAction!: string;
/**
* 刷新数据
*
* @type {number}
* @memberof Main
*/
@Prop() protected saveRefView?: number;
/**
* 刷新数据
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@Watch('saveRefView')
onSaveRefView(newVal: any, oldVal: any) {
console.log('保存多项数据!');
if (newVal > 0) {
this.$emit('drdatasaved', false);
}
}
/**
* 视图数据
*
* @type {*}
* @memberof Main
*/
protected viewdata(item:any): string{
return JSON.stringify(item.viewdata);
}
/**
* 面板状态订阅对象
*
* @private
* @type {Subject<{action: string, data: any}>}
* @memberof Meditviewpanel
*/
protected panelState: Subject<ViewState> = new Subject();
/**
* 视图名称
*
* @type {string}
* @memberof Main
*/
protected viewname: string = 'customeredit-view9';
/**
* 获取数据对象
*
* @type {any[]}
* @memberof Main
*/
protected items: any[] = [];
/**
* 计数器
*
* @type number
* @memberof Main
*/
protected count: number = 0;
/**
* 关系实体参数对象
*
* @private
* @type {any[]}
* @memberof Main
*/
private deResParameters: any[] = [
];
/**
* 当前应用视图参数对象
*
* @private
* @type {any[]}
* @memberof Main
*/
private parameters: any[] = [
{ pathName: 'customers', parameterName: 'customer' },
];
/**
* vue 声明周期
*
* @memberof Main
*/
protected created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Main
*/
protected afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is(action, 'load')) {
this.load(data);
}
if (Object.is(action, 'save')) {
this.saveData(data);
}
});
}
}
/**
* 保存数据
*
* @memberof Meditviewpanel
*/
protected saveData(data?: any) {
this.count = 0;
if(this.items.length >0){
Object.assign(data,{showResultInfo:false,saveEmit:false});
this.panelState.next({ tag: 'meditviewpanel', action: 'save', data: data });
}else{
this.$emit("drdatasaved",{action:'drdatasaved'});
}
}
/**
* 处理数据
*
* @private
* @param {any[]} datas
* @memberof Main
*/
private doItems(datas: any[]): void {
const [{ pathName, parameterName }] = this.parameters;
datas.forEach((arg: any) => {
let id: string = arg[parameterName] ? arg[parameterName] : this.$util.createUUID();
let item: any = { id: id, viewdata: {} };
Object.assign(item.viewdata, this.$viewTool.getIndexViewParam());
Object.assign(item.viewdata, this.context);
// 关系应用实体参数
this.deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
if (this.context[parameterName] && !Object.is(this.context[parameterName], '')) {
Object.assign(item.viewdata, { [parameterName]: this.context[parameterName] });
} else if (arg[parameterName] && !Object.is(arg[parameterName], '')) {
Object.assign(item.viewdata, { [parameterName]: arg[parameterName] });
}
});
// 当前视图参数(应用实体视图)
this.parameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
if (arg[parameterName] && !Object.is(arg[parameterName], '')) {
Object.assign(item.viewdata, { [parameterName]: arg[parameterName] });
}
});
this.items.push(item);
});
}
/**
* 数据加载
*
* @private
* @param {*} data
* @memberof Main
*/
private load(data: any): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMERMEditView9视图多编辑视图面板fetchAction参数未配置' });
return;
}
let arg: any = {};
Object.assign(arg, data);
this.items = [];
const promice: Promise<any> = this.service.get(this.fetchAction,this.context,arg, this.showBusyIndicator);
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data: any = response.data;
if (data.length > 0) {
const items = JSON.parse(JSON.stringify(data));
this.doItems(items);
}
this.$emit('load', this.items);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
});
}
/**
* 增加数据
*
* @memberof Main
*/
protected handleAdd(){
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'CUSTOMERMEditView9视图多编辑视图面板loaddraftAction参数未配置' });
return;
}
const promice: Promise<any> = this.service.loadDraft(this.loaddraftAction,this.context,{}, this.showBusyIndicator);
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.doItems([data]);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
});
}
/**
* 设置视图脏值变化
*
* @param {*} item
* @param {boolean} $event
* @memberof Main
*/
protected setViewDirty(item: any, $event: boolean) {
let index: number = this.items.findIndex((_item: any) => Object.is(_item.id, item.id));
if (index === -1) {
return;
}
Object.assign(this.items[index], { viewdirty: $event });
let state: boolean = this.items.some((item: any) => {
if (item.viewdirty) {
return true;
}
return false;
});
this.$emit('viewdatadirty', state);
}
/**
* 部件抛出事件
* @memberof Main
*/
protected viewDataChange($event:any){
if($event){
try{
$event = JSON.parse($event);
}catch(error){
return;
}
if(Object.is($event.action,'load')){
console.log('加载----');
}
if(Object.is($event.action,'save')){
this.count++;
if (this.items.length === this.count) {
this.$emit('drdatasaved',{action:'save'});
}
}
if(Object.is($event.action,'remove')){
if ($event.data) {
let resultIndex = this.items.findIndex((value:any, index:any, arr:any) => {
return value['viewdata']['orderdetailtestid'] === $event.data['orderdetailtestid'];
});
if (resultIndex !== -1) {
this.items.splice(resultIndex, 1);
}
}
}
}
}
/**
* 视图加载完成
*
* @returns
* @memberof Main
*/
protected viewload($event:any){
console.log('视图加载完成');
}
/**
* editview9 视图数据变化
*
* @returns
* @memberof Main
*/
protected viewdirty(item:any,$event:any){
// editview9 视图数据变化;
this.setViewDirty(item, $event);
}
/**
* vue 生命周期
*
* @memberof Main
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Main
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './main-multieditviewpanel.less';
</style>
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainModel
*/
public getDataItems(): any[] {
return [
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import CUSTOMERService from '@/service/customer/customer-service';
import MainModel from './main-multieditviewpanel-model';
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export default class MainService extends ControlService {
/**
* 客户服务对象
*
* @type {CUSTOMERService}
* @memberof MainService
*/
public appEntityService: CUSTOMERService = new CUSTOMERService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new MainModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public get(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public loadDraft(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:0});
}
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
// this is less
.multieditviewpanel{
width: 100%;
}
\ No newline at end of file
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import MainBase from './main-multieditviewpanel-base.vue';
@Component({
components: {
}
})
export default class Main extends MainBase {
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册