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

chitanda 发布系统代码

上级 aa091410
...@@ -18,6 +18,15 @@ export class ViewBase extends Vue { ...@@ -18,6 +18,15 @@ export class ViewBase extends Vue {
*/ */
public viewState: Subject<ViewState> = new Subject(); public viewState: Subject<ViewState> = new Subject();
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected appDeName: string = '';
/** /**
* 数据变化 * 数据变化
* *
...@@ -413,27 +422,28 @@ export class ViewBase extends Vue { ...@@ -413,27 +422,28 @@ export class ViewBase extends Vue {
if (this.$store.getters.getAppData() && this.$store.getters.getAppData().context) { if (this.$store.getters.getAppData() && this.$store.getters.getAppData().context) {
Object.assign(this.context, this.$store.getters.getAppData().context); Object.assign(this.context, this.$store.getters.getAppData().context);
} }
this.handleCustomViewData(); } else {
return; const path = (this.$route.matched[this.$route.matched.length - 1]).path;
} const keys: Array<any> = [];
const path = (this.$route.matched[this.$route.matched.length - 1]).path; const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const keys: Array<any> = []; const matchArray = curReg.exec(this.$route.path);
const curReg = this.$pathToRegExp.pathToRegexp(path, keys); const tempValue: Object = {};
const matchArray = curReg.exec(this.$route.path); keys.forEach((item: any, index: number) => {
const tempValue: Object = {}; Object.defineProperty(tempValue, item.name, {
keys.forEach((item: any, index: number) => { enumerable: true,
Object.defineProperty(tempValue, item.name, { value: matchArray[index + 1]
enumerable: true, });
value: matchArray[index + 1]
}); });
}); this.$viewTool.formatRouteParams(tempValue, this.$route, this.context, this.viewparams);
this.$viewTool.formatRouteParams(tempValue, this.$route, this.context, this.viewparams); if (this.$store.getters.getAppData() && this.$store.getters.getAppData().context) {
if (this.$store.getters.getAppData() && this.$store.getters.getAppData().context) { Object.assign(this.context, this.$store.getters.getAppData().context);
Object.assign(this.context, this.$store.getters.getAppData().context); }
if (this.isDeView) {
this.context.srfsessionid = this.$util.createUUID();
}
} }
if (this.isDeView) { if (this.isDeView && !isEmpty(this.appDeName)) {
//初始化视图唯一标识 this.context.srfappdename = this.appDeName;
Object.assign(this.context, { srfsessionid: this.$util.createUUID() });
} }
this.handleCustomViewData(); this.handleCustomViewData();
} }
......
...@@ -188,7 +188,6 @@ export class ControlBase extends Vue { ...@@ -188,7 +188,6 @@ 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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册