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

xignzi006 发布系统代码

上级 0c190713
......@@ -371,6 +371,23 @@
}
]
},
{
"srfkey": "Account__AccountClassificationCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "Default Value",
"text": "Default Value",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "Activitypointer__PriorityCode",
"emptytext": "未定义",
......@@ -408,6 +425,23 @@
}
]
},
{
"srfkey": "Account__AccountRatingCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "Default Value",
"text": "Default Value",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "Campaign__TypeCode",
"emptytext": "未定义",
......@@ -1330,6 +1364,50 @@
}
]
},
{
"srfkey": "Contact__LeadSourceCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "Default Value",
"text": "Default Value",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
]
},
{
"srfkey": "Account__AccountCategoryCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "Preferred Customer",
"text": "Preferred Customer",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
, {
"id": "2",
"label": "Standard",
"text": "Standard",
"data":"",
"codename":"Item_2",
"value": "2",
"disabled": false
}
]
},
{
"srfkey": "Product__ProductTypeCode",
"emptytext": "未定义",
......
......@@ -50,12 +50,20 @@ export default {
'CAMPAIGNRESPONSE': '市场活动响应',
empty: '',
},
Account__AccountClassificationCode: {
'1': 'Default Value',
empty: '',
},
Activitypointer__PriorityCode: {
'2': 'High',
'0': 'Low',
'1': 'Normal',
empty: '',
},
Account__AccountRatingCode: {
'1': 'Default Value',
empty: '',
},
Campaign__TypeCode: {
'1': 'Advertisement',
'4': 'Co-branding',
......@@ -178,6 +186,15 @@ export default {
'2': 'Ship To',
empty: '',
},
Contact__LeadSourceCode: {
'1': 'Default Value',
empty: '',
},
Account__AccountCategoryCode: {
'1': 'Preferred Customer',
'2': 'Standard',
empty: '',
},
Product__ProductTypeCode: {
'4': 'Flat Fees',
'2': 'Miscellaneous Charges',
......
......@@ -50,12 +50,20 @@ export default {
'CAMPAIGNRESPONSE': '市场活动响应',
empty: '',
},
Account__AccountClassificationCode: {
'1': 'Default Value',
empty: '',
},
Activitypointer__PriorityCode: {
'2': 'High',
'0': 'Low',
'1': 'Normal',
empty: '',
},
Account__AccountRatingCode: {
'1': 'Default Value',
empty: '',
},
Campaign__TypeCode: {
'1': 'Advertisement',
'4': 'Co-branding',
......@@ -178,6 +186,15 @@ export default {
'2': 'Ship To',
empty: '',
},
Contact__LeadSourceCode: {
'1': 'Default Value',
empty: '',
},
Account__AccountCategoryCode: {
'1': 'Preferred Customer',
'2': 'Standard',
empty: '',
},
Product__ProductTypeCode: {
'4': 'Flat Fees',
'2': 'Miscellaneous Charges',
......
......@@ -517,6 +517,11 @@ export default {
default_searchform: {
details: {
formpage1: "常规条件",
n_accountname_like: "客户名称(文本包含(%))",
n_statecode_eq: "状态(等于(=))",
n_accountcategorycode_eq: "类别(等于(=))",
n_accountclassificationcode_eq: "分类(等于(=))",
n_accountratingcode_eq: "客户等级(等于(=))",
},
uiactions: {
},
......
......@@ -516,6 +516,11 @@ export default {
default_searchform: {
details: {
formpage1: '常规条件',
n_accountname_like: '客户名称(文本包含(%))',
n_statecode_eq: '状态(等于(=))',
n_accountcategorycode_eq: '类别(等于(=))',
n_accountclassificationcode_eq: '分类(等于(=))',
n_accountratingcode_eq: '客户等级(等于(=))',
},
uiactions: {
},
......
......@@ -469,6 +469,9 @@ export default {
default_searchform: {
details: {
formpage1: "常规条件",
n_fullname_like: "全名(文本包含(%))",
n_statecode_eq: "状态(等于(=))",
n_leadsourcecode_eq: "潜在顾客来源(等于(=))",
},
uiactions: {
},
......
......@@ -468,6 +468,9 @@ export default {
default_searchform: {
details: {
formpage1: '常规条件',
n_fullname_like: '全名(文本包含(%))',
n_statecode_eq: '状态(等于(=))',
n_leadsourcecode_eq: '潜在顾客来源(等于(=))',
},
uiactions: {
},
......
......@@ -379,6 +379,23 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Account__AccountClassificationCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '1',
label: 'Default Value',
text: 'Default Value',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
]
},
{
srfkey: 'Activitypointer__PriorityCode',
emptytext: '未定义',
......@@ -416,6 +433,23 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Account__AccountRatingCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '1',
label: 'Default Value',
text: 'Default Value',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
]
},
{
srfkey: 'Campaign__TypeCode',
emptytext: '未定义',
......@@ -1338,6 +1372,50 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: 'Contact__LeadSourceCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '1',
label: 'Default Value',
text: 'Default Value',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
]
},
{
srfkey: 'Account__AccountCategoryCode',
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: '1',
label: 'Preferred Customer',
text: 'Preferred Customer',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
},
{
id: '2',
label: 'Standard',
text: 'Standard',
"data":"",
"codename":"Item_2",
value: '2',
disabled: false,
},
]
},
{
srfkey: 'Product__ProductTypeCode',
emptytext: '未定义',
......
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="accountinnerpickupview" viewTitle="客户数据选择视图" class='depickupview account-inner-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import AccountService from '@/service/account/account-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class AccountInnerPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountInnerPickupViewBase
*/
public appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AccountInnerPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AccountInnerPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AccountInnerPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AccountInnerPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AccountInnerPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof AccountInnerPickupViewBase
*/
public viewtag: string = '054fb10ed157549dc619f06af1c21a31';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public model: any = {
srfCaption: 'entities.account.views.innerpickupview.caption',
srfTitle: 'entities.account.views.innerpickupview.title',
srfSubTitle: 'entities.account.views.innerpickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountInnerPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountInnerPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof AccountInnerPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AccountInnerPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountInnerPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountInnerPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AccountInnerPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof AccountInnerPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof AccountInnerPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AccountInnerPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof AccountInnerPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AccountInnerPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof AccountInnerPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AccountInnerPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AccountInnerPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountInnerPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountInnerPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountInnerPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AccountInnerPickupViewBase
*/
public 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 AccountInnerPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AccountInnerPickupViewBase
*/
public 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 {string}
* @memberof AccountInnerPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof AccountInnerPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof AccountInnerPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof AccountInnerPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof AccountInnerPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof AccountInnerPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './account-inner-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.account-inner-pickup-view {
--account-inner-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="accountpickupview" viewTitle="客户数据选择视图" class='depickupview account-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import AccountService from '@/service/account/account-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class AccountPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountPickupViewBase
*/
public appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AccountPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AccountPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AccountPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AccountPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AccountPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof AccountPickupViewBase
*/
public viewtag: string = '29bfcd628ab25e297248ff0524d12908';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public model: any = {
srfCaption: 'entities.account.views.pickupview.caption',
srfTitle: 'entities.account.views.pickupview.title',
srfSubTitle: 'entities.account.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AccountPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof AccountPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AccountPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AccountPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof AccountPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof AccountPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AccountPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof AccountPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AccountPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof AccountPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AccountPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AccountPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AccountPickupViewBase
*/
public 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 AccountPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AccountPickupViewBase
*/
public 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 {string}
* @memberof AccountPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof AccountPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof AccountPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof AccountPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof AccountPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof AccountPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './account-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.account-pickup-view {
--account-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="contactpickupview" viewTitle="联系人数据选择视图" class='depickupview contact-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import ContactService from '@/service/contact/contact-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class ContactPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {ContactService}
* @memberof ContactPickupViewBase
*/
public appEntityService: ContactService = new ContactService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof ContactPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof ContactPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof ContactPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof ContactPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof ContactPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof ContactPickupViewBase
*/
public viewtag: string = 'b6b6215e439e78cdf6959b6f45bd7927';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public model: any = {
srfCaption: 'entities.contact.views.pickupview.caption',
srfTitle: 'entities.contact.views.pickupview.title',
srfSubTitle: 'entities.contact.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ContactPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ContactPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof ContactPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof ContactPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ContactPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof ContactPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'contact',
majorPSDEField: 'fullname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof ContactPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof ContactPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof ContactPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof ContactPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof ContactPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ContactPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof ContactPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ContactPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ContactPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ContactPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ContactPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ContactPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof ContactPickupViewBase
*/
public 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 ContactPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ContactPickupViewBase
*/
public 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 {string}
* @memberof ContactPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof ContactPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof ContactPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof ContactPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof ContactPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof ContactPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './contact-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.contact-pickup-view {
--contact-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="transactioncurrencypickupview" viewTitle="货币数据选择视图" class='depickupview transaction-currency-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import TransactionCurrencyService from '@/service/transaction-currency/transaction-currency-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class TransactionCurrencyPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {TransactionCurrencyService}
* @memberof TransactionCurrencyPickupViewBase
*/
public appEntityService: TransactionCurrencyService = new TransactionCurrencyService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof TransactionCurrencyPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof TransactionCurrencyPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof TransactionCurrencyPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof TransactionCurrencyPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof TransactionCurrencyPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof TransactionCurrencyPickupViewBase
*/
public viewtag: string = 'da3f8c1f20f440f3df54d6c13a8de586';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public model: any = {
srfCaption: 'entities.transactioncurrency.views.pickupview.caption',
srfTitle: 'entities.transactioncurrency.views.pickupview.title',
srfSubTitle: 'entities.transactioncurrency.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof TransactionCurrencyPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof TransactionCurrencyPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof TransactionCurrencyPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof TransactionCurrencyPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof TransactionCurrencyPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof TransactionCurrencyPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'transactioncurrency',
majorPSDEField: 'currencyname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof TransactionCurrencyPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof TransactionCurrencyPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof TransactionCurrencyPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof TransactionCurrencyPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof TransactionCurrencyPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof TransactionCurrencyPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof TransactionCurrencyPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof TransactionCurrencyPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof TransactionCurrencyPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TransactionCurrencyPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TransactionCurrencyPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TransactionCurrencyPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof TransactionCurrencyPickupViewBase
*/
public 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 TransactionCurrencyPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof TransactionCurrencyPickupViewBase
*/
public 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 {string}
* @memberof TransactionCurrencyPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof TransactionCurrencyPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof TransactionCurrencyPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof TransactionCurrencyPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof TransactionCurrencyPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof TransactionCurrencyPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './transaction-currency-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.transaction-currency-pickup-view {
--transaction-currency-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="pricelevelpickupview" viewTitle="价目表数据选择视图" class='depickupview price-level-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import PriceLevelService from '@/service/price-level/price-level-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class PriceLevelPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {PriceLevelService}
* @memberof PriceLevelPickupViewBase
*/
public appEntityService: PriceLevelService = new PriceLevelService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof PriceLevelPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof PriceLevelPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof PriceLevelPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof PriceLevelPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof PriceLevelPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof PriceLevelPickupViewBase
*/
public viewtag: string = '8b806fb12589b2fc17d1bb90f4b5422e';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public model: any = {
srfCaption: 'entities.pricelevel.views.pickupview.caption',
srfTitle: 'entities.pricelevel.views.pickupview.title',
srfSubTitle: 'entities.pricelevel.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof PriceLevelPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof PriceLevelPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof PriceLevelPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof PriceLevelPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof PriceLevelPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof PriceLevelPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'pricelevel',
majorPSDEField: 'pricelevelname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof PriceLevelPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof PriceLevelPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof PriceLevelPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof PriceLevelPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof PriceLevelPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PriceLevelPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof PriceLevelPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof PriceLevelPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof PriceLevelPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof PriceLevelPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof PriceLevelPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof PriceLevelPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof PriceLevelPickupViewBase
*/
public 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 PriceLevelPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PriceLevelPickupViewBase
*/
public 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 {string}
* @memberof PriceLevelPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof PriceLevelPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof PriceLevelPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof PriceLevelPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof PriceLevelPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof PriceLevelPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './price-level-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.price-level-pickup-view {
--price-level-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode("VIEW.vue").code} [in template "TEMPLCODE_zh_CN" at line 2, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.vue]
\ No newline at end of file
<template>
<studio-view-style2 viewName="leadpickupview" viewTitle="潜在顾客数据选择视图" class='depickupview lead-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import LeadService from '@/service/lead/lead-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
@Component({
components: {
},
})
export default class LeadPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {LeadService}
* @memberof LeadPickupViewBase
*/
public appEntityService: LeadService = new LeadService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof LeadPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof LeadPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof LeadPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof LeadPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof LeadPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof LeadPickupViewBase
*/
public viewtag: string = '1bc48b15dbe69c5f30dafe489f58aacb';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public model: any = {
srfCaption: 'entities.lead.views.pickupview.caption',
srfTitle: 'entities.lead.views.pickupview.title',
srfSubTitle: 'entities.lead.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof LeadPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof LeadPickupViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 计数器刷新
*
* @memberof LeadPickupViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof LeadPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof LeadPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof LeadPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'lead',
majorPSDEField: 'fullname',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof LeadPickupViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof LeadPickupViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
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.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof LeadPickupViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof LeadPickupViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof LeadPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof LeadPickupViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof LeadPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof LeadPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof LeadPickupViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof LeadPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof LeadPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof LeadPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof LeadPickupViewBase
*/
public 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 LeadPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof LeadPickupViewBase
*/
public 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 {string}
* @memberof LeadPickupView
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof LeadPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof LeadPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof LeadPickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof LeadPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof LeadPickupViewBase
*/
public onClickCancel(): void {
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './lead-pickup-view.less';
</style>
\ No newline at end of file
!!!!模版产生代码错误:----
FTL stack trace ("~" means nesting-related):
- Failed at: ${P.getLayoutCode().code} [in template "TEMPLCODE_zh_CN" at line 1, column 1]
----
无法获取指定部件[VIEWLAYOUTPANEL#APPDEPICKUPVIEW_STYLE2]发布代码[VIEW.less]
\ No newline at end of file
// 避免空文件,后台不让空文件过
.lead-pickup-view {
--lead-pickup-view: 0;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
......@@ -4,6 +4,84 @@
<row>
<i-col span="20" class="form-content">
<row>
<i-col v-show="detailsModel.n_accountname_like.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_accountname_like' :itemRules="this.rules.n_accountname_like" class='' :caption="$t('entities.account.default_searchform.details.n_accountname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_accountname_like.error" :isEmptyCaption="false" labelPos="TOP">
<input-box v-model="data.n_accountname_like" @enter="onEnter($event)" :disabled="detailsModel.n_accountname_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_statecode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_statecode_eq' :itemRules="this.rules.n_statecode_eq" class='' :caption="$t('entities.account.default_searchform.details.n_statecode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_statecode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_statecode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_statecode_eq.disabled"
tag='State'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_accountcategorycode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_accountcategorycode_eq' :itemRules="this.rules.n_accountcategorycode_eq" class='' :caption="$t('entities.account.default_searchform.details.n_accountcategorycode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_accountcategorycode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_accountcategorycode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_accountcategorycode_eq.disabled"
tag='Account__AccountCategoryCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_accountclassificationcode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_accountclassificationcode_eq' :itemRules="this.rules.n_accountclassificationcode_eq" class='' :caption="$t('entities.account.default_searchform.details.n_accountclassificationcode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_accountclassificationcode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_accountclassificationcode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_accountclassificationcode_eq.disabled"
tag='Account__AccountClassificationCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_accountratingcode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_accountratingcode_eq' :itemRules="this.rules.n_accountratingcode_eq" class='' :caption="$t('entities.account.default_searchform.details.n_accountratingcode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_accountratingcode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_accountratingcode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_accountratingcode_eq.disabled"
tag='Account__AccountRatingCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
</row>
</i-col>
<i-col span="4" class="search-button">
......@@ -244,6 +322,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public data: any = {
n_accountname_like: null,
n_statecode_eq: null,
n_accountcategorycode_eq: null,
n_accountclassificationcode_eq: null,
n_accountratingcode_eq: null,
};
/**
......@@ -253,6 +336,36 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public rules: any = {
n_accountname_like: [
{ type: 'string', message: '客户名称(文本包含(%)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户名称(文本包含(%)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户名称(文本包含(%)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户名称(文本包含(%)) 值不能为空', trigger: 'blur' },
],
n_statecode_eq: [
{ type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'change' },
{ type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'blur' },
{ required: false, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'blur' },
],
n_accountcategorycode_eq: [
{ type: 'string', message: '类别(等于(=)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '类别(等于(=)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '类别(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '类别(等于(=)) 值不能为空', trigger: 'blur' },
],
n_accountclassificationcode_eq: [
{ type: 'string', message: '分类(等于(=)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '分类(等于(=)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '分类(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '分类(等于(=)) 值不能为空', trigger: 'blur' },
],
n_accountratingcode_eq: [
{ type: 'string', message: '客户等级(等于(=)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '客户等级(等于(=)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '客户等级(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '客户等级(等于(=)) 值不能为空', trigger: 'blur' },
],
}
/**
......@@ -263,9 +376,79 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
n_accountname_like: new FormItemModel({ caption: '客户名称(文本包含(%))', detailType: 'FORMITEM', name: 'n_accountname_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_statecode_eq: new FormItemModel({ caption: '状态(等于(=))', detailType: 'FORMITEM', name: 'n_statecode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_accountcategorycode_eq: new FormItemModel({ caption: '类别(等于(=))', detailType: 'FORMITEM', name: 'n_accountcategorycode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_accountclassificationcode_eq: new FormItemModel({ caption: '分类(等于(=))', detailType: 'FORMITEM', name: 'n_accountclassificationcode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_accountratingcode_eq: new FormItemModel({ caption: '客户等级(等于(=))', detailType: 'FORMITEM', name: 'n_accountratingcode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
};
/**
* 监控表单属性 n_accountname_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_accountname_like')
onN_accountname_likeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_accountname_like', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_statecode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_statecode_eq')
onN_statecode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_statecode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_accountcategorycode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_accountcategorycode_eq')
onN_accountcategorycode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_accountcategorycode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_accountclassificationcode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_accountclassificationcode_eq')
onN_accountclassificationcode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_accountclassificationcode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_accountratingcode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_accountratingcode_eq')
onN_accountratingcode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_accountratingcode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
......@@ -287,6 +470,11 @@ export default class DefaultBase extends Vue implements ControlInterface {
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
......
......@@ -25,6 +25,31 @@ export default class DefaultModel {
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_accountname_like',
prop: 'accountname',
dataType: 'TEXT',
},
{
name: 'n_statecode_eq',
prop: 'statecode',
dataType: 'NSCODELIST',
},
{
name: 'n_accountcategorycode_eq',
prop: 'accountcategorycode',
dataType: 'SSCODELIST',
},
{
name: 'n_accountclassificationcode_eq',
prop: 'accountclassificationcode',
dataType: 'SSCODELIST',
},
{
name: 'n_accountratingcode_eq',
prop: 'accountratingcode',
dataType: 'SSCODELIST',
},
]
}
......
......@@ -100,6 +100,31 @@ export default class InnerPickipModel {
name: 'account',
prop: 'accountid',
},
{
name: 'n_accountname_like',
prop: 'n_accountname_like',
dataType: 'TEXT',
},
{
name: 'n_statecode_eq',
prop: 'n_statecode_eq',
dataType: 'NSCODELIST',
},
{
name: 'n_accountcategorycode_eq',
prop: 'n_accountcategorycode_eq',
dataType: 'SSCODELIST',
},
{
name: 'n_accountclassificationcode_eq',
prop: 'n_accountclassificationcode_eq',
dataType: 'SSCODELIST',
},
{
name: 'n_accountratingcode_eq',
prop: 'n_accountratingcode_eq',
dataType: 'SSCODELIST',
},
{
name:'size',
......
......@@ -115,6 +115,31 @@ export default class MainModel {
name: 'account',
prop: 'accountid',
},
{
name: 'n_accountname_like',
prop: 'n_accountname_like',
dataType: 'TEXT',
},
{
name: 'n_statecode_eq',
prop: 'n_statecode_eq',
dataType: 'NSCODELIST',
},
{
name: 'n_accountcategorycode_eq',
prop: 'n_accountcategorycode_eq',
dataType: 'SSCODELIST',
},
{
name: 'n_accountclassificationcode_eq',
prop: 'n_accountclassificationcode_eq',
dataType: 'SSCODELIST',
},
{
name: 'n_accountratingcode_eq',
prop: 'n_accountratingcode_eq',
dataType: 'SSCODELIST',
},
{
name:'size',
......
......@@ -4,6 +4,48 @@
<row>
<i-col span="20" class="form-content">
<row>
<i-col v-show="detailsModel.n_fullname_like.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_fullname_like' :itemRules="this.rules.n_fullname_like" class='' :caption="$t('entities.contact.default_searchform.details.n_fullname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_fullname_like.error" :isEmptyCaption="false" labelPos="TOP">
<input-box v-model="data.n_fullname_like" @enter="onEnter($event)" :disabled="detailsModel.n_fullname_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_statecode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_statecode_eq' :itemRules="this.rules.n_statecode_eq" class='' :caption="$t('entities.contact.default_searchform.details.n_statecode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_statecode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_statecode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_statecode_eq.disabled"
tag='State'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_leadsourcecode_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_leadsourcecode_eq' :itemRules="this.rules.n_leadsourcecode_eq" class='' :caption="$t('entities.contact.default_searchform.details.n_leadsourcecode_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_leadsourcecode_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_leadsourcecode_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_leadsourcecode_eq.disabled"
tag='Contact__LeadSourceCode'
codelistType='STATIC'
placeholder='请选择...' style="">
</dropdown-list>
</app-form-item>
</i-col>
</row>
</i-col>
<i-col span="4" class="search-button">
......@@ -244,6 +286,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public data: any = {
n_fullname_like: null,
n_statecode_eq: null,
n_leadsourcecode_eq: null,
};
/**
......@@ -253,6 +298,24 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public rules: any = {
n_fullname_like: [
{ type: 'string', message: '全名(文本包含(%)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '全名(文本包含(%)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '全名(文本包含(%)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '全名(文本包含(%)) 值不能为空', trigger: 'blur' },
],
n_statecode_eq: [
{ type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'change' },
{ type: 'number', message: '状态(等于(=)) 值必须为数值类型', trigger: 'blur' },
{ required: false, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'number', message: '状态(等于(=)) 值不能为空', trigger: 'blur' },
],
n_leadsourcecode_eq: [
{ type: 'string', message: '潜在顾客来源(等于(=)) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '潜在顾客来源(等于(=)) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '潜在顾客来源(等于(=)) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '潜在顾客来源(等于(=)) 值不能为空', trigger: 'blur' },
],
}
/**
......@@ -263,9 +326,51 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
n_fullname_like: new FormItemModel({ caption: '全名(文本包含(%))', detailType: 'FORMITEM', name: 'n_fullname_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_statecode_eq: new FormItemModel({ caption: '状态(等于(=))', detailType: 'FORMITEM', name: 'n_statecode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_leadsourcecode_eq: new FormItemModel({ caption: '潜在顾客来源(等于(=))', detailType: 'FORMITEM', name: 'n_leadsourcecode_eq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
};
/**
* 监控表单属性 n_fullname_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_fullname_like')
onN_fullname_likeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_fullname_like', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_statecode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_statecode_eq')
onN_statecode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_statecode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_leadsourcecode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_leadsourcecode_eq')
onN_leadsourcecode_eqChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_leadsourcecode_eq', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
......@@ -287,6 +392,9 @@ export default class DefaultBase extends Vue implements ControlInterface {
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
/**
......
......@@ -25,6 +25,21 @@ export default class DefaultModel {
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_fullname_like',
prop: 'fullname',
dataType: 'TEXT',
},
{
name: 'n_statecode_eq',
prop: 'statecode',
dataType: 'NSCODELIST',
},
{
name: 'n_leadsourcecode_eq',
prop: 'leadsourcecode',
dataType: 'SSCODELIST',
},
]
}
......
......@@ -95,6 +95,21 @@ export default class MainModel {
name: 'contact',
prop: 'contactid',
},
{
name: 'n_fullname_like',
prop: 'n_fullname_like',
dataType: 'TEXT',
},
{
name: 'n_statecode_eq',
prop: 'n_statecode_eq',
dataType: 'NSCODELIST',
},
{
name: 'n_leadsourcecode_eq',
prop: 'n_leadsourcecode_eq',
dataType: 'SSCODELIST',
},
{
name:'size',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册