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

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

上级 3778e130
......@@ -60,9 +60,9 @@ export default class EditView3Engine extends EditViewEngine {
* @param {any[]} args
* @memberof EditView3Engine
*/
public drTabEvent(eventName: string, args: any[]): void {
public drTabEvent(eventName: string, arg: any): void {
if (Object.is(eventName, 'selectionchange')) {
this.drTabSelectionChange(args);
this.drTabSelectionChange(arg);
}
}
......@@ -72,13 +72,16 @@ export default class EditView3Engine extends EditViewEngine {
* @param {any[]} args
* @memberof EditView3Engine
*/
public drTabSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
public drTabSelectionChange(data: any): void {
if (data) {
this.view.drItem = data;
this.setNavPosData(data);
if (this.getDrTab()) {
this.setViewState2({ tag: this.getDrTab().name, action: 'change', viewdata: data });
}
this.view.$forceUpdate();
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
this.view.$emit('selectionchange', data);
}
/**
......@@ -91,6 +94,10 @@ export default class EditView3Engine extends EditViewEngine {
super.onFormLoad(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
......@@ -105,10 +112,32 @@ export default class EditView3Engine extends EditViewEngine {
super.onFormSave(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 设置导航数据
*
* @protected
* @param {*} data
* @return {*}
* @memberof EditView3Engine
*/
protected setNavPosData(data: any) {
if (!this.view.layoutModelDetails) {
return;
}
const navPos: any = Object.values(this.view.layoutModelDetails).find((item: any) => {
return item.predefinedType === "NAV_POS";
});
navPos.navData = data;
}
/**
* 获取关系
*
......@@ -120,10 +149,10 @@ export default class EditView3Engine extends EditViewEngine {
}
/**
* @description 销毁
* @description 视图销毁
* @memberof EditView3Engine
*/
public destroy() {
public destroy(): void {
super.destroy();
this.drTab = null;
}
......
......@@ -60,7 +60,7 @@ export default class EditView4Engine extends EditViewEngine {
* @param {any[]} args
* @memberof EditView4Engine
*/
public drTabEvent(eventName: string, args: any[]): void {
public drTabEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'selectionchange')) {
this.drTabSelectionChange(args);
}
......@@ -72,13 +72,16 @@ export default class EditView4Engine extends EditViewEngine {
* @param {any[]} args
* @memberof EditView4Engine
*/
public drTabSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
public drTabSelectionChange(data: any): void {
if (data) {
this.view.drItem = data;
this.setNavPosData(data);
if (this.getDrTab()) {
this.setViewState2({ tag: this.getDrTab().name, action: 'change', viewdata: data });
}
this.view.$forceUpdate();
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
this.view.$emit('selectionchange', data);
}
/**
......@@ -91,6 +94,10 @@ export default class EditView4Engine extends EditViewEngine {
super.onFormLoad(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
......@@ -105,10 +112,32 @@ export default class EditView4Engine extends EditViewEngine {
super.onFormSave(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 设置导航数据
*
* @protected
* @param {*} data
* @return {*}
* @memberof EditView4Engine
*/
protected setNavPosData(data: any) {
if (!this.view.layoutModelDetails) {
return;
}
const navPos: any = Object.values(this.view.layoutModelDetails).find((item: any) => {
return item.predefinedType === "NAV_POS";
});
navPos.navData = data;
}
/**
* 获取关系
*
......@@ -120,10 +149,10 @@ export default class EditView4Engine extends EditViewEngine {
}
/**
* @description 销毁
* @description 视图销毁
* @memberof EditView4Engine
*/
public destroy() {
public destroy(): void {
super.destroy();
this.drTab = null;
}
......
......@@ -44,7 +44,7 @@
:viewparams="viewparams"
:context="context"
parentName = "IBIZBOOK"
:isShowSlot="false"
:selectDefault="true"
@selectionchange='drtab_selectionchange($event)'
@closeview='closeView($event)'>
</view_drtab>
......
......@@ -18,6 +18,26 @@
.view-container.ibizbookedit-view4 > .view-card > .ivu-card-body > .content-container {
height: calc(100% - 30px);
.edit-view4 {
height: 100%;
display: flex;
flex-direction: column;
}
.edit-view4-content {
.app-dr-tab {
height: 40px;
line-height: 40px;
border-bottom: 1px solid rgb(220, 222, 226);
display: flex;
}
> .view-container2 {
height: calc(100% - 40px);
}
}
.edit-view4-form,
.edit-view4-content {
height: 50%;
}
.ibizbookedit-view4 {
height: 100%;
}
......@@ -1195,7 +1195,7 @@ export default class IBIZOrderSEditView3_layoutBase extends Vue {
* @type {*}
* @memberof IBIZOrderSEditView3_layoutBase
*/
public drItem: any = {};
public drItem: any = { id: 'form' };
/**
* 处理分页项变化
......@@ -1203,7 +1203,9 @@ export default class IBIZOrderSEditView3_layoutBase extends Vue {
* @memberof IBIZOrderSEditView3_layoutBase
*/
public handleDrTabChange() {
if (this.engine) {
this.engine.drTabSelectionChange({ id: 'form' });
}
}
}
......
......@@ -5,7 +5,7 @@
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
<template v-if="Object.is(this.selection.id, 'form')">
<template v-if="drItem && drItem.id === 'form'">
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction1.visabled" :disabled="toolBarModels.deuiaction1.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'deuiaction1' }, $event)">
......@@ -52,7 +52,7 @@
<div class="content-container">
<div class="edit-view3">
<div class="edit-view3-drheader">
<span :class="{ 'dr-tab-item': true, 'is-active': drItem && drItem.id !== 'form' }" @click="handleDrTabChange">订单</span>
<span :class="{ 'dr-tab-item': true, 'is-active': drItem && drItem.id === 'form' }" @click="handleDrTabChange">订单</span>
<view_drtab
:viewState="viewState"
name='drtab'
......@@ -62,28 +62,6 @@
parentName = "IBIZOrder"
@selectionchange='drtab_selectionchange($event)'
@closeview='closeView($event)'>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@load="form_load($event)"
@save="form_save($event)"
@remove="form_remove($event)"
@closeview="closeView($event)">
</view_form>
</view_drtab>
</div>
<div class="edit-view3-content">
......@@ -1205,7 +1183,7 @@ export default class IBIZOrderSEditView3Base extends Vue {
* @type {*}
* @memberof IBIZOrderSEditView3Base
*/
public drItem: any = {};
public drItem: any = { id: 'form' };
/**
* 处理分页项变化
......@@ -1213,7 +1191,9 @@ export default class IBIZOrderSEditView3Base extends Vue {
* @memberof IBIZOrderSEditView3Base
*/
public handleDrTabChange() {
if (this.engine) {
this.engine.drTabSelectionChange({ id: 'form' });
}
}
}
......
.view-card {
>.ivu-card-extra {
> .ivu-card-extra {
top: 5px;
right: 0px;
}
}
.edit-view3 {
height: 100%;
}
.edit-view3-drheader {
height: 40px;
line-height: 40px;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1px solid rgb(220, 222, 226);
.dr-tab-item {
cursor: pointer;
padding: 0 16px;
&.is-active,
&:hover {
color: #2d8cf0;
}
&.is-active {
position: relative;
}
&.is-active::after {
content: '';
width: 100%;
height: 2px;
background: #2d8cf0;
position: absolute;
left: 0px;
bottom: 0px;
}
}
}
.edit-view3-content {
height: calc(100% - 40px);
.edit-view3-content__form,
> .view-container2 {
height: 100%;
}
}
.ibizorder-sedit-view3 {
height: 100%;
}
.ibizorder-sedit-view3{
position: relative;
}
......
......@@ -83,7 +83,7 @@
:viewparams="viewparams"
:context="context"
parentName = "IBIZOrder"
:isShowSlot="false"
:selectDefault="true"
@selectionchange='drtab_selectionchange($event)'
@closeview='closeView($event)'>
</view_drtab>
......
......@@ -19,6 +19,26 @@
.deepskyblueToolBar {color:white !important;background-color:#108cee !important;}
.view-container.ibizorder-sedit-view4 > .view-card > .ivu-card-body > .content-container {
height: calc(100% - 30px);
.edit-view4 {
height: 100%;
display: flex;
flex-direction: column;
}
.edit-view4-content {
.app-dr-tab {
height: 40px;
line-height: 40px;
border-bottom: 1px solid rgb(220, 222, 226);
display: flex;
}
> .view-container2 {
height: calc(100% - 40px);
}
}
.edit-view4-form,
.edit-view4-content {
height: 50%;
}
.ibizorder-sedit-view4 {
height: 100%;
}
<template>
<div class="app-dr-tab">
<div v-for="(item, index) in items" :class="{ 'app-dr-tab-item': true, 'dr-tab-item': true, 'is-disabled': item.disabled, 'is-active': selection.id === item.id }">
<div
v-for="(item, index) in items"
:class="{
'app-dr-tab-item': true,
'dr-tab-item': true,
'is-disabled': item.disabled,
'is-active': selection.id === item.id
}"
@click="handleDrTabChange(item)">
<span class="text">{{ item.text }}</span>
</div>
</div>
......@@ -147,14 +155,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 是否显示插槽
* 是否默认加载数据
*
* @type {string}
* @type {boolean}
* @memberof DefaultBase
*/
@Prop({default:true}) public isShowSlot?: boolean;
@Prop({ default: false }) public selectDefault?: boolean;
/**
* 应用实体参数名称
......@@ -227,17 +234,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.afterCreated();
}
/**
* 仿真选中第一项
*
* @memberof DefaultBase
*/
public selectFirst(){
if (this.items.length > 0){
this.isShowSlot?this.tabPanelClick(this.items[0].name):this.items.length>1?this.tabPanelClick(this.items[1].name):()=>{};
}
}
/**
* 执行created后的逻辑
*
......@@ -250,10 +246,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
return;
}
if (Object.is('state', action)) {
const state = !this.context.ibizbook ? true : false;
this.setItemDisabled(state);
this.formData = data;
this.selectFirst();
this.handleFormDataChange(data);
}
if (Object.is('change', action)) {
this.selection = data;
}
});
}
......@@ -280,37 +276,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
/**
* 获取关系项
*
* @public
* @param {*} [arg={}]
* @returns {*}
* @memberof DefaultBase
*/
public getDRTabItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
return undefined;
}
/**
* 获取数据项
* 处理表单数据变化
*
* @public
* @param {string} id
* @returns {*}
* @memberof DefaultBase
*/
public getItem(id: string): any {
const arr: any[] = this.items.filter((_item: any) => Object.is(_item.id, id));
if (arr) {
return arr[0];
}
return null;
}
public handleFormDataChange(data: any) {
this.formData = data;
if (data && Object.is(data.srfuf, '1')) {
......@@ -322,37 +291,48 @@ export default class DefaultBase extends Vue implements ControlInterface {
item.disabled = true;
})
}
if (this.selectDefault && this.items.length > 0) {
this.handleDrTabChange(this.items[0]);
}
}
/**
* 选中节点
* 处理分页项变化
*
* @param {*} $event
* @memberof DefaultBase
*/
public tabPanelClick($event: any): void {
// const item = this.getItem($event);
// if (Object.is(item.id, this.selection.id)) {
// return;
// }
// this.$emit('selectionchange', [item]);
// let localNavParam:any = this.initNavParam(item);
// const refview = this.getDRTabItem({ nodetype: item.id });
// this.selection = {};
// const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
// if(localNavParam && localNavParam.localContext){
// Object.assign(_context,localNavParam.localContext);
// }
// Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]});
// const _params: any = {};
// if(localNavParam && localNavParam.localViewParam){
// Object.assign(_params,localNavParam.localViewParam);
// }
// if (refview && refview.parentdatajo) {
// Object.assign(_context, refview.parentdatajo);
// Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
// }
// Object.assign(this.selection, item);
public handleDrTabChange(item: any) {
if (this.selection && this.selection.id === item.id) {
return;
}
this.selection = item;
const tempContext = Util.deepCopy(this.context);
const tempViewParams = Util.deepCopy(this.viewparams);
if (item.localContext && Object.keys(item.localContext).length > 0) {
const _context: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, item.localContext);
Object.assign(tempContext, _context);
}
if (this.formData.srfparentkey) {
Object.assign(tempContext, { srfparentkey: this.formData.srfparentkey });
Object.assign(tempViewParams, { srfparentkey: this.formData.srfparentkey });
}
if (item.localViewParam && Object.keys(item.localViewParam).length > 0) {
const _params: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, item.localViewParam);
Object.assign(tempViewParams, _params);
}
if (this.formData.srfparentdename) {
Object.assign(tempContext, { srfparentdename: this.formData.srfparentdename });
Object.assign(tempViewParams, { srfparentdename: this.formData.srfparentdename });
}
const drItem = {
id: item.id,
navView: item.navView,
srfnavdata: {
context: tempContext,
viewparams: tempViewParams
}
}
this.$emit('selectionchange', drItem);
}
}
......
.drtab{
height:100%;
overflow: auto;
.app-dr-tab {
height: 100%;
>.ivu-tabs-bar {
margin-bottom: 0px;
}
>.ivu-tabs-content {
height: calc(100% - 36px);
padding: 0px !important;
.ivu-tabs-tabpane {
height: 100%;
.main-data {
width: 100%;
height: 100%;
.app-dr-tab {
.dr-tab-item {
cursor: pointer;
padding: 0 16px;
&.is-active,
&:hover {
color: #2d8cf0;
}
&.is-active {
position: relative;
}
&.is-active::after {
content: '';
width: 100%;
height: 2px;
background: #2d8cf0;
position: absolute;
left: 0px;
bottom: 0px;
}
}
}
// this is less
......@@ -663,7 +663,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGroupByCodelistListView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -699,7 +699,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public loadDraft(opt: any = {},mode?:string): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGroupByCodelistListView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
......
......@@ -10,7 +10,7 @@ export default class Usr2Model {
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2Dataviewexpbar_dataviewMode
* @memberof Usr2DataViewMode
*/
public getDataItems(): any[] {
return [
......@@ -39,6 +39,17 @@ export default class Usr2Model {
dataType: 'FONTKEY',
},
{
name: 'n_ibizbookname_like',
prop: 'n_ibizbookname_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_price_gtandeq',
prop: 'n_price_gtandeq',
dataType: 'QUERYPARAM'
},
{
name:'size',
......
......@@ -906,7 +906,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(pageReset){
......@@ -1001,7 +1001,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.removeAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
......@@ -1107,7 +1107,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(!arg){
......@@ -1987,7 +1987,7 @@ export default class MainBase extends Vue implements ControlInterface {
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -1995,7 +1995,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizorderdetail){
......@@ -2062,7 +2062,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailGridView9'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailSGridView'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return;
}
let _this = this;
......
<template>
<div class="app-dr-tab">
<div v-for="(item, index) in items" :class="{ 'app-dr-tab-item': true, 'dr-tab-item': true, 'is-disabled': item.disabled, 'is-active': selection.id === item.id }">
<div
v-for="(item, index) in items"
:class="{
'app-dr-tab-item': true,
'dr-tab-item': true,
'is-disabled': item.disabled,
'is-active': selection.id === item.id
}"
@click="handleDrTabChange(item)">
<span class="text">{{ item.text }}</span>
</div>
</div>
......@@ -156,14 +164,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 是否显示插槽
* 是否默认加载数据
*
* @type {string}
* @type {boolean}
* @memberof DefaultBase
*/
@Prop({default:true}) public isShowSlot?: boolean;
@Prop({ default: false }) public selectDefault?: boolean;
/**
* 应用实体参数名称
......@@ -245,17 +252,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.afterCreated();
}
/**
* 仿真选中第一项
*
* @memberof DefaultBase
*/
public selectFirst(){
if (this.items.length > 0){
this.isShowSlot?this.tabPanelClick(this.items[0].name):this.items.length>1?this.tabPanelClick(this.items[1].name):()=>{};
}
}
/**
* 执行created后的逻辑
*
......@@ -268,10 +264,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
return;
}
if (Object.is('state', action)) {
const state = !this.context.ibizorder ? true : false;
this.setItemDisabled(state);
this.formData = data;
this.selectFirst();
this.handleFormDataChange(data);
}
if (Object.is('change', action)) {
this.selection = data;
}
});
}
......@@ -298,43 +294,10 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
/**
* 获取关系项
* 处理表单数据变化
*
* @public
* @param {*} [arg={}]
* @returns {*}
* @memberof DefaultBase
*/
public getDRTabItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
if (Object.is(expmode, 'DRITEM2')) {
return {
viewname: 'ibizorder-detail-sgrid-view',
parentdatajo: {},
};
}
return undefined;
}
/**
* 获取数据项
*
* @public
* @param {string} id
* @returns {*}
* @memberof DefaultBase
*/
public getItem(id: string): any {
const arr: any[] = this.items.filter((_item: any) => Object.is(_item.id, id));
if (arr) {
return arr[0];
}
return null;
}
public handleFormDataChange(data: any) {
this.formData = data;
if (data && Object.is(data.srfuf, '1')) {
......@@ -346,37 +309,48 @@ export default class DefaultBase extends Vue implements ControlInterface {
item.disabled = true;
})
}
if (this.selectDefault && this.items.length > 0) {
this.handleDrTabChange(this.items[0]);
}
}
/**
* 选中节点
* 处理分页项变化
*
* @param {*} $event
* @memberof DefaultBase
*/
public tabPanelClick($event: any): void {
// const item = this.getItem($event);
// if (Object.is(item.id, this.selection.id)) {
// return;
// }
// this.$emit('selectionchange', [item]);
// let localNavParam:any = this.initNavParam(item);
// const refview = this.getDRTabItem({ nodetype: item.id });
// this.selection = {};
// const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
// if(localNavParam && localNavParam.localContext){
// Object.assign(_context,localNavParam.localContext);
// }
// Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]});
// const _params: any = {};
// if(localNavParam && localNavParam.localViewParam){
// Object.assign(_params,localNavParam.localViewParam);
// }
// if (refview && refview.parentdatajo) {
// Object.assign(_context, refview.parentdatajo);
// Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
// }
// Object.assign(this.selection, item);
public handleDrTabChange(item: any) {
if (this.selection && this.selection.id === item.id) {
return;
}
this.selection = item;
const tempContext = Util.deepCopy(this.context);
const tempViewParams = Util.deepCopy(this.viewparams);
if (item.localContext && Object.keys(item.localContext).length > 0) {
const _context: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, item.localContext);
Object.assign(tempContext, _context);
}
if (this.formData.srfparentkey) {
Object.assign(tempContext, { srfparentkey: this.formData.srfparentkey });
Object.assign(tempViewParams, { srfparentkey: this.formData.srfparentkey });
}
if (item.localViewParam && Object.keys(item.localViewParam).length > 0) {
const _params: any = this.$util.computedNavData(this.formData, tempContext, tempViewParams, item.localViewParam);
Object.assign(tempViewParams, _params);
}
if (this.formData.srfparentdename) {
Object.assign(tempContext, { srfparentdename: this.formData.srfparentdename });
Object.assign(tempViewParams, { srfparentdename: this.formData.srfparentdename });
}
const drItem = {
id: item.id,
navView: item.navView,
srfnavdata: {
context: tempContext,
viewparams: tempViewParams
}
}
this.$emit('selectionchange', drItem);
}
}
......
.drtab{
height:100%;
overflow: auto;
.app-dr-tab {
height: 100%;
>.ivu-tabs-bar {
margin-bottom: 0px;
}
>.ivu-tabs-content {
height: calc(100% - 36px);
padding: 0px !important;
.ivu-tabs-tabpane {
height: 100%;
.main-data {
width: 100%;
height: 100%;
.app-dr-tab {
.dr-tab-item {
cursor: pointer;
padding: 0 16px;
&.is-active,
&:hover {
color: #2d8cf0;
}
&.is-active {
position: relative;
}
&.is-active::after {
content: '';
width: 100%;
height: 2px;
background: #2d8cf0;
position: absolute;
left: 0px;
bottom: 0px;
}
}
}
// this is less
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册