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

chitanda 发布系统代码

上级 4af99cf6
......@@ -60,21 +60,32 @@ export class AppBreadcrumb extends Vue {
* 根据下标从父导航查询是否有列表数据
*
* @protected
* @param {number} i
* @param {string} [tag]
* @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;
protected getItems(tag?: string): any[] | null {
if (tag) {
const view = this.$appService.viewStore.findParentByTag(tag);
if (view) {
const c = view.context;
const data = c[c.srfdatakey];
if (data && data.items) {
return data.items;
}
}
}
return null;
}
/**
* 选中数据变更
*
* @protected
* @param {*} c
* @param {HistoryItem} history
* @param {*} val
* @memberof AppBreadcrumb
*/
protected itemChange(c: any, history: HistoryItem, val: any): void {
const to = history.to;
to.params[c.srfappdename] = val;
......@@ -111,7 +122,8 @@ export class AppBreadcrumb extends Vue {
arr.forEach((item, i) => {
let dropdown: any = null;
if (arr.length === (i + 1)) {
const list = this.getItems(i);
const list = this.getItems(item.tag);
console.log(list);
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">
......
......@@ -40,4 +40,29 @@ export class AppViewStoreBase {
this.viewList.pop();
}
}
/**
* 根据视图标识查找
*
* @param {string} tag
* @returns {*}
* @memberof AppViewStoreBase
*/
public findByTag(tag: string): any {
return this.viewList.find((item: any) => item.viewtag === tag);
}
/**
* 根据视图标识查找父
*
* @param {string} tag
* @returns {*}
* @memberof AppViewStoreBase
*/
public findParentByTag(tag: string): any {
const i = this.viewList.findIndex((item: any) => item.viewtag === tag);
if (i !== -1 && i > 0) {
return this.viewList[i - 1];
}
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册