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

chitanda 发布系统代码 [TrainSys,网页端]

上级 1395dae0
...@@ -101,7 +101,7 @@ export default defineComponent({ ...@@ -101,7 +101,7 @@ export default defineComponent({
return null; return null;
} }
return h('ViewShell', { return h('ViewShell', {
props: { attrs: {
context: this.viewData.context, context: this.viewData.context,
params: this.viewData.params, params: this.viewData.params,
modelPath: this.viewData.viewPath, modelPath: this.viewData.viewPath,
......
import { IViewProvider } from '@ibiz-template/controller'; import { IViewProvider } from '@ibiz-template/controller';
import { ModelUtil } from '@ibiz-template/model'; import { ModelUtil } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util'; import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, PropType, ref } from 'vue'; import { computed, defineComponent, PropType, ref } from 'vue';
import '@ibiz-template/theme/style/components/view-shell/view-shell.scss'; import '@ibiz-template/theme/style/components/view-shell/view-shell.scss';
import { IModal } from '@ibiz-template/runtime'; import { IModal } from '@ibiz-template/runtime';
...@@ -24,18 +24,23 @@ export const ViewShell = defineComponent({ ...@@ -24,18 +24,23 @@ export const ViewShell = defineComponent({
const ns = useNamespace('view-shell'); const ns = useNamespace('view-shell');
// 路由绘制的视图,添加一个上下文isRouter // 路由绘制的视图,添加一个上下文isRouter
const cloneContext = props.context.clone(); const cloneContext = computed(() => {
cloneContext.isRouter = props.isRouter === true; const temp = props.context.clone();
temp.isRouter = props.isRouter === true;
return temp;
});
return { ns, provider, cloneContext }; return { ns, provider, cloneContext };
}, },
render(h) { render(h) {
if (this.provider) { if (this.provider) {
const opts = { const opts = {
...this.$vnode.data, attrs: {
...this.$props,
...this.$attrs,
context: this.cloneContext,
},
on: this.$listeners, on: this.$listeners,
}; };
opts.props!.context = this.cloneContext;
return h('AppTransition', {}, [h(this.provider.component, opts)]); return h('AppTransition', {}, [h(this.provider.component, opts)]);
} }
return ( return (
......
...@@ -62,7 +62,7 @@ export const EditView3 = defineComponent({ ...@@ -62,7 +62,7 @@ export const EditView3 = defineComponent({
{!this.c.isNewData && {!this.c.isNewData &&
this.lazyList.includes(page.source.name) && this.lazyList.includes(page.source.name) &&
h('ViewShell', { h('ViewShell', {
props: { attrs: {
context: drPage.context, context: drPage.context,
params: drPage.params, params: drPage.params,
modal: { mode: ViewMode.EMBED }, modal: { mode: ViewMode.EMBED },
......
...@@ -93,7 +93,7 @@ export const ListExpView = defineComponent({ ...@@ -93,7 +93,7 @@ export const ListExpView = defineComponent({
} }
// 非路由模式下绘制嵌入视图 // 非路由模式下绘制嵌入视图
return h('ViewShell', { return h('ViewShell', {
props: { attrs: {
context: this.c.navItem.context, context: this.c.navItem.context,
params: this.c.navItem.params, params: this.c.navItem.params,
modal: { mode: ViewMode.EMBED }, modal: { mode: ViewMode.EMBED },
......
...@@ -10,8 +10,8 @@ import { ...@@ -10,8 +10,8 @@ import {
computed, computed,
defineComponent, defineComponent,
getCurrentInstance, getCurrentInstance,
h,
PropType, PropType,
h,
ref, ref,
} from 'vue'; } from 'vue';
import './tab-exp-view.scss'; import './tab-exp-view.scss';
...@@ -105,6 +105,8 @@ export const TabExpView = defineComponent({ ...@@ -105,6 +105,8 @@ export const TabExpView = defineComponent({
return Object.values(c.tabExpPages).map(item => item.key); return Object.values(c.tabExpPages).map(item => item.key);
}); });
const embedViewModal = { mode: ViewMode.EMBED };
return { return {
c, c,
ns, ns,
...@@ -113,6 +115,7 @@ export const TabExpView = defineComponent({ ...@@ -113,6 +115,7 @@ export const TabExpView = defineComponent({
deactivateAll, deactivateAll,
activeTab, activeTab,
keyHistory, keyHistory,
embedViewModal,
}; };
}, },
render() { render() {
...@@ -143,10 +146,10 @@ export const TabExpView = defineComponent({ ...@@ -143,10 +146,10 @@ export const TabExpView = defineComponent({
> >
{this.lazyList.includes(page.name) && {this.lazyList.includes(page.name) &&
h('ViewShell', { h('ViewShell', {
props: { attrs: {
context: this.c.context, context: this.c.context,
params: this.c.params, params: this.c.params,
modal: { mode: ViewMode.EMBED }, modal: this.embedViewModal,
modelPath: page.embedView.source.modelPath, modelPath: page.embedView.source.modelPath,
}, },
on: { on: {
......
...@@ -95,7 +95,7 @@ export const WFDynaEditView3 = defineComponent({ ...@@ -95,7 +95,7 @@ export const WFDynaEditView3 = defineComponent({
{!this.c.isNewData && {!this.c.isNewData &&
this.lazyList.includes(page.source.name) && this.lazyList.includes(page.source.name) &&
h('ViewShell', { h('ViewShell', {
props: { attrs: {
context: drPage.context, context: drPage.context,
params: drPage.params, params: drPage.params,
modal: { mode: ViewMode.EMBED }, modal: { mode: ViewMode.EMBED },
......
...@@ -34,7 +34,7 @@ export const ViewPortlet = defineComponent({ ...@@ -34,7 +34,7 @@ export const ViewPortlet = defineComponent({
return ( return (
<portlet-layout controller={this.controller} class={classArr}> <portlet-layout controller={this.controller} class={classArr}>
{h('ViewShell', { {h('ViewShell', {
props: { attrs: {
context: c.viewContext, context: c.viewContext,
params: c.params, params: c.params,
modal: { mode: ViewMode.EMBED }, modal: { mode: ViewMode.EMBED },
......
...@@ -50,7 +50,7 @@ export const FormDRUIPart = defineComponent({ ...@@ -50,7 +50,7 @@ export const FormDRUIPart = defineComponent({
class={this.ns.b()} class={this.ns.b()}
> >
{h('ViewShell', { {h('ViewShell', {
props: { attrs: {
context: this.$props.controller.context, context: this.$props.controller.context,
params: this.$props.controller.params, params: this.$props.controller.params,
modal: this.modal, modal: this.modal,
......
...@@ -79,7 +79,7 @@ export const GridFieldColumn = defineComponent({ ...@@ -79,7 +79,7 @@ export const GridFieldColumn = defineComponent({
) : ( ) : (
<span class={this.ns.e('text')}> <span class={this.ns.e('text')}>
{fieldValue} {fieldValue}
{fieldValue && c.model.unitName} {fieldValue != null && c.model.unitName}
</span> </span>
)} )}
</div> </div>
......
...@@ -34,7 +34,7 @@ export const PickupViewPanel = defineComponent({ ...@@ -34,7 +34,7 @@ export const PickupViewPanel = defineComponent({
return; return;
} }
return h('ViewShell', { return h('ViewShell', {
props: { attrs: {
context: this.c.context, context: this.c.context,
params: this.c.params, params: this.c.params,
modal: this.modal, modal: this.modal,
......
...@@ -34,7 +34,7 @@ export const ViewPanel = defineComponent({ ...@@ -34,7 +34,7 @@ export const ViewPanel = defineComponent({
return; return;
} }
return h('ViewShell', { return h('ViewShell', {
props: { attrs: {
context: this.c.context, context: this.c.context,
params: this.c.params, params: this.c.params,
modal: this.modal, modal: this.modal,
......
...@@ -15,7 +15,7 @@ export function createOverlayView( ...@@ -15,7 +15,7 @@ export function createOverlayView(
): (_h: CreateElement) => VNode { ): (_h: CreateElement) => VNode {
return (h: CreateElement) => return (h: CreateElement) =>
h('ViewShell', { h('ViewShell', {
props, attrs: props,
on: { on: {
neuronInit: (neuron: ViewNeuron) => { neuronInit: (neuron: ViewNeuron) => {
neuron.evt.on('closeView', (res: IModalData) => { neuron.evt.on('closeView', (res: IModalData) => {
......
...@@ -54,6 +54,9 @@ export default defineComponent({ ...@@ -54,6 +54,9 @@ export default defineComponent({
const route = useRoute(instance.proxy); const route = useRoute(instance.proxy);
const ru = (route.query.ru as string) || '/'; const ru = (route.query.ru as string) || '/';
ibiz.appData = undefined;
ibiz.orgData = undefined;
onMounted(() => { onMounted(() => {
setTimeout(() => { setTimeout(() => {
const el = document.querySelector('.app-loading-x') as HTMLDivElement; const el = document.querySelector('.app-loading-x') as HTMLDivElement;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册