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

chitanda 发布系统代码

上级 04c40a22
...@@ -11,6 +11,51 @@ ...@@ -11,6 +11,51 @@
.separator { .separator {
padding: 0px 6px; padding: 0px 6px;
} }
.select {
.ivu-select {
width: auto;
color: var(--app-header-color);
.ivu-select-selection {
height: 20px;
background-color: transparent;
border: 0;
.ivu-select-selected-value {
padding-left: 0;
padding-right: 12px;
height: 18px;
line-height: 18px;
}
.ivu-select-arrow {
right: 0;
}
}
.ivu-select-dropdown {
background-color: var(--app-header-background-color);
.ivu-select-dropdown-list {
.ivu-select-item {
padding: 5px 10px;
color: var(--app-header-color);
}
.ivu-select-item:hover, .ivu-select-item.ivu-select-item-focus {
background: var(--app-header-background-color-active);
}
.ivu-select-item.ivu-select-item-selected {
color: var(--app-header-font-color-active);
}
}
}
}
}
} }
.app-breadcrumb-item:hover { .app-breadcrumb-item:hover {
......
import { Vue, Component } from 'vue-property-decorator'; import { Vue, Component } from 'vue-property-decorator';
import qs from 'qs';
import { AppService } from '@/studio-core/service/app-service/AppService'; import { AppService } from '@/studio-core/service/app-service/AppService';
import { HistoryItem } from '@/studio-core/service/app-nav-history/AppNavHistoryBase';
import './app-breadcrumb.less'; import './app-breadcrumb.less';
/** /**
...@@ -54,6 +56,43 @@ export class AppBreadcrumb extends Vue { ...@@ -54,6 +56,43 @@ export class AppBreadcrumb extends Vue {
location.reload(); location.reload();
} }
/**
* 根据下标从父导航查询是否有列表数据
*
* @protected
* @param {number} i
* @memberof AppBreadcrumb
*/
protected getItems(i: number): any[] | null {
if (i > 0) {
const item = this.$appService.navHistory.historyList[i - 1];
const c = item.context;
const data = c[c.srfdatakey];
if (data && data.items) {
return data.items;
}
}
return null;
}
protected itemChange(c: any, history: HistoryItem, val: any): void {
const to = history.to;
to.params[c.srfappdename] = val;
let path = '';
history.meta.parameters.forEach((item: any) => {
const pam = to.params[item.parameterName];
path += (`/${item.pathName}` + (pam ? `/${pam}` : ''));
});
if (to.query && Object.keys(to.query).length > 0) {
path += ('?' + qs.stringify(to.query));
}
this.$router.push(path);
if (to.fullPath !== path) {
this.$appService.navHistory.pop();
}
this.$forceUpdate();
}
/** /**
* 绘制面包屑 * 绘制面包屑
* *
...@@ -70,9 +109,20 @@ export class AppBreadcrumb extends Vue { ...@@ -70,9 +109,20 @@ export class AppBreadcrumb extends Vue {
} }
const arr = this.appService.navHistory.historyList; const arr = this.appService.navHistory.historyList;
arr.forEach((item, i) => { arr.forEach((item, i) => {
const list = this.getItems(i);
let dropdown: any = null;
if (list && list.length > 0) {
const c = item.context;
dropdown = <i-select v-model={c[c.srfappdename]} on-on-change={(val: any) => this.itemChange(c, item, val)} size="small">
{list.map((item: any) => {
return <i-option value={item.srfkey} key={item.srfkey}>{item.srfmajortext}</i-option>;
})}
</i-select>;
}
items.push(<span class={{ 'app-breadcrumb-item': true, 'last': i === (arr.length - 1) }}> items.push(<span class={{ 'app-breadcrumb-item': true, 'last': i === (arr.length - 1) }}>
{(!indexMeta && i === 0) ? null : <span class="separator">/</span>} {(!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 class="content" on-click={() => this.click(item.to)}>{this.$t(item.meta?.caption)}{dropdown ? null : (item.meta?.info && item.meta?.info !== '') ? ` - ${item.meta?.info}` : ''}</span>
{dropdown ? <span class="select"> - {dropdown}</span> : null}
</span>); </span>);
}); });
return <div class="app-breadcrumb">{items}</div>; return <div class="app-breadcrumb">{items}</div>;
......
...@@ -141,7 +141,9 @@ export class AppNavHistoryBase { ...@@ -141,7 +141,9 @@ export class AppNavHistoryBase {
} }
this.historyList.push({ this.historyList.push({
to, to,
meta: Util.deepCopy(to.meta) meta: Util.deepCopy(to.meta),
tag: '',
context: {}
}); });
} }
} }
......
...@@ -72,7 +72,7 @@ export class ViewBase extends Vue { ...@@ -72,7 +72,7 @@ export class ViewBase extends Vue {
* @type {*} * @type {*}
* @memberof ViewBase * @memberof ViewBase
*/ */
public context: any = {}; public readonly context: any = {};
/** /**
* 视图参数 * 视图参数
......
...@@ -188,6 +188,7 @@ export class ControlBase extends Vue { ...@@ -188,6 +188,7 @@ export class ControlBase extends Vue {
* @memberof ControlBase * @memberof ControlBase
*/ */
public mounted(): void { public mounted(): void {
this.context.srfappdename = this.appDeName;
this.ctrlMounted(); this.ctrlMounted();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册