提交 3df2b754 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 73bcbd73
......@@ -4476,6 +4476,33 @@
}
]
},
{
"srfkey": "Account__StatusCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "2",
"label": "停用",
"text": "停用",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
, {
"id": "1",
"label": "可用",
"text": "可用",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "Metric__AmountDataType",
"emptytext": "未定义",
......
......@@ -580,6 +580,11 @@ export default {
"1": "男",
"empty": ""
},
Account__StatusCode: {
"2": "停用",
"1": "可用",
"empty": ""
},
Metric__AmountDataType: {
"1": "十进制",
"2": "整数",
......
......@@ -580,6 +580,11 @@ export default {
"1": "男",
"empty": "",
},
Account__StatusCode: {
"2": "停用",
"1": "可用",
"empty": "",
},
Metric__AmountDataType: {
"1": "十进制",
"2": "整数",
......
......@@ -441,6 +441,24 @@ export default {
uiactions: {
},
},
quicksummary_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
statuscode: "状态描述",
accountid: "客户",
},
uiactions: {
},
},
main_form: {
details: {
group1: "账户信息",
......
......@@ -440,6 +440,24 @@ export default {
uiactions: {
},
},
quicksummary_form: {
details: {
group1: "客户基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "客户",
srfmajortext: "客户名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
statuscode: "状态描述",
accountid: "客户",
},
uiactions: {
},
},
main_form: {
details: {
group1: "账户信息",
......
......@@ -4484,6 +4484,33 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: "Account__StatusCode",
emptytext: "未定义",
"codelisttype":"static",
items: [
{
id: "2",
label: "停用",
text: "停用",
"data":"",
"codename":"Item_2",
value: "2",
disabled: false,
},
{
id: "1",
label: "可用",
text: "可用",
"data":"",
"codename":"Item_1",
value: "1",
disabled: false,
},
]
},
{
srfkey: "Metric__AmountDataType",
emptytext: "未定义",
......
......@@ -54,7 +54,7 @@ export class AccountInfoBase extends TabExpViewBase {
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_quicksummary: { name: 'quicksummary', type: 'CUSTOM' },
view_quicksummary: { name: 'quicksummary', type: 'FORM' },
view_tabexppanel: { name: 'tabexppanel', type: 'TABEXPPANEL' },
};
......
......@@ -3,7 +3,7 @@
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { AccountInfoBase } from './account-info-base';
import view_quicksummary from '@widgets/account/infoquicksummary-custom/infoquicksummary-custom.vue';
import view_quicksummary from '@widgets/account/quick-summary-form/quick-summary-form.vue';
import view_tabexppanel from '@widgets/account/infotabexppanel-tabexppanel/infotabexppanel-tabexppanel.vue';
/**
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import AccountService from '@/service/account/account-service';
import QuickSummaryService from './quick-summary-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* quicksummary部件基类
*
* @export
* @class EditFormControlBase
* @extends {QuickSummaryEditFormBase}
*/
export class QuickSummaryEditFormBase extends EditFormControlBase {
/**
* 建构部件服务对象
*
* @type {QuickSummaryService}
* @memberof QuickSummaryEditFormBase
*/
public service: QuickSummaryService = new QuickSummaryService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof QuickSummaryEditFormBase
*/
public appEntityService: AccountService = new AccountService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof QuickSummaryEditFormBase
*/
protected appDeName: string = 'account';
/**
* 表单数据对象
*
* @type {*}
* @memberof QuickSummaryEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
statuscode: null,
accountid: null,
account:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof QuickSummaryEditFormBase
*/
public rules: any = {
}
/**
* 详情模型集合
*
* @type {*}
* @memberof QuickSummaryEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '客户基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.account.quicksummary_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }),
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 0 }),
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 }),
statuscode: new FormItemModel({ caption: '状态描述', detailType: 'FORMITEM', name: 'statuscode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
accountid: new FormItemModel({ caption: '客户', detailType: 'FORMITEM', name: 'accountid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
};
}
\ No newline at end of file
/**
* QuickSummary 部件模型
*
* @export
* @class QuickSummaryModel
*/
export default class QuickSummaryModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof QuickSummaryModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'accountname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'statuscode',
prop: 'statuscode',
dataType: 'NSCODELIST',
},
{
name: 'accountid',
prop: 'accountid',
dataType: 'GUID',
},
{
name: 'account',
prop: 'accountid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import AccountService from '@/service/account/account-service';
import QuickSummaryModel from './quick-summary-form-model';
/**
* QuickSummary 部件服务对象
*
* @export
* @class QuickSummaryService
*/
export default class QuickSummaryService extends ControlService {
/**
* 客户服务对象
*
* @type {AccountService}
* @memberof QuickSummaryService
*/
public appEntityService: AccountService = new AccountService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof QuickSummaryService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of QuickSummaryService.
*
* @param {*} [opts={}]
* @memberof QuickSummaryService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new QuickSummaryModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof QuickSummaryService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof QuickSummaryService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof QuickSummaryService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
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,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof QuickSummaryService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data,true).context;
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,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
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 QuickSummaryService
*/
@Errorlog
public add(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.Create(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 QuickSummaryService
*/
@Errorlog
public delete(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.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuickSummaryService
*/
@Errorlog
public update(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.Update(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 QuickSummaryService
*/
@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 QuickSummaryService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
const PrimaryKey = Util.createUUID();
Data.accountid = PrimaryKey;
Data.account = PrimaryKey;
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) => {
response.data.accountid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuickSummaryService
*/
@Errorlog
public frontLogic(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 {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof QuickSummaryService
*/
public handleRequestData(action: string,context:any, data: any = {},isMerge:boolean = false){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-form' ref='quicksummary' id='account_quicksummary' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.account.quicksummary_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.statuscode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='statuscode' :itemRules="this.rules.statuscode" class='' :caption="$t('entities.account.quicksummary_form.details.statuscode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.statuscode.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.statuscode"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.statuscode.disabled"
tag='Account__StatusCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
\ No newline at end of file
<template src="./quick-summary-form.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { QuickSummaryEditFormBase } from './quick-summary-form-base';
/**
* quicksummary部件
*
* @export
* @class QuickSummaryEditForm
* @extends {QuickSummaryEditFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class QuickSummaryEditForm extends QuickSummaryEditFormBase { }
</script>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册