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

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

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