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

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

上级 5f23e537
......@@ -13,13 +13,13 @@
"dependencies": {
"@floating-ui/dom": "^1.0.11",
"@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.109",
"@ibiz-template/core": "^0.0.1-beta.109",
"@ibiz-template/model": "^0.0.1-beta.109",
"@ibiz-template/runtime": "^0.0.1-beta.109",
"@ibiz-template/service": "^0.0.1-beta.109",
"@ibiz-template/theme": "^0.0.1-beta.109",
"@ibiz-template/vue-util": "^0.0.1-beta.109",
"@ibiz-template/controller": "^0.0.1-beta.110",
"@ibiz-template/core": "^0.0.1-beta.110",
"@ibiz-template/model": "^0.0.1-beta.110",
"@ibiz-template/runtime": "^0.0.1-beta.110",
"@ibiz-template/service": "^0.0.1-beta.110",
"@ibiz-template/theme": "^0.0.1-beta.110",
"@ibiz-template/vue-util": "^0.0.1-beta.110",
"@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.7",
......
此差异已折叠。
......@@ -87,6 +87,7 @@ import {
ImagePreview,
CodeList,
TabPageExp,
ViewMessage,
} from './components/common';
// 编辑器组件
import {
......@@ -202,6 +203,7 @@ export const AppRegister = {
v.component('CodeList', CodeList);
v.component('PortletLayout', PortletLayout);
v.component('TabPageExp', TabPageExp);
v.component('ViewMessage', ViewMessage);
// 注册编辑器组件
v.component('GridEditor', GridEditor);
v.component('IBizSpan', IBizSpan);
......
......@@ -13,6 +13,7 @@ import { WfVersionSelect } from './wf-version-select/wf-version-select';
import { ExtendActionTimeLine } from './extend-action-timeline/extend-action-timeline';
import { ExtendActionGrid } from './extend-action-grid/extend-action-grid';
import { TabPageExp } from './tab-page-exp/tab-page-exp';
import { ViewMessage } from './view-message/view-message';
export { ImagePreview } from './image-preview/image-preview';
export { DataImport } from './data-import/data-import';
......@@ -36,4 +37,5 @@ export {
ExtendActionTimeLine,
ExtendActionGrid,
TabPageExp,
ViewMessage,
};
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
import '@ibiz-template/theme/style/components/common/app-icon/app-icon.scss';
import { IViewMessage } from '@ibiz-template/controller';
export const ViewMessage = defineComponent({
name: 'ViewMessage',
props: {
messages: {
type: Array<IViewMessage>,
},
},
setup() {
const ns = useNamespace('view-message');
const getType = (messageType?: string): string => {
switch (messageType) {
case 'WARN':
return 'warning';
case 'ERROR':
return 'error';
default:
return 'info';
}
};
return { ns, getType };
},
render() {
if (!this.messages?.length) {
return null;
}
return (
<div class={[this.ns.b()]}>
{this.messages?.map(message => {
return (
<i-alert
type={this.getType(message.messageType)}
closable={message.removeMode !== 0}
>
{message.title}
{message.message && (
<template slot='desc'>{message.message}</template>
)}
</i-alert>
);
})}
</div>
);
},
});
......@@ -10,10 +10,25 @@ export const ViewBase = defineComponent({
required: true,
},
},
setup() {
setup(props) {
const ns = useNamespace('view');
return { ns };
const renderViewMessage = () => {
const messageSlots: IData = {};
if (props.controller.complete) {
['TOP', 'BOTTOM', 'BODY'].forEach(position => {
const viewMessages = props.controller.viewMessages[position];
if (viewMessages?.length) {
messageSlots[`${position.toLowerCase()}Message`] = () => {
return <view-message messages={viewMessages}></view-message>;
};
}
});
}
return messageSlots;
};
return { ns, renderViewMessage };
},
render() {
const c = this.controller;
......@@ -76,6 +91,7 @@ export const ViewBase = defineComponent({
}
return null;
},
...this.renderViewMessage(),
...inheritSlots,
}}
/>
......
......@@ -49,6 +49,9 @@ export const ViewLayout = defineComponent({
]}
>
{this.isLoading ? <i-spin size='large' fix></i-spin> : null}
<div class={this.ns.be('top', 'message')}>
{this.$scopedSlots.topMessage && this.$scopedSlots.topMessage({})}
</div>
{this.isShowHeader ? (
<div key='header' class={this.ns.b('header')}>
<div class={this.ns.b('header-content')}>
......@@ -74,7 +77,6 @@ export const ViewLayout = defineComponent({
) : null}
{this.$scopedSlots.searchForm && this.$scopedSlots.searchForm({}) && (
<div key='top' class={this.ns.b('top')}>
<div class={this.ns.be('top', 'message')}></div>
<div class={this.ns.be('top', 'search-form')}>
{this.$scopedSlots.searchForm && this.$scopedSlots.searchForm({})}
</div>
......@@ -83,15 +85,23 @@ export const ViewLayout = defineComponent({
<div key='content' class={this.ns.b('content')}>
<div class={this.ns.be('content', 'left')}></div>
<div class={this.ns.be('content', 'body')}>
<div class={this.ns.be('body', 'message')}>
{this.$scopedSlots.bodyMessage &&
this.$scopedSlots.bodyMessage({})}
</div>
{this.$scopedSlots.default && this.$scopedSlots.default({})}
</div>
<div class={this.ns.be('content', 'right')}></div>
</div>
{this.$scopedSlots.footer && (
{this.$scopedSlots.footer || this.$scopedSlots.bottomMessage ? (
<div key='footer' class={this.ns.b('footer')}>
<div class={this.ns.be('bottom', 'message')}>
{this.$scopedSlots.bottomMessage &&
this.$scopedSlots.bottomMessage({})}
</div>
{this.$scopedSlots.footer && this.$scopedSlots.footer({})}
</div>
)}
) : null}
</div>
);
},
......
......@@ -46,6 +46,7 @@ import {
Badge,
Progress,
Poptip,
Alert,
} from 'view-design';
const components = [
......@@ -66,6 +67,7 @@ const components = [
Content,
Submenu,
Avatar,
Alert,
DropdownMenu,
Page,
Spin,
......
......@@ -24,19 +24,48 @@ export class ModalUtil implements IModalUtil {
protected modal: ModalInstance = Vue.prototype.$Modal;
async info(params: ModalParams): Promise<void> {
this.modal.info(convertParams(params));
return new Promise(resolve => {
this.modal.info({
...convertParams(params),
onOk: () => {
resolve();
},
});
});
}
async success(params: ModalParams): Promise<void> {
this.modal.success(convertParams(params));
return new Promise(resolve => {
this.modal.success({
...convertParams(params),
onOk: () => {
resolve();
},
});
});
}
async warning(params: ModalParams): Promise<void> {
this.modal.warning(convertParams(params));
return new Promise(resolve => {
this.modal.success({
...convertParams(params),
onOk: () => {
resolve();
},
});
});
}
async error(params: ModalParams): Promise<void> {
this.modal.error(convertParams(params));
return new Promise(resolve => {
this.modal.error({
...convertParams(params),
onOk: () => {
resolve();
},
});
});
}
async confirm(params: ModalParams): Promise<boolean> {
......
......@@ -353,11 +353,14 @@
"name" : "formitem2",
"noPrivDisplayMode" : 1,
"getPSEditor" : {
"editorType" : "PICTURE",
"maxFileCount" : -1,
"maxFileSize" : -1,
"minFileCount" : 0,
"name" : "formitem2"
"editorParams" : {
"PICKUPVIEW" : "TRUE"
},
"editorType" : "LISTBOXPICKUP",
"name" : "formitem2",
"enableAC" : false,
"forceSelection" : true,
"showTrigger" : true
},
"getPSLayoutPos" : {
"colMD" : 24,
......
......@@ -631,11 +631,14 @@
"name" : "formitem2",
"noPrivDisplayMode" : 1,
"getPSEditor" : {
"editorType" : "PICTURE",
"maxFileCount" : -1,
"maxFileSize" : -1,
"minFileCount" : 0,
"name" : "formitem2"
"editorParams" : {
"PICKUPVIEW" : "TRUE"
},
"editorType" : "LISTBOXPICKUP",
"name" : "formitem2",
"enableAC" : false,
"forceSelection" : true,
"showTrigger" : true
},
"getPSLayoutPos" : {
"colMD" : 24,
......
......@@ -9366,10 +9366,10 @@
"codeName" : "VMGroup3",
"name" : "视图消息类型测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息类型-常规信息",
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
"id" : "ViewMsg5"
}
}, {
"name" : "消息类型-错误信息",
......@@ -9378,10 +9378,10 @@
"id" : "ViewMsg6"
}
}, {
"name" : "消息类型-警告信息",
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg5"
"id" : "ViewMsg4"
}
} ]
}, {
......@@ -9398,40 +9398,45 @@
"codeName" : "VMGroup4",
"name" : "视图消息位置测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-弹出",
"name" : "消息位置-视图上方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg10"
"id" : "ViewMsg7"
}
}, {
"name" : "消息位置-视图方",
"name" : "消息位置-视图方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg7"
"id" : "ViewMsg8"
}
}, {
"name" : "消息位置-视图内容区",
"name" : "消息位置-弹出",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
"id" : "ViewMsg10"
}
}, {
"name" : "消息位置-视图下方",
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
"id" : "ViewMsg9"
}
} ]
}, {
"codeName" : "VMGroup8",
"name" : "【静态测试】",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "消息类型-错误信息",
"name" : "消息位置-视图内容区",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
},
"position" : "POPUP"
"id" : "ViewMsg9"
}
}, {
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
}, {
"name" : "消息类型-警告信息",
"getPSAppViewMsg" : {
......@@ -9440,53 +9445,42 @@
},
"position" : "POPUP"
}, {
"name" : "关闭模式-无删除-上方-常规",
"name" : "关闭模式-本次删除-上方-警告",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg11"
"id" : "ViewMsg13"
}
}, {
"name" : "消息类型-常规信息",
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg4"
"id" : "ViewMsg6"
},
"position" : "POPUP"
}, {
"name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
}, {
"name" : "消息位置-视图内容区",
"name" : "消息位置-视图下方",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg9"
"id" : "ViewMsg8"
}
}, {
"name" : "关闭模式-本次删除-上方-警告",
"name" : "消息类型-常规信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg13"
}
"id" : "ViewMsg4"
},
"position" : "POPUP"
}, {
"name" : "消息位置-视图下方",
"name" : "关闭模式-无删除-上方-常规",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg8"
"id" : "ViewMsg11"
}
} ]
}, {
"codeName" : "VMGroup5",
"name" : "视图消息关闭模式",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "关闭模式-默认删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
}, {
"name" : "关闭模式-本次删除",
"getPSAppViewMsg" : {
"modelref" : true,
......@@ -9498,21 +9492,27 @@
"modelref" : true,
"id" : "ViewMsg11"
}
}, {
"name" : "关闭模式-默认删除",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg12"
}
} ]
}, {
"codeName" : "VMGroup6",
"name" : "视图消息动态模式测试",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "动态模式-实体数据集",
"name" : "动态模式-静态内容",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg14"
"id" : "ViewMsg15"
}
}, {
"name" : "动态模式-静态内容",
"name" : "动态模式-实体数据集",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg15"
"id" : "ViewMsg14"
}
} ]
} ],
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册