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

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

上级 0ae30e42
......@@ -879,6 +879,14 @@
"viewname": "IBIZSample0017F20EditView",
"viewtag": "9147f210be1f0751245496a40be86fad"
},
"ibizcustomerusr2mpickupview": {
"title": "客户实体数据多项选择视图(树视图)",
"caption": "客户",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZCustomerUsr2MPickupView",
"viewtag": "91b325a01c9c24c60d42df9701221c2f"
},
"ibizorderusr2calendarexpview": {
"title": "订单日历导航视图(时间轴)",
"caption": "订单",
......@@ -1071,6 +1079,14 @@
"viewname": "IBIZOrderF10EditView",
"viewtag": "ad37d44e57c18e4431a609968203c646"
},
"ibizcustomerusr2pickupview": {
"title": "客户实体数据选择视图(树视图)",
"caption": "客户",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZCustomerUsr2PickupView",
"viewtag": "af3f8f6f28bc9acbc7affccdcd1bdfb6"
},
"ibizbooklistview": {
"title": "图书列表视图(内置功能)",
"caption": "图书",
......
......@@ -381,11 +381,14 @@ export default {
srfdeid: "",
srfsourcekey: "",
ibizbookid: "图书标识",
author: "图书作者",
formitem: "表格选择视图",
formitem1: "数据选择视图",
formitem2: "多选数据选择",
borrower: "借阅人",
borrower: "树单项数据选择",
borrower1: "树多项数据选择",
borrower2: "表格单项数据选择",
borrower3: "表格多项数据选择",
borrower1_id: "借阅人1_ID",
borrower2_id: "借阅人2_ID",
borrower3_id: "借阅人3_ID",
borrowerid: "借阅人ID",
},
uiactions: {
},
......
......@@ -380,11 +380,14 @@ export default {
srfdeid: "",
srfsourcekey: "",
ibizbookid: "图书标识",
author: "图书作者",
formitem: "表格选择视图",
formitem1: "数据选择视图",
formitem2: "多选数据选择",
borrower: "借阅人",
borrower: "树单项数据选择",
borrower1: "树多项数据选择",
borrower2: "表格单项数据选择",
borrower3: "表格多项数据选择",
borrower1_id: "借阅人1_ID",
borrower2_id: "借阅人2_ID",
borrower3_id: "借阅人3_ID",
borrowerid: "借阅人ID",
},
uiactions: {
},
......
......@@ -28,6 +28,14 @@ export default {
caption: "客户",
title: "客户编辑视图",
},
usr2mpickupview: {
caption: "客户",
title: "客户实体数据多项选择视图(树视图)",
},
usr2pickupview: {
caption: "客户",
title: "客户实体数据选择视图(树视图)",
},
usr2editview: {
caption: "客户",
title: "客户编辑视图",
......
......@@ -27,6 +27,14 @@ export default {
caption: "客户",
title: "客户编辑视图",
},
usr2mpickupview: {
caption: "客户",
title: "客户实体数据多项选择视图(树视图)",
},
usr2pickupview: {
caption: "客户",
title: "客户实体数据选择视图(树视图)",
},
usr2editview: {
caption: "客户",
title: "客户编辑视图",
......
......@@ -887,6 +887,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBIZSample0017F20EditView",
"viewtag": "9147f210be1f0751245496a40be86fad"
},
"ibizcustomerusr2mpickupview": {
"title": "客户实体数据多项选择视图(树视图)",
"caption": "客户",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZCustomerUsr2MPickupView",
"viewtag": "91b325a01c9c24c60d42df9701221c2f"
},
"ibizorderusr2calendarexpview": {
"title": "订单日历导航视图(时间轴)",
"caption": "订单",
......@@ -1079,6 +1087,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBIZOrderF10EditView",
"viewtag": "ad37d44e57c18e4431a609968203c646"
},
"ibizcustomerusr2pickupview": {
"title": "客户实体数据选择视图(树视图)",
"caption": "客户",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZCustomerUsr2PickupView",
"viewtag": "af3f8f6f28bc9acbc7affccdcd1bdfb6"
},
"ibizbooklistview": {
"title": "图书列表视图(内置功能)",
"caption": "图书",
......
<template>
<div class="view-container dempickupview ibizcustomer-usr2-mpickup-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizcustomerusr2mpickupview"></app-studioaction>
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :padding="0" :bordered="false">
<div class='view-top-messages'>
</div>
<div class="content-container pickup-view">
<div class='view-body-messages'>
</div>
<div class="translate-contant">
<div class="center" :style="{width : !isShowButton ? '100%' : ''}">
<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>
</div>
<div v-if="isShowButton" class="translate-buttons">
<div class="buttons">
<i-button type="primary" :title="this.containerModel.view_rightbtn.text"
:disabled="this.containerModel.view_rightbtn.disabled"
@click="onCLickRight">
<i class="el-icon-arrow-right"></i>
</i-button>
<i-button type="primary" :title="this.containerModel.view_leftbtn.text"
:disabled="this.containerModel.view_leftbtn.disabled"
@click="onCLickLeft">
<i class="el-icon-arrow-left"></i>
</i-button>
<i-button type="primary" :title="this.containerModel.view_allrightbtn.text"
@click="onCLickAllRight">
<i class="el-icon-d-arrow-right"></i>
</i-button>
<i-button type="primary" :title="this.containerModel.view_allleftbtn.text"
@click="onCLickAllLeft">
<i class="el-icon-d-arrow-left"></i>
</i-button>
</div>
</div>
<div v-if="isShowButton" class="right">
<div class="mpicker-select">
<div v-for="(item, index) in viewSelections" :key="index" :class="item._select ? 'select' : ''" @click="selectionsClick(item)" @dblclick="selectionsDBLClick(item)">
<span>{{item.srfmajortext}}</span>
</div>
</div>
</div>
</div>
<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>
<div class='view-bottom-messages'>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import IBIZCustomerService from '@/service/ibizcustomer/ibizcustomer-service';
import IBIZCustomerAuthService from '@/authservice/ibizcustomer/ibizcustomer-auth-service';
import MPickupViewEngine from '@engine/view/mpickup-view-engine';
import IBIZCustomerUIService from '@/uiservice/ibizcustomer/ibizcustomer-ui-service';
@Component({
components: {
},
})
export default class IBIZCustomerUsr2MPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZCustomerService}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public appEntityService: IBIZCustomerService = new IBIZCustomerService;
/**
* 实体UI服务对象
*
* @type IBIZCustomerUIService
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public appUIService: IBIZCustomerUIService = new IBIZCustomerUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public viewtag: string = '91b325a01c9c24c60d42df9701221c2f';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public model: any = {
srfCaption: 'entities.ibizcustomer.views.usr2mpickupview.caption',
srfTitle: 'entities.ibizcustomer.views.usr2mpickupview.title',
srfSubTitle: 'entities.ibizcustomer.views.usr2mpickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
this.viewparams = {};
if(typeof newVal == 'string') {
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}else{
this.viewparams = Util.deepCopy(this.viewparam);
}
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
this.viewSelections = this.viewparams.selectedData;
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@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();
});
} else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) {
_this.refresh();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
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 IBIZCustomerUsr2MPickupViewBase
*/
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 IBIZCustomerUsr2MPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public engine: MPickupViewEngine = new MPickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'ibizcustomer',
majorPSDEField: 'ibizcustomername',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
if(typeof this.viewdata == 'string') {
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});
}
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(inputvalue){
Object.assign(this.context,{'ibizcustomer':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
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 IBIZCustomerUsr2MPickupViewBase
*/
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()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()] != null){
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
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizcustomer-usr2-mpickup-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizcustomer,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizcustomer-usr2-mpickup-view',tag:this.viewtag,srfkey:this.context.ibizcustomer,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public afterCreated(){
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'ibizcustomer-usr2-mpickup-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
if(_this.portletState){
_this.portletStateEvent = _this.portletState.subscribe((res:any) =>{
if(!Object.is(res.name,'IBIZCustomerUsr2MPickupView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
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);
this.onCLickRight();
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
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 IBIZCustomerUsr2MPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
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);
}
})
}
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
}
// 销毁计数器定时器
if(this.counterServiceArray && this.counterServiceArray.length >0){
this.counterServiceArray.forEach((item:any) =>{
if(item.destroyCounter && item.destroyCounter instanceof Function){
item.destroyCounter();
}
})
}
if(this.portletStateEvent){
this.portletStateEvent.unsubscribe();
}
}
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 选中数据的字符串
*
* @type {string}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public selectedData: string = "";
/**
* 是否初始化已选中项
*
* @type {any[]}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public isInitSelected:boolean = false;
/**
* 视图选中数据
*
* @type {any[]}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否单选
*
* @type {boolean}
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public isSingleSelect: boolean = false;
/**
* 选中数据单击
*
* @param {*} item
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public selectionsClick(item:any):void {
item._select = !item._select;
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
}
/**
* 选中树双击
*
* @param {*} item
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public selectionsDBLClick(item:any):void {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(selection.srfkey, item.srfkey));
if (index !== -1) {
this.viewSelections.splice(index, 1);
}
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 删除右侧全部选中数据
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onCLickLeft():void {
const _selectiions = [...JSON.parse(JSON.stringify(this.viewSelections))];
_selectiions.forEach((item: any) => {
if (!item._select) {
return;
}
const index = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index !== -1) {
this.viewSelections.splice(index, 1);
}
});
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 添加左侧选中数据
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onCLickRight():void {
Object.values(this.containerModel).forEach((model: any) => {
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return;
}
let newSelections:any[] = [];
model.selections.forEach((item: any) => {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index === -1) {
let _item: any = { ...JSON.parse(JSON.stringify(item)) };
Object.assign(_item, { _select: false })
newSelections.push(_item);
}else{
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
}
/**
* 去重
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
* 选中数据全部删除
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onCLickAllLeft():void {
this.viewSelections = [];
this.containerModel.view_leftbtn.disabled = true;
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', []);
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 添加左侧面板所有数据到右侧
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onCLickAllRight():void {
Object.values(this.containerModel).forEach((model: any) => {
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return;
}
if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['ibizcustomername']});
})
}
model.datas.forEach((item: any) => {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index === -1) {
let _item: any = { ...JSON.parse(JSON.stringify(item)) };
Object.assign(_item, { _select: false })
this.viewSelections.push(_item);
}
});
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 确定
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof IBIZCustomerUsr2MPickupViewBase
*/
public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './ibizcustomer-usr2-mpickup-view.less';
</style>
\ No newline at end of file
.ibizcustomer-usr2-mpickup-view{
position: relative;
}
.pickup-view {
>.translate-contant {
overflow: auto;
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
.translate-buttons {
width: 80px;
display: flex;
align-items: center;
text-align: center;
button {
margin-bottom: 5px;
}
}
.left, .right {
width: 300px;
}
.right {
border: 1px solid #e9e9e9;
.mpicker-select {
font-family: helvetica, sans-serif;
font-size: 16px;
text-align: justify;
word-spacing: -3.8pt;
line-height: 1.6;
font-weight: bold;
word-spacing: 10px;
height: 100%;
overflow: auto;
}
.mpicker-select > div {
padding: 3px 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
font-weight: initial;
cursor: pointer;
min-height: 28px;
border: 1px solid #e9e9e9;
margin: 4px 4px;
transition: all .3s;
}
.mpicker-select > div:hover {
background: #ecf6fd;
}
.mpicker-select > .select{
color: #108ee9;
background: #ecf6fd;
}
}
.center{
width: calc(100% - 380px);
.pickupviewpanel {
width: 100%;
height: 100%;
}
}
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZCustomerUsr2MPickupViewBase from './ibizcustomer-usr2-mpickup-view-base.vue';
import view_pickupviewpanel from '@widgets/ibizcustomer/usr2-mpickup-viewpickupviewpanel-pickupviewpanel/usr2-mpickup-viewpickupviewpanel-pickupviewpanel.vue';
@Component({
components: {
view_pickupviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class IBIZCustomerUsr2MPickupView extends IBIZCustomerUsr2MPickupViewBase {
}
</script>
\ No newline at end of file
<template>
<div class="view-container depickupview ibizcustomer-usr2-pickup-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizcustomerusr2pickupview"></app-studioaction>
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :padding="0" :bordered="false">
<div class='view-top-messages'>
</div>
<div class="content-container pickup-view">
<div class='view-body-messages'>
</div>
<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>
<div class='view-bottom-messages'>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import IBIZCustomerService from '@/service/ibizcustomer/ibizcustomer-service';
import IBIZCustomerAuthService from '@/authservice/ibizcustomer/ibizcustomer-auth-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
import IBIZCustomerUIService from '@/uiservice/ibizcustomer/ibizcustomer-ui-service';
@Component({
components: {
},
})
export default class IBIZCustomerUsr2PickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZCustomerService}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public appEntityService: IBIZCustomerService = new IBIZCustomerService;
/**
* 实体UI服务对象
*
* @type IBIZCustomerUIService
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public appUIService: IBIZCustomerUIService = new IBIZCustomerUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public viewtag: string = 'af3f8f6f28bc9acbc7affccdcd1bdfb6';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public model: any = {
srfCaption: 'entities.ibizcustomer.views.usr2pickupview.caption',
srfTitle: 'entities.ibizcustomer.views.usr2pickupview.title',
srfSubTitle: 'entities.ibizcustomer.views.usr2pickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
this.viewparams = {};
if(typeof newVal == 'string') {
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}else{
this.viewparams = Util.deepCopy(this.viewparam);
}
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@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();
});
} else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) {
_this.refresh();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
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 IBIZCustomerUsr2PickupViewBase
*/
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 IBIZCustomerUsr2PickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'ibizcustomer',
majorPSDEField: 'ibizcustomername',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
if(typeof this.viewdata == 'string') {
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});
}
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(inputvalue){
Object.assign(this.context,{'ibizcustomer':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
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 IBIZCustomerUsr2PickupViewBase
*/
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()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()] != null){
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
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizcustomer-usr2-pickup-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizcustomer,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizcustomer-usr2-pickup-view',tag:this.viewtag,srfkey:this.context.ibizcustomer,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public afterCreated(){
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'ibizcustomer-usr2-pickup-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
if(_this.portletState){
_this.portletStateEvent = _this.portletState.subscribe((res:any) =>{
if(!Object.is(res.name,'IBIZCustomerUsr2PickupView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
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 IBIZCustomerUsr2PickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZCustomerUsr2PickupViewBase
*/
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 IBIZCustomerUsr2PickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
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);
}
})
}
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
}
// 销毁计数器定时器
if(this.counterServiceArray && this.counterServiceArray.length >0){
this.counterServiceArray.forEach((item:any) =>{
if(item.destroyCounter && item.destroyCounter instanceof Function){
item.destroyCounter();
}
})
}
if(this.portletStateEvent){
this.portletStateEvent.unsubscribe();
}
}
/**
* 选中数据的字符串
*
* @type {string}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public selectedData: string = "";
/**
* 视图选中数据
*
* @type {any[]}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public isSingleSelect: boolean = true;
/**
* 确定
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof IBIZCustomerUsr2PickupViewBase
*/
public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './ibizcustomer-usr2-pickup-view.less';
</style>
\ No newline at end of file
.ibizcustomer-usr2-pickup-view{
position: relative;
}
.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
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZCustomerUsr2PickupViewBase from './ibizcustomer-usr2-pickup-view-base.vue';
import view_pickupviewpanel from '@widgets/ibizcustomer/usr2-pickup-viewpickupviewpanel-pickupviewpanel/usr2-pickup-viewpickupviewpanel-pickupviewpanel.vue';
@Component({
components: {
view_pickupviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class IBIZCustomerUsr2PickupView extends IBIZCustomerUsr2PickupViewBase {
}
</script>
\ No newline at end of file
......@@ -123,6 +123,7 @@ export const PageComponents = {
Vue.component('ibizbookusr2-data-view', () => import('@pages/sample/ibizbookusr2-data-view/ibizbookusr2-data-view.vue'));
Vue.component('ibizbooklist-view', () => import('@pages/sample/ibizbooklist-view/ibizbooklist-view.vue'));
Vue.component('ibizsample0017-form-pickup-view', () => import('@pages/sample/ibizsample0017-form-pickup-view/ibizsample0017-form-pickup-view.vue'));
Vue.component('ibizcustomer-usr2-pickup-view', () => import('@pages/sample/ibizcustomer-usr2-pickup-view/ibizcustomer-usr2-pickup-view.vue'));
Vue.component('ibizsample0002-grid-view', () => import('@pages/sample/ibizsample0002-grid-view/ibizsample0002-grid-view.vue'));
Vue.component('ibizcustomer-intfpickup-grid-view', () => import('@pages/sample/ibizcustomer-intfpickup-grid-view/ibizcustomer-intfpickup-grid-view.vue'));
Vue.component('ibizbookinter-func-kan-ban-view', () => import('@pages/sample/ibizbookinter-func-kan-ban-view/ibizbookinter-func-kan-ban-view.vue'));
......@@ -132,6 +133,7 @@ export const PageComponents = {
Vue.component('ibizhardware-index-pickup-view', () => import('@pages/sample/ibizhardware-index-pickup-view/ibizhardware-index-pickup-view.vue'));
Vue.component('ibizhardware-grid-view9', () => import('@pages/sample/ibizhardware-grid-view9/ibizhardware-grid-view9.vue'));
Vue.component('ibizorder-sf3-edit-view', () => import('@pages/sample/ibizorder-sf3-edit-view/ibizorder-sf3-edit-view.vue'));
Vue.component('ibizcustomer-usr2-mpickup-view', () => import('@pages/sample/ibizcustomer-usr2-mpickup-view/ibizcustomer-usr2-mpickup-view.vue'));
Vue.component('ibizorder-f13-edit-view', () => import('@pages/sample/ibizorder-f13-edit-view/ibizorder-f13-edit-view.vue'));
Vue.component('ibizcustomer-pickup-tree-view', () => import('@pages/sample/ibizcustomer-pickup-tree-view/ibizcustomer-pickup-tree-view.vue'));
Vue.component('ibizorder-detail-f6-edit-view', () => import('@pages/sample/ibizorder-detail-f6-edit-view/ibizorder-detail-f6-edit-view.vue'));
......
......@@ -1982,6 +1982,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0017-form-pickup-view/ibizsample0017-form-pickup-view.vue'),
},
{
path: 'ibizcustomers/:ibizcustomer?/usr2pickupview/:usr2pickupview?',
meta: {
caption: 'entities.ibizcustomer.views.usr2pickupview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' },
{ pathName: 'usr2pickupview', parameterName: 'usr2pickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizcustomer-usr2-pickup-view/ibizcustomer-usr2-pickup-view.vue'),
},
{
path: 'ibizsample0002s/:ibizsample0002?/gridview/:gridview?',
meta: {
......@@ -2108,6 +2122,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-sf3-edit-view/ibizorder-sf3-edit-view.vue'),
},
{
path: 'ibizcustomers/:ibizcustomer?/usr2mpickupview/:usr2mpickupview?',
meta: {
caption: 'entities.ibizcustomer.views.usr2mpickupview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' },
{ pathName: 'usr2mpickupview', parameterName: 'usr2mpickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizcustomer-usr2-mpickup-view/ibizcustomer-usr2-mpickup-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/f13editview/:f13editview?',
meta: {
......@@ -4187,6 +4215,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0017-f20-edit-view/ibizsample0017-f20-edit-view.vue'),
},
{
path: '/ibizcustomers/:ibizcustomer?/usr2mpickupview/:usr2mpickupview?',
meta: {
caption: 'entities.ibizcustomer.views.usr2mpickupview.caption',
info:'',
parameters: [
{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' },
{ pathName: 'usr2mpickupview', parameterName: 'usr2mpickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizcustomer-usr2-mpickup-view/ibizcustomer-usr2-mpickup-view.vue'),
},
{
path: '/ibizorders/:ibizorder?/usr2calendarexpview/:usr2calendarexpview?',
meta: {
......@@ -4473,6 +4514,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-f10-edit-view/ibizorder-f10-edit-view.vue'),
},
{
path: '/ibizcustomers/:ibizcustomer?/usr2pickupview/:usr2pickupview?',
meta: {
caption: 'entities.ibizcustomer.views.usr2pickupview.caption',
info:'',
parameters: [
{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' },
{ pathName: 'usr2pickupview', parameterName: 'usr2pickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizcustomer-usr2-pickup-view/ibizcustomer-usr2-pickup-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/listview/:listview?',
meta: {
......
......@@ -545,10 +545,10 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'91b325a01c9c24c60d42df9701221c2f',
'f7ce60a7707de1ef9f926b3f9d5d6954',
'2a63c4595d7b116f63e0960a2365bbfa',
'af3f8f6f28bc9acbc7affccdcd1bdfb6',
'81e92e837f6fa81fed5b6beaa75f6bbd',
'460fc1d5b6f2e2012b281df34d929f3b',
],
},
{
......@@ -1086,6 +1086,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '91b325a01c9c24c60d42df9701221c2f',
viewmodule: 'Sample',
viewname: 'IBIZCustomerUsr2MPickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'2a63c4595d7b116f63e0960a2365bbfa',
],
},
{
viewtag: '92cca69539c77ba96bfc384fc570bfa7',
viewmodule: 'Sample',
......@@ -1311,6 +1321,16 @@ export const viewstate: any = {
'8a4246bc438e47ec0f6f3516b9befc53',
],
},
{
viewtag: 'af3f8f6f28bc9acbc7affccdcd1bdfb6',
viewmodule: 'Sample',
viewname: 'IBIZCustomerUsr2PickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'2a63c4595d7b116f63e0960a2365bbfa',
],
},
{
viewtag: 'b038c48269316664e5b48380a879fd99',
viewmodule: 'Sample',
......
......@@ -100,6 +100,8 @@ export default class IBIZCustomerUIServiceBase extends UIService {
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'ibizcustomers',component:'ibizcustomer-pickup-grid-view'});
this.allViewMap.set('MPICKUPVIEW:',{viewname:'mpickupview',srfappde:'ibizcustomers',component:'ibizcustomer-mpickup-view'});
this.allViewMap.set(':',{viewname:'editview',srfappde:'ibizcustomers',component:'ibizcustomer-edit-view'});
this.allViewMap.set(':',{viewname:'usr2mpickupview',srfappde:'ibizcustomers',component:'ibizcustomer-usr2-mpickup-view'});
this.allViewMap.set(':',{viewname:'usr2pickupview',srfappde:'ibizcustomers',component:'ibizcustomer-usr2-pickup-view'});
this.allViewMap.set(':',{viewname:'usr2editview',srfappde:'ibizcustomers',component:'ibizcustomer-usr2-edit-view'});
this.allViewMap.set(':',{viewname:'usr2gridview',srfappde:'ibizcustomers',component:'ibizcustomer-usr2-grid-view'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'ibizcustomers',component:'ibizcustomer-pickup-view'});
......
......@@ -5,8 +5,8 @@
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group :uiService="appUIService" :data="transformData(data)" :manageContainerStatus="detailsModel.group1.manageContainerStatus" :isManageContainer="detailsModel.group1.isManageContainer" @managecontainerclick="manageContainerClick('group1')" layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibizbook.interfuncform_2_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.author.visible" :style="{}" :lg="{ span: 24, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='author' :itemRules="this.rules().author" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.author')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.author.error" :isEmptyCaption="false" labelPos="LEFT">
<i-col v-show="detailsModel.borrower.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='borrower' :itemRules="this.rules().borrower" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.borrower')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.borrower.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
......@@ -15,12 +15,12 @@
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.author.disabled"
name='author'
valueitem=''
:value="data.author"
:disabled="detailsModel.borrower.disabled"
name='borrower'
valueitem='borrowerid'
:value="data.borrower"
editortype="pickup-no-ac"
:pickupView="{ viewname: 'ibizcustomer-pickup-tree-view', title: $t('entities.ibizcustomer.views.pickuptreeview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'pickuptreeview', parameterName: 'pickuptreeview' } ], width: 500, height: 500, placement:'' }"
:pickupView="{ viewname: 'ibizcustomer-usr2-pickup-view', title: $t('entities.ibizcustomer.views.usr2pickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'usr2pickupview', parameterName: 'usr2pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
......@@ -28,31 +28,31 @@
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem.visible" :style="{}" :lg="{ span: 24, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='formitem' :itemRules="this.rules().formitem" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.formitem')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem.error" :isEmptyCaption="false" labelPos="LEFT">
<i-col v-show="detailsModel.borrower1.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='borrower1' :itemRules="this.rules().borrower1" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.borrower1')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.borrower1.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.formitem.disabled"
name='formitem'
valueitem='borrower'
:value="data.formitem"
editortype="pickup-no-ac"
:pickupView="{ viewname: 'ibizcustomer-pickup-grid-view', title: $t('entities.ibizcustomer.views.pickupgridview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'pickupgridview', parameterName: 'pickupgridview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
<app-mpicker
:activeData="data"
:disabled="detailsModel.borrower1.disabled"
:curvalue="data.borrower1"
name="borrower1"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:service="service"
valueitem=''
:acParams="{ }"
:pickupView="{ viewname: 'ibizcustomer-usr2-mpickup-view', title: $t('entities.ibizcustomer.views.usr2mpickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'usr2mpickupview', parameterName: 'usr2mpickupview' } ], placement:'' }"
@formitemvaluechange="onFormItemValueChange"
style="">
</app-mpicker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem1.visible" :style="{}" :lg="{ span: 24, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='formitem1' :itemRules="this.rules().formitem1" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.formitem1')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem1.error" :isEmptyCaption="false" labelPos="LEFT">
<i-col v-show="detailsModel.borrower2.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='borrower2' :itemRules="this.rules().borrower2" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.borrower2')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.borrower2.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
......@@ -61,10 +61,10 @@
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.formitem1.disabled"
name='formitem1'
valueitem='borrower'
:value="data.formitem1"
:disabled="detailsModel.borrower2.disabled"
name='borrower2'
valueitem='borrower2_id'
:value="data.borrower2"
editortype="pickup-no-ac"
:pickupView="{ viewname: 'ibizcustomer-pickup-view', title: $t('entities.ibizcustomer.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
......@@ -74,20 +74,20 @@
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem2.visible" :style="{}" :lg="{ span: 24, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='formitem2' :itemRules="this.rules().formitem2" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.formitem2')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem2.error" :isEmptyCaption="false" labelPos="LEFT">
<i-col v-show="detailsModel.borrower3.visible" :style="{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
<app-form-item name='borrower3' :itemRules="this.rules().borrower3" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.borrower3')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.borrower3.error" :isEmptyCaption="false" labelPos="LEFT">
<app-mpicker
:activeData="data"
:disabled="detailsModel.formitem2.disabled"
:curvalue="data.formitem2"
name="formitem2"
:disabled="detailsModel.borrower3.disabled"
:curvalue="data.borrower3"
name="borrower3"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:service="service"
valueitem='borrower'
valueitem=''
:acParams="{ }"
:pickupView="{ viewname: 'ibizcustomer-mpickup-view', title: $t('entities.ibizcustomer.views.mpickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizcustomers', parameterName: 'ibizcustomer' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
@formitemvaluechange="onFormItemValueChange"
......@@ -96,20 +96,6 @@
</app-form-item>
</i-col>
<i-col v-show="detailsModel.borrower.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='borrower' :itemRules="this.rules().borrower" class='' :caption="$t('entities.ibizbook.interfuncform_2_form.details.borrower')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.borrower.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box
v-model="data.borrower"
@enter="onEnter($event)"
unit=""
:disabled="detailsModel.borrower.disabled"
type='text'
style="">
</input-box>
</app-form-item>
</i-col>
</row>
......@@ -512,11 +498,14 @@ export default class InterFuncForm_2Base extends Vue implements ControlInterface
srfdeid: null,
srfsourcekey: null,
ibizbookid: null,
author: null,
formitem: null,
formitem1: null,
formitem2: null,
borrower: null,
borrower1: null,
borrower2: null,
borrower3: null,
borrower1_id: null,
borrower2_id: null,
borrower3_id: null,
borrowerid: null,
ibizbook:null,
};
......@@ -568,25 +557,21 @@ export default class InterFuncForm_2Base extends Vue implements ControlInterface
*/
public rules() :any {
return {
author: [
{ required: this.detailsModel.author.required, type: 'string', message: '图书作者 值不能为空', trigger: 'change' },
{ required: this.detailsModel.author.required, type: 'string', message: '图书作者 值不能为空', trigger: 'blur' },
],
formitem: [
{ required: this.detailsModel.formitem.required, type: 'string', message: '表格选择视图 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem.required, type: 'string', message: '表格选择视图 值不能为空', trigger: 'blur' },
borrower: [
{ required: this.detailsModel.borrower.required, type: 'string', message: '树单项数据选择 值不能为空', trigger: 'change' },
{ required: this.detailsModel.borrower.required, type: 'string', message: '树单项数据选择 值不能为空', trigger: 'blur' },
],
formitem1: [
{ required: this.detailsModel.formitem1.required, type: 'string', message: '数据选择视图 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem1.required, type: 'string', message: '数据选择视图 值不能为空', trigger: 'blur' },
borrower1: [
{ required: this.detailsModel.borrower1.required, type: 'string', message: '树多项数据选择 值不能为空', trigger: 'change' },
{ required: this.detailsModel.borrower1.required, type: 'string', message: '树多项数据选择 值不能为空', trigger: 'blur' },
],
formitem2: [
{ required: this.detailsModel.formitem2.required, type: 'string', message: '多选数据选择 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem2.required, type: 'string', message: '多选数据选择 值不能为空', trigger: 'blur' },
borrower2: [
{ required: this.detailsModel.borrower2.required, type: 'string', message: '表格单项数据选择 值不能为空', trigger: 'change' },
{ required: this.detailsModel.borrower2.required, type: 'string', message: '表格单项数据选择 值不能为空', trigger: 'blur' },
],
borrower: [
{ required: this.detailsModel.borrower.required, type: 'string', message: '借阅人 值不能为空', trigger: 'change' },
{ required: this.detailsModel.borrower.required, type: 'string', message: '借阅人 值不能为空', trigger: 'blur' },
borrower3: [
{ required: this.detailsModel.borrower3.required, type: 'string', message: '表格多项数据选择 值不能为空', trigger: 'change' },
{ required: this.detailsModel.borrower3.required, type: 'string', message: '表格多项数据选择 值不能为空', trigger: 'blur' },
],
}
}
......@@ -715,15 +700,21 @@ export default class InterFuncForm_2Base extends Vue implements ControlInterface
,
ibizbookid: new FormItemModel({ caption: '图书标识', detailType: 'FORMITEM', name: 'ibizbookid', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
author: new FormItemModel({ caption: '图书作者', detailType: 'FORMITEM', name: 'author', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
borrower: new FormItemModel({ caption: '树单项数据选择', detailType: 'FORMITEM', name: 'borrower', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
borrower1: new FormItemModel({ caption: '树多项数据选择', detailType: 'FORMITEM', name: 'borrower1', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
borrower2: new FormItemModel({ caption: '表格单项数据选择', detailType: 'FORMITEM', name: 'borrower2', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
borrower3: new FormItemModel({ caption: '表格多项数据选择', detailType: 'FORMITEM', name: 'borrower3', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
formitem: new FormItemModel({ caption: '表格选择视图', detailType: 'FORMITEM', name: 'formitem', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
borrower1_id: new FormItemModel({ caption: '借阅人1_ID', detailType: 'FORMITEM', name: 'borrower1_id', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
formitem1: new FormItemModel({ caption: '数据选择视图', detailType: 'FORMITEM', name: 'formitem1', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
borrower2_id: new FormItemModel({ caption: '借阅人2_ID', detailType: 'FORMITEM', name: 'borrower2_id', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
formitem2: new FormItemModel({ caption: '多选数据选择', detailType: 'FORMITEM', name: 'formitem2', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
borrower3_id: new FormItemModel({ caption: '借阅人3_ID', detailType: 'FORMITEM', name: 'borrower3_id', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
borrower: new FormItemModel({ caption: '借阅人', detailType: 'FORMITEM', name: 'borrower', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
borrowerid: new FormItemModel({ caption: '借阅人ID', detailType: 'FORMITEM', name: 'borrowerid', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
};
......@@ -836,63 +827,99 @@ export default class InterFuncForm_2Base extends Vue implements ControlInterface
}
/**
* 监控表单属性 author 值
* 监控表单属性 borrower 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.author')
onAuthorChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'author', newVal: newVal, oldVal: oldVal });
@Watch('data.borrower')
onBorrowerChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem
* 监控表单属性 borrower1
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.formitem')
onFormitemChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'formitem', newVal: newVal, oldVal: oldVal });
@Watch('data.borrower1')
onBorrower1Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower1', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem1
* 监控表单属性 borrower2
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.formitem1')
onFormitem1Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'formitem1', newVal: newVal, oldVal: oldVal });
@Watch('data.borrower2')
onBorrower2Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower2', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem2
* 监控表单属性 borrower3
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.formitem2')
onFormitem2Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'formitem2', newVal: newVal, oldVal: oldVal });
@Watch('data.borrower3')
onBorrower3Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower3', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 borrower 值
* 监控表单属性 borrower1_id
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.borrower')
onBorrowerChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower', newVal: newVal, oldVal: oldVal });
@Watch('data.borrower1_id')
onBorrower1_idChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower1_id', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 borrower2_id 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.borrower2_id')
onBorrower2_idChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower2_id', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 borrower3_id 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.borrower3_id')
onBorrower3_idChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrower3_id', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 borrowerid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof InterFuncForm_2Base
*/
@Watch('data.borrowerid')
onBorroweridChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'borrowerid', newVal: newVal, oldVal: oldVal });
}
......@@ -965,6 +992,9 @@ export default class InterFuncForm_2Base extends Vue implements ControlInterface
}
/**
......
......@@ -61,28 +61,43 @@ export default class InterFuncForm_2Model {
dataType: 'GUID',
},
{
name: 'author',
prop: 'author',
name: 'borrower',
prop: 'borrower',
dataType: 'TEXT',
},
{
name: 'formitem',
prop: 'borrowerid',
name: 'borrower1',
prop: 'borrower1',
dataType: 'TEXT',
},
{
name: 'formitem1',
prop: 'borrowerid',
name: 'borrower2',
prop: 'borrower2',
dataType: 'TEXT',
},
{
name: 'formitem2',
prop: 'borrowerid',
name: 'borrower3',
prop: 'borrower3',
dataType: 'TEXT',
},
{
name: 'borrower',
prop: 'borrower',
name: 'borrower1_id',
prop: 'borrower1_id',
dataType: 'TEXT',
},
{
name: 'borrower2_id',
prop: 'borrower2_id',
dataType: 'TEXT',
},
{
name: 'borrower3_id',
prop: 'borrower3_id',
dataType: 'TEXT',
},
{
name: 'borrowerid',
prop: 'borrowerid',
dataType: 'TEXT',
},
{
......
<template>
<div class='pickupviewpanel'>
<component
v-if="inited && view.viewname && !Object.is(view.viewname, '')"
:is="view.viewname"
class="viewcontainer3"
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
@viewdataschange="onViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</component>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
import IBIZCustomerService from '@/service/ibizcustomer/ibizcustomer-service';
import Usr2MPickupViewpickupviewpanelService from './usr2-mpickup-viewpickupviewpanel-pickupviewpanel-service';
import IBIZCustomerUIService from '@/uiservice/ibizcustomer/ibizcustomer-ui-service';
import Usr2MPickupViewpickupviewpanelModel from './usr2-mpickup-viewpickupviewpanel-pickupviewpanel-model';
@Component({
components: {
}
})
export default class Usr2MPickupViewpickupviewpanelBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public getControlType(): string {
return 'PICKUPVIEWPANEL'
}
/**
* 建构部件服务对象
*
* @type {Usr2MPickupViewpickupviewpanelService}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public service: Usr2MPickupViewpickupviewpanelService = new Usr2MPickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZCustomerService}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public appEntityService: IBIZCustomerService = new IBIZCustomerService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
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();
}
})
}
}
/**
* 选中数据字符串
*
* @type {string}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public view: any = {
viewname: 'ibizcustomer-pickup-tree-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item.srfmajortext?item.srfmajortext:item['ibizcustomername'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(Object.assign(data, this.viewparams));
this.inited = true;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* vue 生命周期
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Usr2MPickupViewpickupviewpanelBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './usr2-mpickup-viewpickupviewpanel-pickupviewpanel.less';
</style>
\ No newline at end of file
/**
* Usr2MPickupViewpickupviewpanel 部件模型
*
* @export
* @class Usr2MPickupViewpickupviewpanelModel
*/
export default class Usr2MPickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2MPickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'sn',
},
{
name: 'updatedate',
},
{
name: 'createdate',
},
{
name: 'customeruid',
},
{
name: 'ibizcustomer',
prop: 'ibizcustomerid',
},
{
name: 'address',
},
{
name: 'ibizcustomername',
},
{
name: 'updateman',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Usr2MPickupViewpickupviewpanel 部件服务对象
*
* @export
* @class Usr2MPickupViewpickupviewpanelService
*/
export default class Usr2MPickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Usr2MPickupViewpickupviewpanelBase from './usr2-mpickup-viewpickupviewpanel-pickupviewpanel-base.vue';
@Component({
components: {
}
})
export default class Usr2MPickupViewpickupviewpanel extends Usr2MPickupViewpickupviewpanelBase {
}
</script>
\ No newline at end of file
<template>
<div class='pickupviewpanel'>
<component
v-if="inited && view.viewname && !Object.is(view.viewname, '')"
:is="view.viewname"
class="viewcontainer3"
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
@viewdataschange="onViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</component>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
import IBIZCustomerService from '@/service/ibizcustomer/ibizcustomer-service';
import Usr2PickupViewpickupviewpanelService from './usr2-pickup-viewpickupviewpanel-pickupviewpanel-service';
import IBIZCustomerUIService from '@/uiservice/ibizcustomer/ibizcustomer-ui-service';
import Usr2PickupViewpickupviewpanelModel from './usr2-pickup-viewpickupviewpanel-pickupviewpanel-model';
@Component({
components: {
}
})
export default class Usr2PickupViewpickupviewpanelBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public getControlType(): string {
return 'PICKUPVIEWPANEL'
}
/**
* 建构部件服务对象
*
* @type {Usr2PickupViewpickupviewpanelService}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public service: Usr2PickupViewpickupviewpanelService = new Usr2PickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZCustomerService}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public appEntityService: IBIZCustomerService = new IBIZCustomerService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
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();
}
})
}
}
/**
* 选中数据字符串
*
* @type {string}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public view: any = {
viewname: 'ibizcustomer-pickup-tree-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item.srfmajortext?item.srfmajortext:item['ibizcustomername'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(Object.assign(data, this.viewparams));
this.inited = true;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* vue 生命周期
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Usr2PickupViewpickupviewpanelBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './usr2-pickup-viewpickupviewpanel-pickupviewpanel.less';
</style>
\ No newline at end of file
/**
* Usr2PickupViewpickupviewpanel 部件模型
*
* @export
* @class Usr2PickupViewpickupviewpanelModel
*/
export default class Usr2PickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2PickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'sn',
},
{
name: 'updatedate',
},
{
name: 'createdate',
},
{
name: 'customeruid',
},
{
name: 'ibizcustomer',
prop: 'ibizcustomerid',
},
{
name: 'address',
},
{
name: 'ibizcustomername',
},
{
name: 'updateman',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Usr2PickupViewpickupviewpanel 部件服务对象
*
* @export
* @class Usr2PickupViewpickupviewpanelService
*/
export default class Usr2PickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Usr2PickupViewpickupviewpanelBase from './usr2-pickup-viewpickupviewpanel-pickupviewpanel-base.vue';
@Component({
components: {
}
})
export default class Usr2PickupViewpickupviewpanel extends Usr2PickupViewpickupviewpanelBase {
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册