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

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

上级 efd1a44d
......@@ -791,6 +791,14 @@
"viewname": "IBIZOrderSF2EditView",
"viewtag": "b8ae19200ec9d4e8e588bc31e3f9bcb4"
},
"ibizsample0002mpickupview": {
"title": "首页图表数据源数据多项选择视图",
"caption": "示例实体02",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZSample0002MPickupView",
"viewtag": "ba34a828f898eefac5a98e7b25d9aef4"
},
"ibizbookroweditgridview": {
"title": "图书表格视图(行编辑)",
"caption": "图书",
......
......@@ -110,6 +110,8 @@ export default {
f27: "数据选择(无AC、数据链接)",
f28: "数据选择(下拉)",
f29: "数据选择(下拉、数据链接)",
formitem5: "数据链接",
formitem6: "地址框(支持选择、AC)",
formitem: "地址栏(选择)",
ibizsample0002id: "值项表单项",
f30: "自动填充",
......
......@@ -109,6 +109,8 @@ export default {
f27: "数据选择(无AC、数据链接)",
f28: "数据选择(下拉)",
f29: "数据选择(下拉、数据链接)",
formitem5: "数据链接",
formitem6: "地址框(支持选择、AC)",
formitem: "地址栏(选择)",
ibizsample0002id: "值项表单项",
f30: "自动填充",
......
......@@ -23,6 +23,10 @@ export default {
caption: "示例实体02",
title: "首页图表数据源选择表格视图",
},
mpickupview: {
caption: "示例实体02",
title: "首页图表数据源数据多项选择视图",
},
},
main_form: {
details: {
......
......@@ -22,6 +22,10 @@ export default {
caption: "示例实体02",
title: "首页图表数据源选择表格视图",
},
mpickupview: {
caption: "示例实体02",
title: "首页图表数据源数据多项选择视图",
},
},
main_form: {
details: {
......
......@@ -799,6 +799,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBIZOrderSF2EditView",
"viewtag": "b8ae19200ec9d4e8e588bc31e3f9bcb4"
},
"ibizsample0002mpickupview": {
"title": "首页图表数据源数据多项选择视图",
"caption": "示例实体02",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "Sample",
"viewname": "IBIZSample0002MPickupView",
"viewtag": "ba34a828f898eefac5a98e7b25d9aef4"
},
"ibizbookroweditgridview": {
"title": "图书表格视图(行编辑)",
"caption": "图书",
......
<template>
<div class="view-container dempickupview ibizsample0002-mpickup-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizsample0002mpickupview"></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 IBIZSample0002Service from '@/service/ibizsample0002/ibizsample0002-service';
import IBIZSample0002AuthService from '@/authservice/ibizsample0002/ibizsample0002-auth-service';
import MPickupViewEngine from '@engine/view/mpickup-view-engine';
import IBIZSample0002UIService from '@/uiservice/ibizsample0002/ibizsample0002-ui-service';
@Component({
components: {
},
})
export default class IBIZSample0002MPickupViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZSample0002Service}
* @memberof IBIZSample0002MPickupViewBase
*/
public appEntityService: IBIZSample0002Service = new IBIZSample0002Service;
/**
* 实体UI服务对象
*
* @type IBIZSample0002UIService
* @memberof IBIZSample0002MPickupViewBase
*/
public appUIService: IBIZSample0002UIService = new IBIZSample0002UIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZSample0002MPickupViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZSample0002MPickupViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZSample0002MPickupViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZSample0002MPickupViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZSample0002MPickupViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZSample0002MPickupViewBase
*/
public viewtag: string = 'ba34a828f898eefac5a98e7b25d9aef4';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public model: any = {
srfCaption: 'entities.ibizsample0002.views.mpickupview.caption',
srfTitle: 'entities.ibizsample0002.views.mpickupview.title',
srfSubTitle: 'entities.ibizsample0002.views.mpickupview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZSample0002MPickupViewBase
*/
@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 IBIZSample0002MPickupViewBase
*/
@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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZSample0002MPickupViewBase
*/
public engine: MPickupViewEngine = new MPickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZSample0002MPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'ibizsample0002',
majorPSDEField: 'ibizsample0002name',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZSample0002MPickupViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZSample0002MPickupViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZSample0002MPickupViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZSample0002MPickupViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZSample0002MPickupViewBase
*/
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,{'ibizsample0002':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizsample0002-mpickup-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizsample0002,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZSample0002MPickupViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizsample0002-mpickup-view',tag:this.viewtag,srfkey:this.context.ibizsample0002,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZSample0002MPickupViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZSample0002MPickupViewBase
*/
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,'ibizsample0002-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,'IBIZSample0002MPickupView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZSample0002MPickupViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZSample0002MPickupViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZSample0002MPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZSample0002MPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 选中数据的字符串
*
* @type {string}
* @memberof IBIZSample0002MPickupViewBase
*/
public selectedData: string = "";
/**
* 是否初始化已选中项
*
* @type {any[]}
* @memberof IBIZSample0002MPickupViewBase
*/
public isInitSelected:boolean = false;
/**
* 视图选中数据
*
* @type {any[]}
* @memberof IBIZSample0002MPickupViewBase
*/
public viewSelections:any[] = [];
/**
* 是否单选
*
* @type {boolean}
* @memberof IBIZSample0002MPickupViewBase
*/
public isSingleSelect: boolean = false;
/**
* 选中数据单击
*
* @param {*} item
* @memberof IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
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 IBIZSample0002MPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
* 选中数据全部删除
*
* @memberof IBIZSample0002MPickupViewBase
*/
public onCLickAllLeft():void {
this.viewSelections = [];
this.containerModel.view_leftbtn.disabled = true;
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', []);
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 添加左侧面板所有数据到右侧
*
* @memberof IBIZSample0002MPickupViewBase
*/
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['ibizsample0002name']});
})
}
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 IBIZSample0002MPickupViewBase
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
this.$emit('close', null);
}
/**
* 取消
*
* @memberof IBIZSample0002MPickupViewBase
*/
public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null);
}
}
</script>
<style lang='less'>
@import './ibizsample0002-mpickup-view.less';
</style>
\ No newline at end of file
.ibizsample0002-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 IBIZSample0002MPickupViewBase from './ibizsample0002-mpickup-view-base.vue';
import view_pickupviewpanel from '@widgets/ibizsample0002/mpickup-viewpickupviewpanel-pickupviewpanel/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 IBIZSample0002MPickupView extends IBIZSample0002MPickupViewBase {
}
</script>
\ No newline at end of file
......@@ -112,6 +112,7 @@ export const PageComponents = {
Vue.component('ibizsample0017-f20-edit-view', () => import('@pages/sample/ibizsample0017-f20-edit-view/ibizsample0017-f20-edit-view.vue'));
Vue.component('ibizorder-odsp-w-wfgrid-view', () => import('@pages/sample/ibizorder-odsp-w-wfgrid-view/ibizorder-odsp-w-wfgrid-view.vue'));
Vue.component('ibizbookvalue-rules-grid-view', () => import('@pages/sample/ibizbookvalue-rules-grid-view/ibizbookvalue-rules-grid-view.vue'));
Vue.component('ibizsample0002-mpickup-view', () => import('@pages/sample/ibizsample0002-mpickup-view/ibizsample0002-mpickup-view.vue'));
Vue.component('ibizcustomer-pickup-grid-view', () => import('@pages/sample/ibizcustomer-pickup-grid-view/ibizcustomer-pickup-grid-view.vue'));
Vue.component('ibizorder-sf7-edit-view', () => import('@pages/sample/ibizorder-sf7-edit-view/ibizorder-sf7-edit-view.vue'));
Vue.component('ibizbookedit-view', () => import('@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'));
......
......@@ -1648,6 +1648,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizbookvalue-rules-grid-view/ibizbookvalue-rules-grid-view.vue'),
},
{
path: 'ibizsample0002s/:ibizsample0002?/mpickupview/:mpickupview?',
meta: {
caption: 'entities.ibizsample0002.views.mpickupview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizsample0002s', parameterName: 'ibizsample0002' },
{ pathName: 'mpickupview', parameterName: 'mpickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizsample0002-mpickup-view/ibizsample0002-mpickup-view.vue'),
},
{
path: 'ibizcustomers/:ibizcustomer?/pickupgridview/:pickupgridview?',
meta: {
......@@ -3073,6 +3087,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-sf2-edit-view/ibizorder-sf2-edit-view.vue'),
},
{
path: '/ibizsample0002s/:ibizsample0002?/mpickupview/:mpickupview?',
meta: {
caption: 'entities.ibizsample0002.views.mpickupview.caption',
info:'',
parameters: [
{ pathName: 'ibizsample0002s', parameterName: 'ibizsample0002' },
{ pathName: 'mpickupview', parameterName: 'mpickupview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizsample0002-mpickup-view/ibizsample0002-mpickup-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/roweditgridview/:roweditgridview?',
meta: {
......
......@@ -44,6 +44,7 @@ export const viewstate: any = {
refviews: [
'2dd64fdd5e7303cc73090d949bc91d9b',
'581e6727bc5983c238cc9990ba5fdcac',
'ba34a828f898eefac5a98e7b25d9aef4',
],
},
{
......@@ -995,6 +996,16 @@ export const viewstate: any = {
'f7ce60a7707de1ef9f926b3f9d5d6954',
],
},
{
viewtag: 'ba34a828f898eefac5a98e7b25d9aef4',
viewmodule: 'Sample',
viewname: 'IBIZSample0002MPickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'7a334494f71d4328c743657a6429ee03',
],
},
{
viewtag: 'bc76c982dd2264463427eb57e9ed3fba',
viewmodule: 'Sample',
......
......@@ -99,6 +99,7 @@ export default class IBIZSample0002UIServiceBase extends UIService {
this.allViewMap.set(':',{viewname:'editview',srfappde:'ibizsample0002s',component:'ibizsample0002-edit-view'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'ibizsample0002s',component:'ibizsample0002-pickup-view'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'ibizsample0002s',component:'ibizsample0002-pickup-grid-view'});
this.allViewMap.set('MPICKUPVIEW:',{viewname:'mpickupview',srfappde:'ibizsample0002s',component:'ibizsample0002-mpickup-view'});
}
/**
......
......@@ -509,9 +509,75 @@
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<i-col v-show="detailsModel.formitem5.visible" :style="{}" :sm="{ span: 8, offset: 0 }" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='formitem5' :itemRules="this.rules().formitem5" class='' :caption="$t('entities.ibizsample0001.main4_form.details.formitem5')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem5.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.formitem5.disabled"
name='formitem5'
deMajorField='ibizsample0002name'
deKeyField='ibizsample0002'
valueitem='ibizsample0002id'
:value="data.formitem5"
editortype="linkonly"
:linkview="{ viewname: 'IBIZSample0002EditView', title: $t('entities.ibizsample0002.views.editview.title'), deResParameters: [], parameters: [{ pathName: 'ibizsample0002s', parameterName: 'ibizsample0002' }, { pathName: 'editview', parameterName: 'editview' } ], width: 0, height: 0, placement: '', isRedirectView: false }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem6.visible" :style="{}" :sm="{ span: 8, offset: 0 }" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='formitem6' :itemRules="this.rules().formitem6" class='' :caption="$t('entities.ibizsample0001.main4_form.details.formitem6')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem6.error" :isEmptyCaption="false" labelPos="LEFT">
<app-mpicker
:activeData="data"
:disabled="detailsModel.formitem6.disabled"
:curvalue="data.formitem6"
name="formitem6"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:service="service"
valueitem=''
:acParams="{ }"
:pickupView="{ viewname: 'ibizsample0002-mpickup-view', title: $t('entities.ibizsample0002.views.mpickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizsample0002s', parameterName: 'ibizsample0002' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
@formitemvaluechange="onFormItemValueChange"
style="">
</app-mpicker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.formitem.visible" :style="{}" :sm="{ span: 8, offset: 0 }" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item name='formitem' :itemRules="this.rules().formitem" class='' :caption="$t('entities.ibizsample0001.main4_form.details.formitem')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.formitem.error" :isEmptyCaption="false" labelPos="LEFT">
<app-mpicker
:activeData="data"
:disabled="detailsModel.formitem.disabled"
:curvalue="data.formitem"
name="formitem"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:service="service"
valueitem=''
deMajorField='ibizsample0002name'
deKeyField='ibizsample0002'
:acParams="{ serviceName: 'IBIZSample0002Service', interfaceName: 'FetchDefault'}"
:pickupView="{ viewname: 'ibizsample0002-mpickup-view', title: $t('entities.ibizsample0002.views.mpickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibizsample0002s', parameterName: 'ibizsample0002' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
@formitemvaluechange="onFormItemValueChange"
style="">
</app-mpicker>
</app-form-item>
......@@ -990,6 +1056,8 @@ export default class Main4Base extends Vue implements ControlInterface {
f27: null,
f28: null,
f29: null,
formitem5: null,
formitem6: null,
formitem: null,
ibizsample0002id: null,
f30: null,
......@@ -1200,6 +1268,14 @@ export default class Main4Base extends Vue implements ControlInterface {
{ required: this.detailsModel.f29.required, type: 'string', message: '数据选择(下拉、数据链接) 值不能为空', trigger: 'change' },
{ required: this.detailsModel.f29.required, type: 'string', message: '数据选择(下拉、数据链接) 值不能为空', trigger: 'blur' },
],
formitem5: [
{ required: this.detailsModel.formitem5.required, type: 'string', message: '数据链接 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem5.required, type: 'string', message: '数据链接 值不能为空', trigger: 'blur' },
],
formitem6: [
{ required: this.detailsModel.formitem6.required, type: 'string', message: '地址框(支持选择、AC) 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem6.required, type: 'string', message: '地址框(支持选择、AC) 值不能为空', trigger: 'blur' },
],
formitem: [
{ required: this.detailsModel.formitem.required, type: 'string', message: '地址栏(选择) 值不能为空', trigger: 'change' },
{ required: this.detailsModel.formitem.required, type: 'string', message: '地址栏(选择) 值不能为空', trigger: 'blur' },
......@@ -1420,6 +1496,10 @@ export default class Main4Base extends Vue implements ControlInterface {
f28: new FormItemModel({ caption: '数据选择(下拉)', detailType: 'FORMITEM', name: 'f28', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
f29: new FormItemModel({ caption: '数据选择(下拉、数据链接)', detailType: 'FORMITEM', name: 'f29', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
formitem5: new FormItemModel({ caption: '数据链接', detailType: 'FORMITEM', name: 'formitem5', visible: true, isShowCaption: true, form: this, isControlledContent: false , required:false, disabled: false, enableCond: 3 })
,
formitem6: new FormItemModel({ caption: '地址框(支持选择、AC)', detailType: 'FORMITEM', name: 'formitem6', 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 })
,
......@@ -1989,6 +2069,30 @@ export default class Main4Base extends Vue implements ControlInterface {
this.formDataChange({ name: 'f29', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem5 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main4Base
*/
@Watch('data.formitem5')
onFormitem5Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'formitem5', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem6 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main4Base
*/
@Watch('data.formitem6')
onFormitem6Change(newVal: any, oldVal: any) {
this.formDataChange({ name: 'formitem6', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 formitem 值
*
......@@ -2185,6 +2289,8 @@ export default class Main4Base extends Vue implements ControlInterface {
......
......@@ -216,9 +216,19 @@ export default class Main4Model {
dataType: 'PICKUPTEXT',
},
{
name: 'formitem',
name: 'formitem5',
prop: 'ibizsample0002name',
dataType: 'PICKUPTEXT',
},
{
name: 'formitem6',
dataType:'FORMITEM',
},
{
name: 'formitem',
prop: 'ibizsample0002name',
dataType: 'PICKUPTEXT',
},
{
name: 'ibizsample0002id',
prop: 'ibizsample0001id',
......
<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 IBIZSample0002Service from '@/service/ibizsample0002/ibizsample0002-service';
import MPickupViewpickupviewpanelService from './mpickup-viewpickupviewpanel-pickupviewpanel-service';
import IBIZSample0002UIService from '@/uiservice/ibizsample0002/ibizsample0002-ui-service';
import MPickupViewpickupviewpanelModel from './mpickup-viewpickupviewpanel-pickupviewpanel-model';
@Component({
components: {
}
})
export default class MPickupViewpickupviewpanelBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof MPickupViewpickupviewpanelBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof MPickupViewpickupviewpanelBase
*/
public getControlType(): string {
return 'PICKUPVIEWPANEL'
}
/**
* 建构部件服务对象
*
* @type {MPickupViewpickupviewpanelService}
* @memberof MPickupViewpickupviewpanelBase
*/
public service: MPickupViewpickupviewpanelService = new MPickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZSample0002Service}
* @memberof MPickupViewpickupviewpanelBase
*/
public appEntityService: IBIZSample0002Service = new IBIZSample0002Service({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof MPickupViewpickupviewpanelBase
*/
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 MPickupViewpickupviewpanelBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof MPickupViewpickupviewpanelBase
*/
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 MPickupViewpickupviewpanelBase
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof MPickupViewpickupviewpanelBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof MPickupViewpickupviewpanelBase
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof MPickupViewpickupviewpanelBase
*/
public view: any = {
viewname: 'ibizsample0002-pickup-grid-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof MPickupViewpickupviewpanelBase
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof MPickupViewpickupviewpanelBase
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof MPickupViewpickupviewpanelBase
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof MPickupViewpickupviewpanelBase
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof MPickupViewpickupviewpanelBase
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item.srfmajortext?item.srfmajortext:item['ibizsample0002name'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof MPickupViewpickupviewpanelBase
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof MPickupViewpickupviewpanelBase
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof MPickupViewpickupviewpanelBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof MPickupViewpickupviewpanelBase
*/
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 MPickupViewpickupviewpanelBase
*/
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 MPickupViewpickupviewpanelBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof MPickupViewpickupviewpanelBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './mpickup-viewpickupviewpanel-pickupviewpanel.less';
</style>
\ No newline at end of file
/**
* MPickupViewpickupviewpanel 部件模型
*
* @export
* @class MPickupViewpickupviewpanelModel
*/
export default class MPickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MPickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'de',
},
{
name: 'denum',
},
{
name: 'updatedate',
},
{
name: 'updateman',
},
{
name: 'ibizsample0002name',
},
{
name: 'createman',
},
{
name: 'ibizsample0002',
prop: 'ibizsample0002id',
},
{
name: 'createdate',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* MPickupViewpickupviewpanel 部件服务对象
*
* @export
* @class MPickupViewpickupviewpanelService
*/
export default class MPickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import MPickupViewpickupviewpanelBase from './mpickup-viewpickupviewpanel-pickupviewpanel-base.vue';
@Component({
components: {
}
})
export default class MPickupViewpickupviewpanel extends MPickupViewpickupviewpanelBase {
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册