提交 3863424e 编写于 作者: ibizdev's avatar ibizdev

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

上级 fc283393
......@@ -12,12 +12,12 @@
},
"dependencies": {
"@ibiz-template/command": "^0.0.1-alpha.26",
"@ibiz-template/controller": "^0.0.1-alpha.30",
"@ibiz-template/core": "^0.0.1-alpha.26",
"@ibiz-template/model": "^0.0.1-alpha.30",
"@ibiz-template/runtime": "^0.0.1-alpha.30",
"@ibiz-template/service": "^0.0.1-alpha.30",
"@ibiz-template/vue-util": "^0.0.1-alpha.30",
"@ibiz-template/controller": "^0.0.1-alpha.31",
"@ibiz-template/core": "^0.0.1-alpha.31",
"@ibiz-template/model": "^0.0.1-alpha.31",
"@ibiz-template/runtime": "^0.0.1-alpha.31",
"@ibiz-template/service": "^0.0.1-alpha.31",
"@ibiz-template/vue-util": "^0.0.1-alpha.31",
"@ibiz/dynamic-model-api": "^2.0.9",
"dayjs": "^1.11.5",
"lodash-es": "^4.17.21",
......
......@@ -4,12 +4,12 @@ specifiers:
'@commitlint/cli': ^17.1.2
'@commitlint/config-conventional': ^17.1.0
'@ibiz-template/command': ^0.0.1-alpha.26
'@ibiz-template/controller': ^0.0.1-alpha.30
'@ibiz-template/core': ^0.0.1-alpha.26
'@ibiz-template/model': ^0.0.1-alpha.30
'@ibiz-template/runtime': ^0.0.1-alpha.30
'@ibiz-template/service': ^0.0.1-alpha.30
'@ibiz-template/vue-util': ^0.0.1-alpha.30
'@ibiz-template/controller': ^0.0.1-alpha.31
'@ibiz-template/core': ^0.0.1-alpha.31
'@ibiz-template/model': ^0.0.1-alpha.31
'@ibiz-template/runtime': ^0.0.1-alpha.31
'@ibiz-template/service': ^0.0.1-alpha.31
'@ibiz-template/vue-util': ^0.0.1-alpha.31
'@ibiz/dynamic-model-api': ^2.0.9
'@types/lodash-es': ^4.17.6
'@types/node': ^18.11.2
......@@ -58,12 +58,12 @@ specifiers:
dependencies:
'@ibiz-template/command': 0.0.1-alpha.26
'@ibiz-template/controller': 0.0.1-alpha.30_cm6rfgvoilj3otiiydoaeyhi4y
'@ibiz-template/core': 0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/runtime': 0.0.1-alpha.30_jstzc3nbzfdfx7sbj6qxe5d25y
'@ibiz-template/service': 0.0.1-alpha.30_3sv6oulpenonet4krwvpqjwohm
'@ibiz-template/vue-util': 0.0.1-alpha.30_qy4tkzse36mrtls6bwkvuk7lky
'@ibiz-template/controller': 0.0.1-alpha.31_mb6zdts2egzaqarwlbxotwhlqm
'@ibiz-template/core': 0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/runtime': 0.0.1-alpha.31_ryjbal2im3vvuc5nrjeivkvchi
'@ibiz-template/service': 0.0.1-alpha.31_ksxswwwwdvkjw3siuxtphhdbie
'@ibiz-template/vue-util': 0.0.1-alpha.31_5pxlirdqbtlzw2utfixhkqv66u
'@ibiz/dynamic-model-api': 2.0.9_qx-util@0.4.3
dayjs: 1.11.5
lodash-es: 4.17.21
......@@ -659,8 +659,8 @@ packages:
qx-util: 0.4.3
dev: false
/@ibiz-template/controller/0.0.1-alpha.30_cm6rfgvoilj3otiiydoaeyhi4y:
resolution: {integrity: sha512-IjC85wWdDas4mp91XtsuNFZ6cQz6T12OqLozUhkzHveYo2iSPCo53TO6W1TPh5V7kZUXuQoxxnKJWrNLGdezJw==}
/@ibiz-template/controller/0.0.1-alpha.31_mb6zdts2egzaqarwlbxotwhlqm:
resolution: {integrity: sha512-j1O0w+VHlTknTvGTFM8cIPRpapIte3cFL/x6RVf5Tsy47FplE7M2xkDW6XNfJWQazWQ6gG3kLjNxqQDRZ4JUGw==}
peerDependencies:
'@ibiz-template/core': ^0.0.1-alpha.2
'@ibiz-template/model': ^0.0.1-alpha.2
......@@ -669,18 +669,18 @@ packages:
lodash-es: ^4.17.21
qx-util: ^0.4.1
dependencies:
'@ibiz-template/core': 0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/runtime': 0.0.1-alpha.30_jstzc3nbzfdfx7sbj6qxe5d25y
'@ibiz-template/service': 0.0.1-alpha.30_3sv6oulpenonet4krwvpqjwohm
'@ibiz-template/core': 0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/runtime': 0.0.1-alpha.31_ryjbal2im3vvuc5nrjeivkvchi
'@ibiz-template/service': 0.0.1-alpha.31_ksxswwwwdvkjw3siuxtphhdbie
async-validator: 4.2.5
dayjs: 1.11.5
lodash-es: 4.17.21
qx-util: 0.4.3
dev: false
/@ibiz-template/core/0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike:
resolution: {integrity: sha512-B6R+zDnLspxknJ26wdjDvQQ9Snko0ext54oOyxj7agqNZg8UJs4EviYytxFjQv2awa7ts0TwvaGjLpSCoBBr8g==}
/@ibiz-template/core/0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike:
resolution: {integrity: sha512-R8dHwo2MvOVURnzRPHjCmCr93O1AeCoeRD3sMDQ6QcNJtwIfTaY5Nx7GWk1Tp9a6hxps6GNk8JZYyM2hHqKyWA==}
peerDependencies:
lodash-es: ^4.17.21
qx-util: ^0.4.1
......@@ -694,8 +694,8 @@ packages:
- debug
dev: false
/@ibiz-template/model/0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74:
resolution: {integrity: sha512-5PuihYg30/McNoCxzjTlsccV2P2ttKiRbkps7GNU9DX9XgVeQe1pkBMN1UCKtcEO5/yFiwVxtqjEDqhXVXHxGQ==}
/@ibiz-template/model/0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74:
resolution: {integrity: sha512-uGmeph/mbIQJZ2yeCWuzPwro6vd/sKma4keUIYe5yqfuwHbon5TWl8fDN1DGWRnzImAJONuggjVLhWsgZ4iLbg==}
peerDependencies:
'@ibiz/dynamic-model-api': ^2.0.8
lodash-es: ^4.17.21
......@@ -707,8 +707,8 @@ packages:
qx-util: 0.4.3
dev: false
/@ibiz-template/runtime/0.0.1-alpha.30_jstzc3nbzfdfx7sbj6qxe5d25y:
resolution: {integrity: sha512-cCQIbZYztpx2repMVV6KkbltY5k54ssI78HeuOSxNsUpIxdfkU1Va+3WH1PiCyCq7937Vsv0rqAVyPmZX6TbZQ==}
/@ibiz-template/runtime/0.0.1-alpha.31_ryjbal2im3vvuc5nrjeivkvchi:
resolution: {integrity: sha512-dIFMzMH737nv7RO/DHY/X3MqhEb7oMBTHPNQgZuheHqL9aSMlPqVD2S/orWPxdPyrmC7hZkSielbaQiTxtQ3BQ==}
peerDependencies:
'@ibiz-template/core': ^0.0.1-alpha.2
'@ibiz-template/model': ^0.0.1-alpha.2
......@@ -716,28 +716,28 @@ packages:
qx-util: ^0.4.1
dependencies:
'@ibiz-template/command': 0.0.1-alpha.26
'@ibiz-template/core': 0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/service': 0.0.1-alpha.30_3sv6oulpenonet4krwvpqjwohm
'@ibiz-template/core': 0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/service': 0.0.1-alpha.31_ksxswwwwdvkjw3siuxtphhdbie
qx-util: 0.4.3
dev: false
/@ibiz-template/service/0.0.1-alpha.30_3sv6oulpenonet4krwvpqjwohm:
resolution: {integrity: sha512-6W/qtydi04w9Mo3UfHna1qlle+t/JfWFYQsgXfgyziRQNSuKiu916l/SIN6LrQgDY0BEgCH5P5L5VkhjNEyRsQ==}
/@ibiz-template/service/0.0.1-alpha.31_ksxswwwwdvkjw3siuxtphhdbie:
resolution: {integrity: sha512-eymmaVPsmN9cUWW1zuqfnMSaFg1h2G99NGjTd3l6Ug2mXt6g7R6OlsREsl5aSuJGXKBVY3I0sSBugb8QYFhViQ==}
peerDependencies:
'@ibiz-template/core': ^0.0.1-alpha.2
'@ibiz-template/model': ^0.0.1-alpha.2
qx-util: ^0.4.1
ramda: ^0.28.0
dependencies:
'@ibiz-template/core': 0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/core': 0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74
qx-util: 0.4.3
ramda: 0.28.0
dev: false
/@ibiz-template/vue-util/0.0.1-alpha.30_qy4tkzse36mrtls6bwkvuk7lky:
resolution: {integrity: sha512-jC6VvIEPlptn1LjWgxDw2k+fkwIiuZsCJHaiZq7UrcZUZhLzaq/A8Ft09xoIRi6Ha4BmmorMYJuBI0wK8cm3xQ==}
/@ibiz-template/vue-util/0.0.1-alpha.31_5pxlirdqbtlzw2utfixhkqv66u:
resolution: {integrity: sha512-I15e95KcYRBcTFlYK3Qla/J3RhVrJCiySwnweFKw0616y5CCCtctuazLU2KFzfsNN7nrlqS21xxVq1IA/zaLqg==}
peerDependencies:
'@ibiz-template/controller': '>=0.0.1-alpha.2'
'@ibiz-template/core': '>=0.0.1-alpha.2'
......@@ -747,9 +747,9 @@ packages:
vue: ^2.7.13
vue-router: ^3.6.5
dependencies:
'@ibiz-template/controller': 0.0.1-alpha.30_cm6rfgvoilj3otiiydoaeyhi4y
'@ibiz-template/core': 0.0.1-alpha.26_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.30_nsblaymxhwib2tpyzxqzaxas74
'@ibiz-template/controller': 0.0.1-alpha.31_mb6zdts2egzaqarwlbxotwhlqm
'@ibiz-template/core': 0.0.1-alpha.31_t3cuerihxu3byfhypp2kwscike
'@ibiz-template/model': 0.0.1-alpha.31_nsblaymxhwib2tpyzxqzaxas74
qs: 6.11.0
qx-util: 0.4.3
vue: 2.7.13
......
......@@ -9,6 +9,7 @@ import UserRegister from './user-register';
import {
AppLayout,
ControlLayout,
MDViewBase,
ViewBase,
ViewLayout,
} from './components/layout';
......@@ -37,6 +38,8 @@ import {
DashboardControl,
PortletContainer,
PortletPart,
ListControl,
ListPortlet,
} from './components/widgets';
import {
EditView,
......@@ -89,7 +92,6 @@ import AppFileUploadRowPreview from './components/editor/app-file-upload-row-pre
import AppImageUpload from './components/editor/app-image-upload/app-image-upload';
import NotSupportedEditor from './components/editor/not-supported-editor/not-supported-editor';
import { presetAllProviders } from './provider';
import { MDViewBase } from './components/layout/md-view-base/md-view-base';
export const AppRegister = {
install(v: VueConstructor) {
......@@ -123,6 +125,7 @@ export const AppRegister = {
// 注册部件组件
v.component('AppMenu', AppMenu);
v.component('GridControl', GridControl);
v.component('ListControl', ListControl);
v.component('GridColumn', GridColumn);
v.component('GridUaColumn', GridUAColumn);
v.component('GridFieldColumn', GridFieldColumn);
......@@ -143,6 +146,7 @@ export const AppRegister = {
v.component('PickupViewPanel', PickupViewPanel);
v.component('DashboardControl', DashboardControl);
v.component('PortletPart', PortletPart);
v.component('ListPortlet', ListPortlet);
v.component('PortletContainer', PortletContainer);
// 注册通用组件
v.component('AppKeepAlive', AppKeepAlive);
......
......@@ -3,10 +3,11 @@ import type { PropType } from 'vue';
import { CheckBoxListEditorController } from '@ibiz-template/controller';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-check-box-list/ibiz-check-box-list.scss';
import { isNil } from 'ramda';
export default defineComponent({
props: {
value: String,
value: [String, Number],
controller: {
type: CheckBoxListEditorController,
required: true,
......@@ -51,10 +52,13 @@ export default defineComponent({
// 选中数组
const selectArray = computed({
get() {
if (props.value) {
if (!isNil(props.value)) {
if (Object.is(currentMode.value, 'num') && items) {
const selectsArray: Array<string | number> = [];
const num: number = parseInt(props.value, 10);
const num: number =
typeof props.value === 'string'
? parseInt(props.value, 10)
: props.value;
items.value.forEach((item: IData) => {
// eslint-disable-next-line no-bitwise
if ((num & item.value) === item.value) {
......@@ -64,10 +68,11 @@ export default defineComponent({
return selectsArray;
}
if (Object.is(currentMode.value, 'str')) {
if (props.value !== '') {
const strVal = props.value! as String;
if (strVal !== '') {
if (codeList) {
const selects: Array<string | number> =
props.value.split(valueSeparator);
strVal.split(valueSeparator);
if (codeList.codeItemValueNumber) {
for (let i = 0, len = selects.length; i < len; i++) {
selects[i] = Number(selects[i]);
......@@ -75,7 +80,7 @@ export default defineComponent({
}
return selects;
}
return props.value.split(',');
return strVal.split(',');
}
}
}
......@@ -85,11 +90,11 @@ export default defineComponent({
let value: null | string | number | string[] = null;
if (Object.is(currentMode.value, 'num')) {
let temp: number = 0;
val.forEach((item: unknown) => {
if (typeof item === 'string') {
val.forEach(item => {
const numVal: number =
typeof item === 'string' ? parseInt(item, 10) : item;
// eslint-disable-next-line no-bitwise
temp |= parseInt(item, 10);
}
temp |= numVal;
});
value = temp;
} else if (Object.is(currentMode.value, 'str')) {
......
import { AppLayout } from './app-layout/app-layout';
import ControlLayout from './control-layout/control-layout';
import { ViewBase } from './view-base/view-base';
import { MDViewBase } from './md-view-base/md-view-base';
import { ViewLayout } from './view-layout/view-layout';
export { AppLayout, ControlLayout, ViewLayout, ViewBase };
export { AppLayout, ControlLayout, ViewLayout, ViewBase, MDViewBase };
import { AppMenuPortletController } from '@ibiz-template/controller';
import { AppMenuPortletModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
export const AppMenuPortlet = defineComponent({
name: 'AppMenuPortlet',
props: {
modelData: {
type: AppMenuPortletModel,
required: true,
},
controller: {
type: AppMenuPortletController,
required: true,
},
},
setup() {
const ns = useNamespace('app-menu-portlet');
return { ns };
},
render() {
const classArr: string[] = [
this.ns.b(),
this.ns.m(this.modelData.modelClass),
];
const header: unknown = null;
return (
<div class={classArr}>
{header}
<div class={[this.ns.b('content')]}>{this.modelData.modelClass}</div>
</div>
);
},
});
......@@ -21,7 +21,13 @@ function renderPortletByType(
c: DashboardController,
opts?: IData,
): VNode {
const provider = c.providers[model.source.name];
const provider = c.providers[model.name];
const controller = c.portlets[model.name];
const commonProps = {
modelData: model,
controller,
};
// 绘制容器
if (model.source.portletType === 'CONTAINER') {
const container = model as ContainerPortletModel;
......@@ -29,18 +35,20 @@ function renderPortletByType(
provider.compName,
{
props: {
modelData: model,
...commonProps,
},
key: model.id,
},
container.children.map(child => renderPortletByType(child, c, opts)),
);
}
// 绘制门户部件
return h(provider.compName, {
props: {
modelData: model,
...commonProps,
},
key: model.id,
});
}
......@@ -83,7 +91,7 @@ export const DashboardControl = defineComponent({
return (
<app-col
layoutPos={child.source.getPSLayoutPos()}
controller={{}}
controller={this.c.portlets[child.name].layoutController}
>
{renderPortletByType(child, this.c)}
</app-col>
......
export * from './portlet-part/portlet-part';
export * from './portlet-container/portlet-container';
export * from './app-menu-portlet/app-menu-portlet';
export * from './list-portlet/list-portlet';
export * from './dashboard-control';
import { ListNeuron, ListPortletController } from '@ibiz-template/controller';
import { ListPortletModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
export const ListPortlet = defineComponent({
name: 'ListPortlet',
props: {
modelData: {
type: ListPortletModel,
required: true,
},
controller: {
type: ListPortletController,
required: true,
},
},
setup() {
const ns = useNamespace('list-portlet');
return { ns };
},
render() {
const c = this.controller;
const classArr: string[] = [
this.ns.b(),
this.ns.m(this.modelData.modelClass),
];
const header: unknown = null;
return (
<div class={classArr}>
{header}
<div class={[this.ns.b('content')]}>
<list-control
modelData={c.model.list}
context={c.context}
params={c.params}
on-neuronInit={(neuron: ListNeuron) => {
c.setListNeuron(neuron);
}}
></list-control>
</div>
</div>
);
},
});
import { ContainerPortletController } from '@ibiz-template/controller';
import { ContainerPortletModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, VNode } from 'vue';
......@@ -9,6 +10,10 @@ export const PortletContainer = defineComponent({
type: ContainerPortletModel,
required: true,
},
controller: {
type: ContainerPortletController,
required: true,
},
},
setup() {
const ns = useNamespace('portlet-container');
......@@ -25,7 +30,7 @@ export const PortletContainer = defineComponent({
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
controller={{}}
controller={props.controller.layoutController}
>
{slot}
</app-col>
......
import { PortletPartController } from '@ibiz-template/controller';
import { PortletPartModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
......@@ -9,6 +10,10 @@ export const PortletPart = defineComponent({
type: PortletPartModel,
required: true,
},
controller: {
type: PortletPartController,
required: true,
},
},
setup() {
const ns = useNamespace('portlet-part');
......
......@@ -14,6 +14,7 @@ import {
PropType,
CreateElement,
VNode,
computed,
} from 'vue';
import '@/styles/components/widgets/form/form.scss';
......@@ -36,7 +37,7 @@ function renderByDetailType(
}
const commonProps = {
modelData: detail,
controller: controller.details[detail.source.name],
controller: computed(() => controller.details[detail.source.name]),
};
const provider = controller.providers[detail.source.name];
if (!provider) {
......
......@@ -40,7 +40,7 @@ export const FormGroupPanel = defineComponent({
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
controller={props.controller.layoutController}
controller={props.controller.value.layoutController}
>
{slot}
</app-col>
......
......@@ -42,7 +42,7 @@ export default defineComponent({
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
controller={props.controller.layoutController}
controller={props.controller.value.layoutController}
>
{slot}
</app-col>
......
......@@ -38,7 +38,7 @@ export default defineComponent({
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
controller={props.controller.layoutController}
controller={props.controller.value.layoutController}
>
{slot}
</app-col>
......
......@@ -2,6 +2,7 @@ export * from './form-control';
export * from './edit-form-control/edit-form-control';
export * from './search-form-control/search-form-control';
export * from './grid-control';
export * from './list-control/list-control';
export * from './pickup-view-panel/pickup-view-panel';
export * from './view-panel/view-panel';
export * from './app-menu/app-menu';
......
import { IBizContext } from '@ibiz-template/core';
import { ListModel } from '@ibiz-template/model';
import { useListController, useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
export const ListControl = defineComponent({
name: 'ListControl',
props: {
modelData: {
type: ListModel,
required: true,
},
context: {
type: IBizContext,
required: true,
},
params: { type: Object as PropType<IParams>, default: () => ({}) },
},
setup(props) {
const { proxy } = getCurrentInstance()!;
const ns = useNamespace('list');
const c = useListController(
proxy,
props.modelData,
props.context,
props.params,
);
return { c, ns };
},
render() {
if (!this.c.complete) {
return;
}
return (
<control-layout modelData={this.c.model}>
{this.c.items.map(item => {
return <div>{`${item.srfmajortext}:${item.srfkey}`}</div>;
})}
</control-layout>
);
},
});
......@@ -12,6 +12,7 @@ import {
NotificationUtil,
LoadingUtil,
ErrorHandler,
PluginFactory,
} from './util';
import { piniaInstance } from './store';
import { attachEnvironmentConfig } from './attach-environment-config';
......@@ -57,6 +58,7 @@ async function createApp(): Promise<void> {
ibiz.modal = new ModalUtil();
ibiz.notification = new NotificationUtil();
ibiz.loading = new LoadingUtil();
ibiz.plugin = new PluginFactory();
},
router,
pinia: piniaInstance,
......
import {
ActionBarPortletController,
ContainerPortletController,
DashboardController,
IPortletPartProvider,
} from '@ibiz-template/controller';
......@@ -19,10 +20,12 @@ export class ActionBarPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ActionBarPortletController> {
const c = new ActionBarPortletController(
portletModel as ActionBarPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
AppMenuPortletController,
ContainerPortletController,
DashboardController,
IPortletPartProvider,
} from '@ibiz-template/controller';
......@@ -19,10 +20,12 @@ export class AppMenuPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<AppMenuPortletController> {
const c = new AppMenuPortletController(
portletModel as AppMenuPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ChartPortletController,
ContainerPortletController,
DashboardController,
IPortletPartProvider,
} from '@ibiz-template/controller';
......@@ -19,10 +20,12 @@ export class ChartPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ChartPortletController> {
const c = new ChartPortletController(
portletModel as ChartPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
......@@ -19,10 +19,12 @@ export class ContainerPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ContainerPortletController> {
const c = new ContainerPortletController(
portletModel as ContainerPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
CustomPortletController,
DashboardController,
IPortletPartProvider,
......@@ -19,10 +20,12 @@ export class CustomPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<CustomPortletController> {
const c = new CustomPortletController(
portletModel as CustomPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
DashboardController,
HtmlPortletController,
IPortletPartProvider,
......@@ -19,10 +20,12 @@ export class HtmlPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<HtmlPortletController> {
const c = new HtmlPortletController(
portletModel as HtmlPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
DashboardController,
IPortletPartProvider,
ListPortletController,
......@@ -14,15 +15,17 @@ import { ListPortletModel, PortletPartModel } from '@ibiz-template/model';
* @class ListPortletProvider
*/
export class ListPortletProvider implements IPortletPartProvider {
compName: string = 'PortletPart';
compName: string = 'ListPortlet';
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ListPortletController> {
const c = new ListPortletController(
portletModel as ListPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
DashboardController,
IPortletPartProvider,
RawItemPortletController,
......@@ -19,10 +20,12 @@ export class RawItemPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<RawItemPortletController> {
const c = new RawItemPortletController(
portletModel as RawItemPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
DashboardController,
IPortletPartProvider,
ToolbarPortletController,
......@@ -19,10 +20,12 @@ export class ToolbarPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ToolbarPortletController> {
const c = new ToolbarPortletController(
portletModel as ToolbarPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
import {
ContainerPortletController,
DashboardController,
IPortletPartProvider,
ViewPortletController,
......@@ -19,10 +20,12 @@ export class ViewPortletProvider implements IPortletPartProvider {
async createController(
portletModel: PortletPartModel,
dashboard: DashboardController,
parent?: ContainerPortletController,
): Promise<ViewPortletController> {
const c = new ViewPortletController(
portletModel as ViewPortletModel,
dashboard,
parent,
);
await c.init();
return c;
......
......@@ -7,3 +7,4 @@ export { ErrorHandler } from './error-handler/error-handler';
export * from './component-name';
export { AppModal } from './open-view-util/app-modal/app-modal';
export { AppDrawer } from './open-view-util/app-drawer/app-drawer';
export { PluginFactory } from './plugin-factory/plugin-factory';
import { RuntimeError } from '@ibiz-template/core';
import { IPluginFactory } from '@ibiz-template/runtime';
import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz/dynamic-model-api';
import Vue from 'vue';
/**
* 插件工具类
*
* @author chitanda
* @date 2022-10-21 16:10:29
* @export
* @class PluginFactory
*/
export class PluginFactory implements IPluginFactory {
async loadPlugin(plugin: IPSSysPFPlugin): Promise<void> {
if (plugin.runtimeObject === true) {
const pluginRef = plugin as unknown as IPSAppPFPluginRef;
if (pluginRef) {
const code = pluginRef.templCode;
if (code) {
const module = await System.import(code);
if (module) {
if (module.default) {
Vue.use(module.default);
} else {
throw new RuntimeError(
`远程插件加载失败, 远程插件未找到[default]默认导出`,
);
}
} else {
throw new RuntimeError(`远程插件加载失败, 未找到文件`);
}
}
}
}
}
}
......@@ -492,47 +492,47 @@
dependencies:
qx-util "0.4.3"
"@ibiz-template/controller@^0.0.1-alpha.30":
version "0.0.1-alpha.30"
resolved "https://registry.yarnpkg.com/@ibiz-template/controller/-/controller-0.0.1-alpha.30.tgz#003eead45148de75b626065684d66ae06c089284"
integrity sha512-IjC85wWdDas4mp91XtsuNFZ6cQz6T12OqLozUhkzHveYo2iSPCo53TO6W1TPh5V7kZUXuQoxxnKJWrNLGdezJw==
"@ibiz-template/controller@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/controller/-/controller-0.0.1-alpha.31.tgz#44be1271216ec78c10633b4477132f7c5209439b"
integrity sha512-j1O0w+VHlTknTvGTFM8cIPRpapIte3cFL/x6RVf5Tsy47FplE7M2xkDW6XNfJWQazWQ6gG3kLjNxqQDRZ4JUGw==
dependencies:
async-validator "^4.2.5"
dayjs "^1.11.5"
"@ibiz-template/core@^0.0.1-alpha.26":
version "0.0.1-alpha.26"
resolved "https://registry.yarnpkg.com/@ibiz-template/core/-/core-0.0.1-alpha.26.tgz#9a080177053607abe3c768f89bee577193fe3622"
integrity sha512-B6R+zDnLspxknJ26wdjDvQQ9Snko0ext54oOyxj7agqNZg8UJs4EviYytxFjQv2awa7ts0TwvaGjLpSCoBBr8g==
"@ibiz-template/core@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/core/-/core-0.0.1-alpha.31.tgz#e0d7472a5e42f5fe64b3c9b3270ae537d7f15258"
integrity sha512-R8dHwo2MvOVURnzRPHjCmCr93O1AeCoeRD3sMDQ6QcNJtwIfTaY5Nx7GWk1Tp9a6hxps6GNk8JZYyM2hHqKyWA==
dependencies:
axios "^1.1.3"
pluralize "^8.0.0"
qs "^6.11.0"
"@ibiz-template/model@^0.0.1-alpha.30":
version "0.0.1-alpha.30"
resolved "https://registry.yarnpkg.com/@ibiz-template/model/-/model-0.0.1-alpha.30.tgz#34cc9a35da1fd45179a57987ed422e9d46f05c91"
integrity sha512-5PuihYg30/McNoCxzjTlsccV2P2ttKiRbkps7GNU9DX9XgVeQe1pkBMN1UCKtcEO5/yFiwVxtqjEDqhXVXHxGQ==
"@ibiz-template/model@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/model/-/model-0.0.1-alpha.31.tgz#b150e65c07fcd5d94fdcaa818c30bf67a5c866d3"
integrity sha512-uGmeph/mbIQJZ2yeCWuzPwro6vd/sKma4keUIYe5yqfuwHbon5TWl8fDN1DGWRnzImAJONuggjVLhWsgZ4iLbg==
dependencies:
"@ibiz/dynamic-model-api" "^2.0.9"
pluralize "^8.0.0"
"@ibiz-template/runtime@^0.0.1-alpha.30":
version "0.0.1-alpha.30"
resolved "https://registry.yarnpkg.com/@ibiz-template/runtime/-/runtime-0.0.1-alpha.30.tgz#607892920c450db43159f051310efc18c9aa600e"
integrity sha512-cCQIbZYztpx2repMVV6KkbltY5k54ssI78HeuOSxNsUpIxdfkU1Va+3WH1PiCyCq7937Vsv0rqAVyPmZX6TbZQ==
"@ibiz-template/runtime@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/runtime/-/runtime-0.0.1-alpha.31.tgz#d4ec6a2b4427c5fab67719758de7b3af8f50b8b8"
integrity sha512-dIFMzMH737nv7RO/DHY/X3MqhEb7oMBTHPNQgZuheHqL9aSMlPqVD2S/orWPxdPyrmC7hZkSielbaQiTxtQ3BQ==
dependencies:
"@ibiz-template/command" "^0.0.1-alpha.26"
"@ibiz-template/service@^0.0.1-alpha.30":
version "0.0.1-alpha.30"
resolved "https://registry.yarnpkg.com/@ibiz-template/service/-/service-0.0.1-alpha.30.tgz#09cc6602c5a34d375a9ed1c22765b103c670bc56"
integrity sha512-6W/qtydi04w9Mo3UfHna1qlle+t/JfWFYQsgXfgyziRQNSuKiu916l/SIN6LrQgDY0BEgCH5P5L5VkhjNEyRsQ==
"@ibiz-template/service@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/service/-/service-0.0.1-alpha.31.tgz#5d4f0dfa5e3e21ba3427576d056fc74cb5411b44"
integrity sha512-eymmaVPsmN9cUWW1zuqfnMSaFg1h2G99NGjTd3l6Ug2mXt6g7R6OlsREsl5aSuJGXKBVY3I0sSBugb8QYFhViQ==
"@ibiz-template/vue-util@^0.0.1-alpha.30":
version "0.0.1-alpha.30"
resolved "https://registry.yarnpkg.com/@ibiz-template/vue-util/-/vue-util-0.0.1-alpha.30.tgz#f93a4634d14ff44accd68005293ffb7b0bab6f44"
integrity sha512-jC6VvIEPlptn1LjWgxDw2k+fkwIiuZsCJHaiZq7UrcZUZhLzaq/A8Ft09xoIRi6Ha4BmmorMYJuBI0wK8cm3xQ==
"@ibiz-template/vue-util@^0.0.1-alpha.31":
version "0.0.1-alpha.31"
resolved "https://registry.yarnpkg.com/@ibiz-template/vue-util/-/vue-util-0.0.1-alpha.31.tgz#97e70418c2536796fb49c1704d36c7af654c34cc"
integrity sha512-I15e95KcYRBcTFlYK3Qla/J3RhVrJCiySwnweFKw0616y5CCCtctuazLU2KFzfsNN7nrlqS21xxVq1IA/zaLqg==
"@ibiz/dynamic-model-api@^2.0.9":
version "2.0.9"
......
......@@ -50,7 +50,7 @@
</changeSet>
<!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-281-3">
<changeSet author="root" id="tab-book-283-3">
<createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column>
......
......@@ -1063,6 +1063,7 @@
"name" : "运行时部件(出来)",
"pluginCode" : "runtime_widget_out",
"pluginType" : "CUSTOM",
"rTObjectName" : "runtime_widget_out",
"refMode" : "CONTROL",
"refTag" : "FORM",
"templCode" : "<template>\n <div class='messagecolor'>{{message}}</div>\n</template>\n<script>\nexport default {\n data() {\n return {\n message:'示例-出来'\n }\n },\n}\n</script>\n<style>\n.messagecolor{\n color:red;\n}\n</style>",
......@@ -1072,6 +1073,7 @@
"name" : "运行时部件(未出来)",
"pluginCode" : "runtime_widget_not_out",
"pluginType" : "CUSTOM",
"rTObjectName" : "runtime_widget_not_out",
"refMode" : "CONTROL",
"refTag" : "FORM",
"templCode" : "<template>\n <div class='messagecolor'>{{message}}</div>\n</template>\n<script>\nexport default {\n data() {\n return {\n message:'示例-未出来'\n }\n },\n}\n</script>\n<style>\n.messagecolor{\n color:red;\n}\n</style>",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册