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

xignzi006 发布系统代码

上级 761dc258
......@@ -1959,6 +1959,16 @@
"viewtag": "ab653866ca40a1cefde21241ac5ba44c",
"memo": ""
},
"opportunitycompetitorcompoppgridview": {
"title": "竞争对手商机信息",
"caption": "商机对手",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Sales",
"viewname": "OpportunityCompetitorCompOppGridView",
"viewfilename": "opportunity-competitor-comp-opp-grid-view",
"viewtag": "ac5ea5e435a4102d39f1f4a569368b25",
"memo": ""
},
"competitorinfo": {
"title": "竞争对手",
"caption": "竞争对手",
......
......@@ -33,10 +33,10 @@ export default {
uiactions: {
},
},
default_searchform: {
ac_searchform: {
details: {
formpage1: "常规条件",
n_pickdataname_like: "数据名称(%)",
n_pickdataname_like: "负责人",
},
uiactions: {
},
......
......@@ -32,10 +32,10 @@ export default {
uiactions: {
},
},
default_searchform: {
ac_searchform: {
details: {
formpage1: "常规条件",
n_pickdataname_like: "数据名称(%)",
n_pickdataname_like: "负责人",
},
uiactions: {
},
......
......@@ -24,6 +24,10 @@ export default {
caption: "商机对手",
title: "商机对手表格视图",
},
compoppgridview: {
caption: "商机对手",
title: "竞争对手商机信息",
},
edit_compoppview: {
caption: "商机对手",
title: "竞争对手商机信息",
......@@ -162,6 +166,44 @@ export default {
tip: "关闭",
},
},
compoppgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
edit_compoppviewtoolbar_toolbar: {
tbitem1: {
caption: "Save And Close",
......
......@@ -23,6 +23,10 @@ export default {
caption: "商机对手",
title: "商机对手表格视图",
},
compoppgridview: {
caption: "商机对手",
title: "竞争对手商机信息",
},
edit_compoppview: {
caption: "商机对手",
title: "竞争对手商机信息",
......@@ -161,6 +165,44 @@ export default {
tip: "关闭",
},
},
compoppgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
edit_compoppviewtoolbar_toolbar: {
tbitem1: {
caption: "保存并关闭",
......
......@@ -1575,6 +1575,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "InvoiceInfoView",
"viewtag": "ab653866ca40a1cefde21241ac5ba44c"
},
"opportunitycompetitorcompoppgridview": {
"title": "竞争对手商机信息",
"caption": "商机对手",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Sales",
"viewname": "OpportunityCompetitorCompOppGridView",
"viewtag": "ac5ea5e435a4102d39f1f4a569368b25"
},
"competitorinfo": {
"title": "竞争对手",
"caption": "竞争对手",
......
......@@ -4,7 +4,7 @@ import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MultiPickDataACGridBase } from './multi-pick-data-acgrid-base';
import view_grid from '@widgets/multi-pick-data/main-grid/main-grid.vue';
import view_searchform from '@widgets/multi-pick-data/default-searchform/default-searchform.vue';
import view_searchform from '@widgets/multi-pick-data/ac-searchform/ac-searchform.vue';
/**
* 负责人(客户、联系人)表格视图
......
......@@ -80,6 +80,7 @@ export default class OpportunityCompetitorUIServiceBase extends UIService {
*/
public initViewMap(){
this.allViewMap.set(':',{viewname:'oppcompgridview',srfappde:'opportunitycompetitors'});
this.allViewMap.set(':',{viewname:'compoppgridview',srfappde:'opportunitycompetitors'});
this.allViewMap.set(':',{viewname:'edit_compoppview',srfappde:'opportunitycompetitors'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'opportunitycompetitors'});
}
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, SearchFormControlBase } from '@/studio-core';
import MultiPickDataService from '@/service/multi-pick-data/multi-pick-data-service';
import ACService from './ac-searchform-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
/**
* searchform部件基类
*
* @export
* @class SearchFormControlBase
* @extends {ACSearchFormBase}
*/
export class ACSearchFormBase extends SearchFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof ACSearchFormBase
*/
protected controlType: string = 'SEARCHFORM';
/**
* 建构部件服务对象
*
* @type {ACService}
* @memberof ACSearchFormBase
*/
public service: ACService = new ACService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {MultiPickDataService}
* @memberof ACSearchFormBase
*/
public appEntityService: MultiPickDataService = new MultiPickDataService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof ACSearchFormBase
*/
protected appDeName: string = 'multipickdata';
/**
* 表单数据对象
*
* @type {*}
* @memberof ACSearchFormBase
*/
public data: any = {
n_pickdataname_like: null,
};
/**
* 详情模型集合
*
* @type {*}
* @memberof ACSearchFormBase
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
n_pickdataname_like: new FormItemModel({ caption: '负责人', detailType: 'FORMITEM', name: 'n_pickdataname_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
};
}
\ No newline at end of file
/**
* AC 部件模型
*
* @export
* @class ACModel
*/
export default class ACModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ACModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_pickdataname_like',
prop: 'pickdataname',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import MultiPickDataService from '@/service/multi-pick-data/multi-pick-data-service';
import ACModel from './ac-searchform-model';
/**
* AC 部件服务对象
*
* @export
* @class ACService
*/
export default class ACService extends ControlService {
/**
* 多类选择实体服务对象
*
* @type {MultiPickDataService}
* @memberof ACService
*/
public appEntityService: MultiPickDataService = new MultiPickDataService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof ACService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of ACService.
*
* @param {*} [opts={}]
* @memberof ACService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new ACModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof ACService
*/
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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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 ACService
*/
@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) => {
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 ACService
*/
@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 ACService
*/
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-search-form' ref='searchform' style="">
<input style="display:none;"/>
<div class="search-button">
<i-button size="small" type="primary" ghost @click="onSearch.apply(_self, arguments)">{{$t('app.searchButton.search')}}</i-button>
<i-button size="small" type="default" ghost @click="onReset.apply(_self, arguments)">{{this.$t('app.searchButton.reset')}}</i-button>
</div>
<div class="form-content">
<i-col v-show="detailsModel.n_pickdataname_like.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_pickdataname_like' :itemRules="this.rules.n_pickdataname_like" class='' :caption="$t('entities.multipickdata.ac_searchform.details.n_pickdataname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_pickdataname_like.error" :isEmptyCaption="false" labelPos="TOP">
<input-box v-model="data.n_pickdataname_like" @enter="onEnter($event)" :disabled="detailsModel.n_pickdataname_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
</div>
</i-form>
\ No newline at end of file
<template src="./ac-searchform.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ACSearchFormBase } from './ac-searchform-base';
/**
* searchform部件
*
* @export
* @class ACSearchForm
* @extends {ACSearchFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class ACSearchForm extends ACSearchFormBase { }
</script>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册