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

chitanda 发布系统代码

上级 7ec5cea7
......@@ -252,8 +252,9 @@ export default class EditViewEngine extends ViewEngine {
if(this.view.$route){
this.view.$route.meta.info = info;
}
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)} - ${viewdata.dataInfo}`;
this.view.$emit('viewModelChange', this.view.model.srfTitle);
const title = this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)} - ${viewdata.dataInfo}`;
this.view.$emit('viewModelChange', title);
this.view.$appService.navHistory.setCaption({ route: this.view.$route, info: viewdata.dataInfo });
}
}
......
......@@ -431,6 +431,7 @@ export class AccountInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -431,6 +431,7 @@ export class ContactInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class InvoiceInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class CampaignInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -114,6 +114,7 @@ export class IBizListInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class ProductInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class CompetitorInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -114,6 +114,7 @@ export class GoalInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -431,6 +431,7 @@ export class LeadInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -465,6 +465,7 @@ export class OpportunityInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class QuoteInfoBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class SalesLiteratureInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -362,6 +362,7 @@ export class SalesOrderInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
......@@ -114,6 +114,7 @@ export class IncidentInfoViewBase extends TabExpViewBase {
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
......
.app-breadcrumb {
margin-left: 50px;
.app-breadcrumb-item {
cursor: pointer;
.content {
color: rgba(var(--app-header-color-rgb), 0.65);
}
.separator {
padding: 0px 6px;
}
}
.app-breadcrumb-item:hover {
.content {
color: var(--app-header-font-color-active);
}
}
.app-breadcrumb-item.last {
cursor: unset;
.content {
color: var(--app-header-color);
}
}
}
\ No newline at end of file
import { Vue, Component } from 'vue-property-decorator';
import { AppService } from '@/studio-core/service/app-service/AppService';
import './app-breadcrumb.less';
/**
* 面包屑导航组件
*
* @export
* @class AppBreadcrumb
* @extends {Vue}
*/
@Component({})
export class AppBreadcrumb extends Vue {
/**
* 应用服务(单例)
*
* @protected
* @type {AppService}
* @memberof AppHeader
*/
protected appService: AppService = new AppService();
/**
* 跳转点击
*
* @protected
* @param {*} to
* @memberof AppBreadcrumb
*/
protected click(to: any) {
const i = this.$appService.navHistory.findHistoryIndex(to);
this.$router.push({ path: to.path, params: to.params, query: to.query });
this.$appService.navHistory.reset(i + 1);
}
/**
* 跳转首页
*
* @protected
* @param {*} meta
* @memberof AppBreadcrumb
*/
protected toIndex(meta: any): void {
let path = '';
if (meta && meta.parameters) {
meta.parameters.forEach((item: any) => {
const val = this.$route.params[item.parameterName];
path += `/${item.pathName}${val ? `/${val}` : ''}`;
});
}
this.$router.push(path);
this.$appService.navHistory.reset();
location.reload();
}
/**
* 绘制面包屑
*
* @returns {*}
* @memberof AppBreadcrumb
*/
public render(): any {
const items: any[] = [];
const indexMeta = this.appService.navHistory.indexMeta;
if (indexMeta) {
items.push(<span class="app-breadcrumb-item">
<span class="content" on-click={() => this.toIndex(indexMeta)}>首页</span>
</span>);
}
const arr = this.appService.navHistory.historyList;
arr.forEach((item, i) => {
items.push(<span class={{ 'app-breadcrumb-item': true, 'last': i === (arr.length - 1) }}>
{(!indexMeta && i === 0) ? null : <span class="separator">/</span>}
<span class="content" on-click={() => this.click(item.to)}>{this.$t(item.meta?.caption)}{(item.meta?.info && item.meta?.info !== '') ? ` - ${item.meta?.info}` : ''}</span>
</span>);
});
return <div class="app-breadcrumb">{items}</div>;
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ export class AppHeader extends Vue {
return <div class="app-header">
<div class="app-header-left">
{this.$slots.header_left}
{Object.is(this.$uiState.layoutState.styleMode, 'STYLE2') ? <app-breadcrumb></app-breadcrumb> : null}
</div>
<div class="app-header-center">
{this.$slots.header_content}
......
......@@ -64,6 +64,7 @@ import { AppContentLeftExp } from './components/layout/app-content-left-exp/app-
import { AppContentLeftNavMenu } from './components/layout/app-content-left-nav-menu/app-content-left-nav-menu';
import { AppContentBottomExp } from './components/layout/app-content-bottom-exp/app-content-bottom-exp';
import { AppFooter } from './components/layout/app-footer/app-footer';
import { AppBreadcrumb } from './components/app-breadcrumb/app-breadcrumb';
import { MenuIcon } from './components/menu-icon/menu-icon';
import { UserInfo } from './components/user-info/user-info';
import { StudioViewStyle2 } from './components/studio-view-style2/studio-view-style2';
......@@ -101,6 +102,7 @@ export const StudioCore = {
v.component('app-content-left-nav-menu', AppContentLeftNavMenu);
v.component('app-content-bottom-exp', AppContentBottomExp);
v.component('app-footer', AppFooter);
v.component('app-breadcrumb', AppBreadcrumb);
v.component('menu-icon', MenuIcon);
v.component('user-info', UserInfo);
v.component('studio-view-style2', StudioViewStyle2);
......
......@@ -90,13 +90,12 @@ export class AppNavHistoryBase {
/**
* 查找路由缓存
*
* @protected
* @param {*} page
* @param {any[]} [list=this.historyList]
* @returns {number}
* @memberof AppNavHistoryBase
*/
protected findHistoryIndex(page: any, list: any[] = this.historyList): number {
public findHistoryIndex(page: any, list: any[] = this.historyList): number {
if (page === undefined || page === null) {
return -1;
}
......@@ -177,13 +176,18 @@ export class AppNavHistoryBase {
* @returns {boolean}
* @memberof AppNavHistoryBase
*/
public setCaption({ route, caption, info }: { route: any, caption: string | null, info: string | null }): boolean {
public setCaption({ route, caption, info }: { route: any, caption?: string, info?: string }): boolean {
const i = this.findHistoryIndex(route);
if (i === -1) {
return false;
}
const item = this.historyList[i];
Object.assign(item.meta, { caption, info });
if (caption) {
item.meta.caption = caption;
}
if (info) {
item.meta.info = info;
}
return true;
}
......
......@@ -170,7 +170,7 @@ export class EditFormControlBase extends FormControlBase {
Object.assign(this.context, { [this.appDeName]: data[this.appDeName] })
}
// 更新上下文,当前数据视图数据
Object.assign(this.context, { [`src${this.appDeName}`]: { data } });
Object.assign(this.context, { [`src${this.appDeName}`]: { data }, [`srfdatakey`]: `srf${this.appDeName}` });
this.setFormEnableCond(data);
this.fillForm(data, action);
this.oldData = {};
......
......@@ -439,7 +439,7 @@ export class GridControllerBase extends MDControlBase {
this.items.forEach(() => { this.gridItemsModel.push(this.getGridRowModel()) });
this.$emit('load', this.items);
// 向上下文中填充当前数据
Object.assign(this.context, { [`srf${this.appDeName}`]: { items: this.items } });
Object.assign(this.context, { [`srf${this.appDeName}`]: { items: this.items }, [`srfdatakey`]: `srf${this.appDeName}` });
// 设置默认选中
setTimeout(() => {
if (this.isSelectFirstDefault) {
......
......@@ -55,7 +55,7 @@ export class CentralBase extends Vue {
console.warn('未指定应用功能');
}
if (judge) {
this.$appService.navHistory.reset(1);
this.$appService.navHistory.reset();
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册