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

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

上级 5dfc6ea8
......@@ -11,19 +11,20 @@
"lint:style": "stylelint 'src/**/*.scss'"
},
"dependencies": {
"@ibiz-template/command": "^0.0.1-alpha.33",
"@ibiz-template/controller": "^0.0.1-alpha.34",
"@ibiz-template/core": "^0.0.1-alpha.34",
"@ibiz-template/model": "^0.0.1-alpha.34",
"@ibiz-template/runtime": "^0.0.1-alpha.34",
"@ibiz-template/service": "^0.0.1-alpha.34",
"@ibiz-template/vue-util": "^0.0.1-alpha.34",
"@ibiz/dynamic-model-api": "^2.1.2",
"@ibiz-template/command": "^0.0.1-alpha.37",
"@ibiz-template/controller": "^0.0.1-alpha.38",
"@ibiz-template/core": "^0.0.1-alpha.38",
"@ibiz-template/model": "^0.0.1-alpha.37",
"@ibiz-template/runtime": "^0.0.1-alpha.38",
"@ibiz-template/service": "^0.0.1-alpha.38",
"@ibiz-template/theme": "^0.0.1-alpha.37",
"@ibiz-template/vue-util": "^0.0.1-alpha.38",
"@ibiz/dynamic-model-api": "^2.1.5",
"dayjs": "^1.11.6",
"lodash-es": "^4.17.21",
"pinia": "^2.0.23",
"qs": "^6.11.0",
"qx-util": "^0.4.3",
"qx-util": "^0.4.4",
"ramda": "^0.28.0",
"view-design": "^4.7.0",
"vue": "^2.7.13",
......@@ -33,13 +34,13 @@
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.11.4",
"@types/node": "^18.11.8",
"@types/qs": "^6.9.7",
"@types/ramda": "^0.28.18",
"@types/systemjs": "^6.1.1",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@vitejs/plugin-legacy": "^2.2.0",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"@vitejs/plugin-legacy": "^2.3.0",
"@vitejs/plugin-vue2": "^2.0.0",
"@vitejs/plugin-vue2-jsx": "^1.0.3",
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
......@@ -52,6 +53,7 @@
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"postcss": "^8.4.18",
"postcss-scss": "^4.0.5",
"prettier": "^2.7.1",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.55.0",
......@@ -59,17 +61,17 @@
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recess-order": "^3.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-config-standard-scss": "^6.0.0",
"stylelint-scss": "^4.3.0",
"terser": "^5.15.1",
"typescript": "^4.8.4",
"vite": "^3.1.8",
"vite": "^3.2.1",
"vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.0.9"
},
"lint-staged": {
"*.{ts,vue}": "eslint --fix",
"*.less": "stylelint --syntax=scss"
"*.scss": "stylelint --custom-syntax=postcss-scss"
}
}
此差异已折叠。
......@@ -4,4 +4,5 @@ pnpm link --global "@ibiz-template/runtime"
pnpm link --global "@ibiz-template/model"
pnpm link --global "@ibiz-template/core"
pnpm link --global "@ibiz-template/command"
pnpm link --global "@ibiz-template/controller"
\ No newline at end of file
pnpm link --global "@ibiz-template/controller"
pnpm link --global "@ibiz-template/theme"
\ No newline at end of file
......@@ -92,6 +92,7 @@ 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 { ViewShell } from './components/view-shell/view-shell';
export const AppRegister = {
install(v: VueConstructor) {
......@@ -108,6 +109,7 @@ export const AppRegister = {
v.component('ViewLayout', ViewLayout);
v.component('ViewBase', ViewBase);
v.component('MdViewBase', MDViewBase);
v.component('ViewShell', ViewShell);
// 注册视图组件
v.component('IndexView', IndexView);
v.component('GridView', GridView);
......
import { defineComponent, PropType } from 'vue';
import { IPSUIActionGroup, IPSUIActionGroupDetail } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/view-toolbar/view-toolbar.scss';
import { IButtonContainerState } from '@ibiz-template/controller';
import '@ibiz-template/theme/style/components/common/action-toolbar/action-toolbar.scss';
export const ActionToolbar = defineComponent({
name: 'ActionToolbar',
......@@ -40,9 +40,16 @@ export const ActionToolbar = defineComponent({
return (
<i-button
type='text'
size='small'
on-click={(e: MouseEvent) => this.handleClick(detail, e)}
disabled={this.actionsState[detail.name].disabled}
class={[this.ns.e('item'), this.ns.is('disabled', false)]}
class={[
this.ns.e('item'),
detail.addSeparator
? this.ns.em('item', 'separated')
: undefined,
this.ns.is('disabled', false),
]}
>
{detail.showIcon && action.getPSSysImage() && (
<app-icon icon={action.getPSSysImage()}></app-icon>
......
import { computed, defineComponent } from 'vue';
import '@/styles/components/common/app-grid-pagination/app-grid-pagination.scss';
import { useNamespace } from '@ibiz-template/vue-util';
import '@ibiz-template/theme/style/components/common/app-grid-pagination/app-grid-pagination.scss';
export const AppGridPagination = defineComponent({
name: 'AppGridPagination',
......
import { IPSSysImage } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, PropType, VNode, computed } from 'vue';
import '@/styles/components/common/app-icon/app-icon.scss';
import '@ibiz-template/theme/style/components/common/app-icon/app-icon.scss';
export const AppIcon = defineComponent({
name: 'AppIcon',
......
<script setup lang="ts">
import { ref } from 'vue';
import '@/styles/components/common/app-transition/app-transition.scss';
import '@ibiz-template/theme/style/components/common/app-transition/app-transition.scss';
const transName = ref('slide-right');
</script>
......
import { defineComponent } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/app-user/app-user.scss';
import '@ibiz-template/theme/style/components/common/app-user/app-user.scss';
export const AppUser = defineComponent({
name: 'AppUser',
......
/* eslint-disable no-param-reassign */
import { defineComponent, PropType, watch, Ref, ref } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/extend-action-grid/extend-action-grid.scss';
import dayjs from 'dayjs';
import { clone } from 'ramda';
import '@ibiz-template/theme/style/components/common/extend-action-grid/extend-action-grid.scss';
/**
* 办理人员名称显示去重
......
/* eslint-disable no-param-reassign */
import { defineComponent, PropType, watch, Ref, ref } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/extend-action-timeline/extend-action-timeline.scss';
import dayjs from 'dayjs';
import { clone } from 'ramda';
import '@ibiz-template/theme/style/components/common/extend-action-timeline/extend-action-timeline.scss';
/**
* 办理人员名称显示去重
......
import { computed, defineComponent, watch } from 'vue';
import { debounce } from 'lodash-es';
import { computed, defineComponent } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/quick-search/quick-search.scss';
import '@ibiz-template/theme/style/components/common/quick-search/quick-search.scss';
export const QuickSearch = defineComponent({
name: 'QuickSearch',
......@@ -19,7 +18,7 @@ export const QuickSearch = defineComponent({
},
setup(props, { emit }) {
const ns = useNamespace('quick-search');
const valu = computed({
const inputValue = computed({
get() {
return props.value;
},
......@@ -27,21 +26,15 @@ export const QuickSearch = defineComponent({
emit('update', val!);
},
});
const search = debounce(() => {
const search = () => {
emit('search');
}, 500);
};
const onChange = (e: InputEvent) => {
if (e.target) {
valu.value = (e.target as unknown as { value: string }).value;
inputValue.value = (e.target as unknown as { value: string }).value;
}
};
watch(
() => props.value,
() => {
search();
},
);
return { ns, valu, search, onChange };
return { ns, inputValue, search, onChange };
},
render() {
return (
......
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, onUnmounted, ref, watch } from 'vue';
import type { PropType } from 'vue';
import '@/styles/components/common/skeleton/skeleton-card/skeleton-card.scss';
import '@ibiz-template/theme/style/components/common/skeleton/skeleton-card/skeleton-card.scss';
export default defineComponent({
props: {
......
import { computed, defineComponent } from 'vue';
import type { PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/skeleton/skeleton-element/skeleton-element.scss';
import '@ibiz-template/theme/style/components/common/skeleton/skeleton-element/skeleton-element.scss';
export default defineComponent({
props: {
......
......@@ -17,7 +17,7 @@ import {
ToolbarNeuron,
} from '@ibiz-template/controller';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/view-toolbar/view-toolbar.scss';
import '@ibiz-template/theme/style/components/common/view-toolbar/view-toolbar.scss';
const btnContent = (item: IPSDEToolbarItem, viewMode: string) => {
const image = item.getPSSysImage();
......
import { defineComponent } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/wf-toolbar/wf-toolbar.scss';
import { WFLink } from '@ibiz-template/controller';
import '@ibiz-template/theme/style/components/common/wf-toolbar/wf-toolbar.scss';
export const WFToolbar = defineComponent({
name: 'WFToolbar',
......
import { defineComponent, ref, Ref } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/common/wf-version-select/wf-version-select.scss';
import '@ibiz-template/theme/style/components/common/wf-version-select/wf-version-select.scss';
export const WfVersionSelect = defineComponent({
name: 'WfVersionSelect',
......
......@@ -3,8 +3,8 @@ import { defineComponent, onMounted, ref, watch } from 'vue';
import type { PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import { getCookie } from 'qx-util';
import '@/styles/components/editor/app-image-upload/app-image-upload.scss';
import { RuntimeError } from '@ibiz-template/core';
import '@ibiz-template/theme/style/components/editor/app-image-upload/app-image-upload.scss';
export default defineComponent({
props: {
......
......@@ -2,8 +2,8 @@ import { computed, defineComponent, ref, watch } from 'vue';
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';
import '@ibiz-template/theme/style/components/editor/ibiz-check-box-list/ibiz-check-box-list.scss';
export default defineComponent({
props: {
......
import { DatePickerEditorController } from '@ibiz-template/controller';
import { ref, watch, defineComponent, PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-date-picker/ibiz-date-picker.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-date-picker/ibiz-date-picker.scss';
export const IBizDatePicker = defineComponent({
name: 'IBizDatePicker',
......
import { DropDownListEditorController } from '@ibiz-template/controller';
import { ref, Ref, defineComponent, PropType, computed } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-dropdown-list/ibiz-dropdown-list.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-dropdown-list/ibiz-dropdown-list.scss';
export const IBizDropDownList = defineComponent({
name: 'IBizDropDownList',
......
......@@ -2,8 +2,8 @@ import { UploadEditorController } from '@ibiz-template/controller';
import { getCookie } from 'qx-util';
import { onMounted, ref, Ref, watch, defineComponent, PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-file-upload/ibiz-file-upload.scss';
import { RuntimeError } from '@ibiz-template/core';
import '@ibiz-template/theme/style/components/editor/ibiz-file-upload/ibiz-file-upload.scss';
export const IBizFileUpload = defineComponent({
name: 'IBizFileUpload',
......
......@@ -3,7 +3,7 @@ import type { PropType } from 'vue';
import { TextBoxEditorController } from '@ibiz-template/controller';
import { debounce } from 'lodash-es';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-input-box/ibiz-input-box.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-input-box/ibiz-input-box.scss';
export default defineComponent({
props: {
......
import { PickerEditorController } from '@ibiz-template/controller';
import { ref, watch, Ref, defineComponent, PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-mpicker/ibiz-mpicker.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-mpicker/ibiz-mpicker.scss';
export const IBizMPicker = defineComponent({
name: 'IBizMPicker',
......
......@@ -3,7 +3,7 @@ import { ref, Ref, watch, defineComponent, PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import { debounce } from 'lodash-es';
import { isNil } from 'ramda';
import '@/styles/components/editor/ibiz-picker-dropdown/ibiz-picker-dropdown.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-picker-dropdown/ibiz-picker-dropdown.scss';
export const IBizPickerDropdown = defineComponent({
name: 'IBizPickerDropdown',
......@@ -85,7 +85,16 @@ export const IBizPickerDropdown = defineComponent({
const loading: Ref<boolean> = ref(false);
// 往外抛值
const onACSelect = (item: IData) => {
const onACSelect = async (item: IData) => {
// 处理回填数据
const dataItems = await c.calcFillDataItems(item);
if (dataItems.length) {
dataItems.forEach(dataItem => {
emit('change', dataItem.value, dataItem.name);
});
}
// 处理值项和本身的值
if (c.valueItem) {
emit('change', item[c.keyName], c.valueItem);
}
......@@ -152,6 +161,13 @@ export const IBizPickerDropdown = defineComponent({
// 清除
const onClear = () => {
// 清空回填数据
const dataItems = c.model.deACMode?.dataItems;
if (dataItems?.length) {
dataItems.forEach(dataItem => {
emit('change', null, dataItem.name);
});
}
if (c.valueItem) {
emit('change', null, c.valueItem);
}
......
......@@ -2,7 +2,7 @@ import { PickerEditorController } from '@ibiz-template/controller';
import { ref, watch, Ref, defineComponent, PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import { isEmpty } from 'ramda';
import '@/styles/components/editor/ibiz-picker/ibiz-picker.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-picker/ibiz-picker.scss';
export const IBizPicker = defineComponent({
name: 'IBizPicker',
......@@ -108,6 +108,13 @@ export const IBizPicker = defineComponent({
// 清除
const onClear = () => {
// 清空回填数据
const dataItems = c.model.deACMode?.dataItems;
if (dataItems?.length) {
dataItems.forEach(dataItem => {
emit('change', null, dataItem.name);
});
}
if (c.valueItem) {
emit('change', null, c.valueItem);
}
......
......@@ -2,7 +2,7 @@ import { RadioButtonListEditorController } from '@ibiz-template/controller';
import { computed, defineComponent, ref } from 'vue';
import type { PropType } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-radio-button-list/ibiz-radio-button-list.scss';
import '@ibiz-template/theme/style/components/editor/ibiz-radio-button-list/ibiz-radio-button-list.scss';
export default defineComponent({
props: {
......
......@@ -2,8 +2,8 @@ import { ref, defineComponent, Ref, watch } from 'vue';
import type { PropType } from 'vue';
import { SpanEditorController } from '@ibiz-template/controller';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/editor/ibiz-span/ibiz-span.scss';
import dayjs from 'dayjs';
import '@ibiz-template/theme/style/components/editor/ibiz-span/ibiz-span.scss';
export default defineComponent({
props: {
......
import { EditorModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
import '@/styles/components/editor/not-supported-editor/not-supported-editor.scss';
import '@ibiz-template/theme/style/components/editor/not-supported-editor/not-supported-editor.scss';
export default defineComponent({
props: {
......
import { defineComponent, ref } from 'vue';
import { IndexViewModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
// import { Icon, Layout } from 'view-design';
import '@/styles/components/layout/app-layout/app-layout.scss';
import { Namespace } from '@ibiz-template/core';
import '@ibiz-template/theme/style/components/layout/app-layout/app-layout.scss';
function renderLogo(ns: Namespace, model: IndexViewModel) {
return (
......@@ -40,12 +39,7 @@ export const AppLayout = defineComponent({
emit('onCollapseChange', collapseChange.value);
};
const onBackClick = (event: MouseEvent) => {
event.stopPropagation();
emit('backClick');
};
return { ns, collapseChange, collapseMenus, onBackClick };
return { ns, collapseChange, collapseMenus };
},
render() {
return this.isComplete ? (
......@@ -54,8 +48,10 @@ export const AppLayout = defineComponent({
>
<i-sider
hide-trigger
class={[this.ns.b('nav')]}
width={this.collapseChange ? 80 : 256}
class={[
this.ns.b('nav'),
this.ns.is('collapse', this.collapseChange),
]}
value={this.collapseChange}
>
{renderLogo(this.ns, this.model)}
......@@ -78,14 +74,6 @@ export const AppLayout = defineComponent({
/>
)}
</div>
<div
title='后退'
class={this.ns.be('header', 'back-icon')}
onClick={this.onBackClick}
>
<i-icon type='ios-arrow-dropleft' />
</div>
{this.model.source.mainMenuAlign === 'TOP' ? (
<i-menu
class={this.ns.be('header', 'menu')}
......
import { defineComponent } from 'vue';
import { ControlModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/layout/control-layout/control-layout.scss';
import '@ibiz-template/theme/style/components/layout/control-layout/control-layout.scss';
/**
* 部件布局
......
import { MDViewController, ViewController } from '@ibiz-template/controller';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, PropType } from 'vue';
import '@/styles/components/layout/view-base/view-base.scss';
import '@ibiz-template/theme/style/components/layout/view-base/view-base.scss';
export const ViewBase = defineComponent({
props: {
......@@ -44,12 +44,17 @@ export const ViewBase = defineComponent({
class={this.ns.be('caption', 'icon')}
icon={c.model.source.getPSSysImage()}
></app-icon>,
<span class={this.ns.be('caption', 'text')}>
<span
class={this.ns.be('caption', 'text')}
title={c.caption}
>
{c.caption}
</span>,
]
) : (
<span class={this.ns.be('caption', 'text')}>{c.caption}</span>
<span class={this.ns.be('caption', 'text')} title={c.caption}>
{c.caption}
</span>
)}
</div>
);
......
import { computed, defineComponent } from 'vue';
import { ViewModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/layout/view-layout/view-layout.scss';
import '@ibiz-template/theme/style/components/layout/view-layout/view-layout.scss';
export const ViewLayout = defineComponent({
name: 'ViewLayout',
......
......@@ -7,7 +7,6 @@ import {
useRouter,
} from '@ibiz-template/vue-util';
import { Route } from 'vue-router';
import { getViewComponentName } from '@/util';
export default defineComponent({
name: 'RouterShell',
......@@ -23,24 +22,20 @@ export default defineComponent({
const router = useRouter(proxy);
const viewData = ref<IRouteViewData>({});
const isLoaded = ref(false);
const viewComponentName = ref('');
// 根据应用模型解析视图参数
ModelUtil.getModelService().then(service => {
ModelUtil.getModelService().then(async service => {
const appModel = service.app;
if (appModel) {
// 获取视图
try {
viewData.value = parseRouteViewData(appModel, route, props.level);
// 确定视图组件
isLoaded.value = true;
ctx.emit('viewFound', { modelPath: viewData.value.viewPath });
} catch (error) {
router.replace(`/${route.params.view1}/404`);
}
// 确定视图组件
viewComponentName.value = getViewComponentName(
viewData.value.viewType!,
);
isLoaded.value = true;
ctx.emit('viewFound', { modelPath: viewData.value.viewPath });
}
});
......@@ -52,7 +47,6 @@ export default defineComponent({
route,
viewData,
isLoaded,
viewComponentName,
onNeuronInit,
};
},
......@@ -60,17 +54,15 @@ export default defineComponent({
if (!this.isLoaded) {
return null;
}
return h('AppTransition', {}, [
h(this.viewComponentName, {
props: {
context: this.viewData.context,
params: this.viewData.params,
modelPath: this.viewData.viewPath,
},
on: {
neuronInit: this.onNeuronInit,
},
}),
]);
return h('ViewShell', {
props: {
context: this.viewData.context,
params: this.viewData.params,
modelPath: this.viewData.viewPath,
},
on: {
neuronInit: this.onNeuronInit,
},
});
},
});
import { IViewProvider } from '@ibiz-template/controller';
import { ModelUtil } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, PropType, ref } from 'vue';
import '@ibiz-template/theme/style/components/view-shell/view-shell.scss';
export const ViewShell = defineComponent({
name: 'ViewShell',
props: {
context: Object as PropType<IContext>,
modelPath: { type: String, required: true },
},
setup(props) {
const provider = ref<IViewProvider>();
ModelUtil.getViewModel(props.modelPath, props.context).then(
async viewModel => {
provider.value = await ibiz.register.view.get(viewModel.source);
},
);
const ns = useNamespace('view-shell');
return { ns, provider };
},
render(h) {
if (this.provider) {
return h('AppTransition', {}, [
h(this.provider.compName, {
...this.$vnode.data,
on: this.$listeners,
}),
]);
}
return (
<div class={this.ns.b()}>
<i-spin size='large' fix></i-spin>
</div>
);
},
});
import { IModal } from '@ibiz-template/runtime';
import { useEditView3Controller, useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import { getViewComponentName } from '@/util';
import { defineComponent, getCurrentInstance, PropType, ref } from 'vue';
export const EditView3 = defineComponent({
props: {
......@@ -14,7 +13,13 @@ export const EditView3 = defineComponent({
const { proxy } = getCurrentInstance()!;
const c = useEditView3Controller(proxy, props.modelPath);
const ns = useNamespace('view-deeditview3');
return { c, ns };
const lazyList = ref(['mainForm']);
const onTabClick = (name: string) => {
if (!lazyList.value.includes(name)) {
lazyList.value.push(name);
}
};
return { c, ns, onTabClick, lazyList };
},
render(h) {
return (
......@@ -23,6 +28,7 @@ export const EditView3 = defineComponent({
<i-tabs
class={[this.ns.be('', 'tab')]}
name={this.c.model.drTab.source.name}
on-on-click={this.onTabClick}
>
<i-tab-pane
class={this.ns.be('', 'tab-item')}
......@@ -40,6 +46,10 @@ export const EditView3 = defineComponent({
></edit-form-control>
</i-tab-pane>
{[...this.c.model.drTab.pages.values()].map(page => {
const drPage = this.c.drPages[page.source.name];
if (!drPage) {
return;
}
return (
<i-tab-pane
class={this.ns.be('', 'tab-item')}
......@@ -49,17 +59,20 @@ export const EditView3 = defineComponent({
name={page.source.name}
>
{!this.c.isNewData &&
h(getViewComponentName(page.embedView.source.viewType), {
this.lazyList.includes(page.source.name) &&
h('ViewShell', {
props: {
context: this.c.drPages[page.source.name].context,
params: this.c.drPages[page.source.name].params,
context: drPage.context,
params: drPage.params,
modal: this.modal,
modelPath: page.embedView.source.modelPath,
// 流程跟踪视图用
deName: this.c.model.appEntity.source.codeName,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(page.source.name),
},
key: this.c.drPages[page.source.name].key,
key: drPage.key,
})}
</i-tab-pane>
);
......
......@@ -3,8 +3,8 @@ import {
useNamespace,
} from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType, Ref, ref } from 'vue';
import '@/styles/components/views/mpickup-view/mpickup-view.scss';
import { IModal } from '@ibiz-template/runtime';
import '@ibiz-template/theme/style/components/views/mpickup-view/mpickup-view.scss';
export const MPickupView = defineComponent({
props: {
......
import { IModal } from '@ibiz-template/runtime';
import { useNamespace, useOptViewController } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import '@/styles/components/views/opt-view/opt-view.scss';
import '@ibiz-template/theme/style/components/views/opt-view/opt-view.scss';
export const OptView = defineComponent({
props: {
......
......@@ -5,7 +5,7 @@ import {
useWFDynaActionViewController,
} from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import '@/styles/components/views/wf-dyna-action-view/wf-dyna-action-view.scss';
import '@ibiz-template/theme/style/components/views/wf-dyna-action-view/wf-dyna-action-view.scss';
export const WFDynaActionView = defineComponent({
props: {
......
......@@ -3,10 +3,9 @@ import {
useWFDynaEditView3Controller,
useNamespace,
} from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import { defineComponent, getCurrentInstance, PropType, ref } from 'vue';
import { ViewType } from '@ibiz-template/model';
import { WFLink } from '@ibiz-template/controller';
import { getViewComponentName } from '@/util';
export const WFDynaEditView3 = defineComponent({
props: {
......@@ -21,7 +20,14 @@ export const WFDynaEditView3 = defineComponent({
const ns = useNamespace(
`view-${ViewType.DE_WF_DYNA_EDIT_VIEW3}`.toLowerCase(),
);
return { c, ns };
const lazyList = ref(['mainForm']);
const onTabClick = (name: string) => {
if (!lazyList.value.includes(name)) {
lazyList.value.push(name);
}
};
return { c, ns, onTabClick, lazyList };
},
render(h) {
let formComponent = null;
......@@ -65,6 +71,7 @@ export const WFDynaEditView3 = defineComponent({
<i-tabs
class={[this.ns.be('', 'tab')]}
name={this.c.model.drTab.source.name}
on-on-click={this.onTabClick}
>
<i-tab-pane
class={this.ns.be('', 'tab-item')}
......@@ -75,6 +82,7 @@ export const WFDynaEditView3 = defineComponent({
{formComponent}
</i-tab-pane>
{[...this.c.model.drTab.pages.values()].map(page => {
const drPage = this.c.drPages[page.source.name];
return (
<i-tab-pane
class={this.ns.be('', 'tab-item')}
......@@ -84,18 +92,20 @@ export const WFDynaEditView3 = defineComponent({
name={page.source.name}
>
{!this.c.isNewData &&
h(getViewComponentName(page.embedView.source.viewType), {
this.lazyList.includes(page.source.name) &&
h('ViewShell', {
props: {
context: this.c.drPages[page.source.name].context,
params: this.c.drPages[page.source.name].params,
context: drPage.context,
params: drPage.params,
modal: this.modal,
modelPath: page.embedView.source.modelPath,
// 流程跟踪视图用
deName: this.c.model.appEntity.source.codeName,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(page.source.name),
},
key: this.c.drPages[page.source.name].key,
key: drPage.key,
})}
</i-tab-pane>
);
......
......@@ -5,7 +5,7 @@ import {
useWFDynaStartViewController,
} from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import '@/styles/components/views/wf-dyna-start-view/wf-dyna-start-view.scss';
import '@ibiz-template/theme/style/components/views/wf-dyna-start-view/wf-dyna-start-view.scss';
export const WFDynaStartView = defineComponent({
props: {
......
......@@ -4,16 +4,7 @@ import {
AppMenuItemModel,
IPSAppMenuItem,
} from '@ibiz-template/model';
// import { AppFuncCommand } from '@ibiz-template/runtime';
import { useAppMenuController, useNamespace } from '@ibiz-template/vue-util';
// import {
// Dropdown,
// DropdownItem,
// DropdownMenu,
// Icon,
// MenuItem,
// Tooltip,
// } from 'view-design';
import {
defineComponent,
getCurrentInstance,
......@@ -22,8 +13,8 @@ import {
ref,
watch,
} from 'vue';
import '@/styles/components/widgets/app-menu/app-menu.scss';
import { AppMenuController } from '@ibiz-template/controller';
import '@ibiz-template/theme/style/components/widgets/app-menu/app-menu.scss';
/**
* 递归生成菜单数据,递给 antd 的 Menu 组件
*
......@@ -180,7 +171,7 @@ export const AppMenu = defineComponent({
// 路由对象
const route = proxy.$route;
c.hooks.complete.tap(() => {
c.nerve.self.evt.on('created', () => {
menus.value = getMenus(c.model.items);
});
......
......@@ -24,9 +24,10 @@ export const PortletContainer = defineComponent({
const content = (
<app-row layout={this.modelData.source.getPSLayout()}>
{defaultSlots.map(slot => {
const opts = slot.componentOptions!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const props = (opts.propsData || {}) as Record<string, any>;
if (!slot.componentOptions) {
return slot;
}
const props = (slot.componentOptions.propsData || {}) as IData;
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
......
......@@ -2,7 +2,7 @@ import { FormButtonController } from '@ibiz-template/controller';
import { FormButtonModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
import '@/styles/components/widgets/form/form-button.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-button.scss';
export const FormButton = defineComponent({
name: 'FormButton',
......
......@@ -16,7 +16,7 @@ import {
VNode,
computed,
} from 'vue';
import '@/styles/components/widgets/form/form.scss';
import '@ibiz-template/theme/style/components/widgets/form/form.scss';
/**
* 根据类型绘制表单成员
......
......@@ -3,8 +3,7 @@ import { FormDRUIPartModel } from '@ibiz-template/model';
import { defineComponent, getCurrentInstance } from 'vue';
import { IModal, ViewMode } from '@ibiz-template/runtime';
import { useController, useNamespace } from '@ibiz-template/vue-util';
import { getViewComponentName } from '@/util';
import '@/styles/components/widgets/form/form-druipart.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-druipart.scss';
export const FormDRUIPart = defineComponent({
name: 'FormDRUIPart',
......@@ -20,10 +19,6 @@ export const FormDRUIPart = defineComponent({
},
setup(props) {
const ns = useNamespace('form-druipart');
// 视图组件名称和视图模型路径
const viewComponentName = getViewComponentName(
props.modelData.embedView.source.viewType,
);
const viewPath = props.modelData.embedView.source.modelPath;
// 模态对象
......@@ -40,7 +35,6 @@ export const FormDRUIPart = defineComponent({
return {
ns,
modal,
viewComponentName,
viewPath,
onNeuronInit,
};
......@@ -55,7 +49,7 @@ export const FormDRUIPart = defineComponent({
layout-pos={this.modelData.source.getPSLayoutPos()}
class={this.ns.b()}
>
{h(this.viewComponentName, {
{h('ViewShell', {
props: {
context: this.$props.controller.context,
params: this.$props.controller.params,
......
......@@ -2,7 +2,7 @@ import { FormGroupPanelController } from '@ibiz-template/controller';
import { FormGroupPanelModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, ref, VNode } from 'vue';
import '@/styles/components/widgets/form/form-group.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-group.scss';
export const FormGroupPanel = defineComponent({
name: 'FormGroupPanel',
......@@ -34,9 +34,10 @@ export const FormGroupPanel = defineComponent({
const content = (
<app-row slot='content' layout={this.modelData.source.getPSLayout()}>
{defaultSlots.map(slot => {
const opts = slot.componentOptions!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const props = (opts.propsData || {}) as Record<string, any>;
if (!slot.componentOptions) {
return slot;
}
const props = (slot.componentOptions.propsData || {}) as IData;
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
......
import { useNamespace } from '@ibiz-template/vue-util';
import { computed, defineComponent } from 'vue';
import '@/styles/components/widgets/form/form-item-container.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-item-container.scss';
export default defineComponent({
props: {
......
......@@ -2,7 +2,7 @@ import { FormItemController } from '@ibiz-template/controller';
import { FormItemModel } from '@ibiz-template/model';
import { defineComponent, computed, reactive } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/widgets/form/form-item.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-item.scss';
export const FormItem = defineComponent({
name: 'FormItem',
......
......@@ -36,9 +36,10 @@ export default defineComponent({
layout={this.modelData.source.getPSLayout()}
>
{defaultSlots.map(slot => {
const opts = slot.componentOptions!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const props = (opts.propsData || {}) as Record<string, any>;
if (!slot.componentOptions) {
return slot;
}
const props = (slot.componentOptions.propsData || {}) as IData;
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
......
import { defineComponent, ref, VNode } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import { FormModel } from '@ibiz-template/model';
import '@/styles/components/widgets/form/form-page.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-page.scss';
export const FormPage = defineComponent({
name: 'FormPage',
......
......@@ -2,7 +2,7 @@ import { FormRawItemController } from '@ibiz-template/controller';
import { FormRawItemModel } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
import '@/styles/components/widgets/form/form-raw-item.scss';
import '@ibiz-template/theme/style/components/widgets/form/form-raw-item.scss';
export const FormRawItem = defineComponent({
name: 'FormRawItem',
......
......@@ -32,9 +32,10 @@ export default defineComponent({
layout={this.modelData.source.getPSLayout()}
>
{defaultSlots.map(slot => {
const opts = slot.componentOptions!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const props = (opts.propsData || {}) as Record<string, any>;
if (!slot.componentOptions) {
return slot;
}
const props = (slot.componentOptions.propsData || {}) as IData;
return (
<app-col
layoutPos={props.modelData.source.getPSLayoutPos()}
......
......@@ -26,14 +26,17 @@ export default defineComponent({
return (
<i-tabs class={[this.ns.b()]} name={this.tabName}>
{defaultSlots.map(slot => {
const opts = slot.componentOptions!;
const props = (opts.propsData || {}) as Record<string, unknown>;
if (!slot.componentOptions) {
return slot;
}
const { modelData } = (slot.componentOptions.propsData ||
{}) as IData;
return (
<i-tab-pane
class={this.ns.b('tab-item')}
tab={this.tabName}
label={props.caption}
name={slot.key}
label={modelData.source.caption}
name={modelData.id}
>
{slot}
</i-tab-pane>
......
import { IBizContext } from '@ibiz-template/core';
import { GridModel } from '@ibiz-template/model';
import { useGridController, useNamespace } from '@ibiz-template/vue-util';
// import { Table } from 'view-design';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import { AppGridPagination } from '@/components/common';
import '@/styles/components/widgets/grid/grid.scss';
import {
useAppGridPagination,
useITableColumns,
useITableEvent,
} from './grid-control.util';
import '@ibiz-template/theme/style/components/widgets/grid/grid.scss';
export const GridControl = defineComponent({
props: {
......
......@@ -75,7 +75,7 @@ export function useITableColumns(c: GridController) {
// 原始iview用列数据
const originColumns = ref<IData[]>([]);
c.hooks.complete.tap(() => {
c.nerve.self.evt.on('created', () => {
originColumns.value = generateIViewColumns(c);
});
......
......@@ -4,7 +4,7 @@ import {
} from '@ibiz-template/controller';
import { computed, defineComponent } from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/widgets/grid/grid-field-column.scss';
import '@ibiz-template/theme/style/components/widgets/grid/grid-field-column.scss';
export const GridFieldColumn = defineComponent({
name: 'GridFieldColumn',
......
......@@ -5,7 +5,7 @@ import {
import { IPSUIActionGroupDetail } from '@ibiz-template/model';
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent } from 'vue';
import '@/styles/components/widgets/grid/grid-ua-column.scss';
import '@ibiz-template/theme/style/components/widgets/grid/grid-ua-column.scss';
export const GridUAColumn = defineComponent({
name: 'GridUAColumn',
......
......@@ -3,7 +3,6 @@ import { ViewPanelModel } from '@ibiz-template/model';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import { usePickupViewPanelController } from '@ibiz-template/vue-util';
import { IModal, ViewMode } from '@ibiz-template/runtime';
import { getViewComponentName } from '@/util';
export const PickupViewPanel = defineComponent({
props: {
......@@ -29,19 +28,16 @@ export const PickupViewPanel = defineComponent({
// 模态对象
const modal: IModal = { mode: ViewMode.EMBED };
// 视图组件名称和视图模型路径
const viewComponentName = getViewComponentName(
c.model.embedView.source.viewType,
);
// 视图模型路径
const viewPath = c.model.embedView.source.modelPath;
return { c, modal, viewComponentName, viewPath };
return { c, modal, viewPath };
},
render(h) {
if (!this.c.complete) {
return;
}
return h(this.viewComponentName, {
return h('ViewShell', {
props: {
context: this.c.context,
params: this.c.params,
......
......@@ -2,7 +2,7 @@ import { IBizContext } from '@ibiz-template/core';
import { SearchFormModel } from '@ibiz-template/model';
import { useNamespace, useSearchFormController } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import '@/styles/components/widgets/search-form/search-form.scss';
import '@ibiz-template/theme/style/components/widgets/search-form/search-form.scss';
export const SearchFormControl = defineComponent({
name: 'SearchFormControl',
......
......@@ -3,7 +3,6 @@ import { ViewPanelModel } from '@ibiz-template/model';
import { useViewPanelController } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
import { IModal, ViewMode } from '@ibiz-template/runtime';
import { getViewComponentName } from '@/util';
export const ViewPanel = defineComponent({
props: {
......@@ -29,19 +28,16 @@ export const ViewPanel = defineComponent({
// 模态对象
const modal: IModal = { mode: ViewMode.EMBED };
// 视图组件名称和视图模型路径
const viewComponentName = getViewComponentName(
c.model.embedView.source.viewType,
);
// 视图模型路径
const viewPath = c.model.embedView.source.modelPath;
return { c, modal, viewComponentName, viewPath };
return { c, modal, viewPath };
},
render(h) {
if (!this.c.complete) {
return;
}
return h(this.viewComponentName, {
return h('ViewShell', {
props: {
context: this.c.context,
params: this.c.params,
......
......@@ -2,6 +2,35 @@ import { OrgData } from '@ibiz-template/core';
import { ModelUtil } from '@ibiz-template/model';
import { UnauthorizedHandler } from '../unauthorized-handler/unauthorized-handler';
/**
* 预加载应用级引用插件
*
* @author chitanda
* @date 2022-10-31 16:10:57
* @return {*} {Promise<void>}
*/
async function loadAppPlugins(): Promise<void> {
const modelService = await ModelUtil.getModelService();
const { app } = modelService;
const pluginRefs = app.getAllPSAppPFPluginRefs();
const all = pluginRefs?.map(async pluginRef => {
if (
pluginRef &&
pluginRef.runtimeObject &&
pluginRef.rTObjectName &&
pluginRef.rTObjectRepo
) {
const config = JSON.parse(pluginRef.rTObjectRepo);
if (config && config.app === true) {
await ibiz.plugin.loadPluginRef(pluginRef);
}
}
});
if (all) {
await Promise.all(all);
}
}
/**
* 初始化模型
*
......@@ -18,6 +47,7 @@ async function loadModel(): Promise<void> {
}
return {};
});
await loadAppPlugins();
}
/**
......@@ -67,14 +97,23 @@ async function appInit(): Promise<void> {
// 设置权限服务需要的appData里的数据
await ibiz.authority.init();
} catch (error) {
const { response, message } = error as IData;
const { response } = error as IData;
if (response?.status === 401) {
await UnauthorizedHandler.handle();
} else {
ibiz.log.error(error);
}
ibiz.message.error(`应用参数初始化失败:${message}`);
}
}
/**
* 应用权限守卫
*
* @author chitanda
* @date 2022-10-28 10:10:29
* @export
* @return {*} {Promise<boolean>}
*/
export async function AuthGuard(): Promise<boolean> {
await appInit();
return true;
......
import '@/styles/index.scss';
import '@ibiz-template/theme/style/index.scss';
import Vue from 'vue';
import Router from 'vue-router';
import { PiniaVuePlugin } from 'pinia';
......@@ -12,10 +12,10 @@ import {
NotificationUtil,
LoadingUtil,
ErrorHandler,
PluginFactory,
} from './util';
import { piniaInstance } from './store';
import { attachEnvironmentConfig } from './attach-environment-config';
import { PluginFactory } from './plugin';
Vue.use(Router);
Vue.use(PiniaVuePlugin);
......
export { PluginFactory } from './plugin-factory/plugin-factory';
export { RemotePluginItem } from './remote-plugin-item/remote-plugin-item';
import Vue from 'vue';
import { RuntimeError } from '@ibiz-template/core';
import { DefectModelError } from '@ibiz-template/model';
import { IPluginFactory } from '@ibiz-template/runtime';
import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz/dynamic-model-api';
import {
RemotePluginConfig,
RemotePluginItem,
} from '../remote-plugin-item/remote-plugin-item';
/**
* 插件工具类
*
* @author chitanda
* @date 2022-10-21 16:10:29
* @export
* @class PluginFactory
*/
export class PluginFactory implements IPluginFactory {
/**
* 是否已经加载过文件缓存
*
* @author chitanda
* @date 2022-10-31 14:10:17
* @protected
* @type {Map<string, boolean>}
*/
protected cache: Map<string, boolean> = new Map();
/**
* 插件缓存
*
* @author chitanda
* @date 2022-10-31 14:10:28
* @protected
* @type {Map<string, RemotePluginItem>}
*/
protected pluginCache: Map<string, RemotePluginItem> = new Map();
/**
* 加载插件
*
* @author chitanda
* @date 2022-10-31 14:10:13
* @param {IPSSysPFPlugin} plugin
* @return {*} {Promise<boolean>}
*/
async loadPlugin(plugin: IPSSysPFPlugin): Promise<boolean> {
if (plugin.runtimeObject === true) {
const pluginRef = plugin as unknown as IPSAppPFPluginRef;
if (pluginRef) {
return this.loadPluginRef(pluginRef);
}
}
return false;
}
/**
* 加载应用饮用插件
*
* @author chitanda
* @date 2022-10-31 16:10:57
* @param {IPSAppPFPluginRef} pluginRef
* @return {*} {Promise<boolean>}
*/
async loadPluginRef(pluginRef: IPSAppPFPluginRef): Promise<boolean> {
if (ibiz.env.dev) {
ibiz.log.warn(
`开发模式,远程插件[${pluginRef.name}]不加载。开发测试请在本地引入!`,
);
return true;
}
if (this.pluginCache.has(pluginRef.rTObjectName)) {
return true;
}
let config: IParams = {};
try {
config = JSON.parse(pluginRef.rTObjectRepo);
} catch (err) {
throw new DefectModelError(
pluginRef,
`插件[${pluginRef.name}]参数格式异常请检查`,
);
}
const remotePlugin = new RemotePluginItem(
pluginRef.rTObjectName,
config as unknown as RemotePluginConfig,
);
if (remotePlugin) {
await this.loadScript(remotePlugin.script);
if (remotePlugin.styles instanceof Array) {
await this.loadStyles(remotePlugin.styles);
} else {
await this.loadStyles([remotePlugin.styles]);
}
this.pluginCache.set(pluginRef.rTObjectName, remotePlugin);
return true;
}
return false;
}
/**
* 加载插件
*
* @author chitanda
* @date 2022-10-31 14:10:10
* @protected
* @param {string} scriptUrl
* @return {*} {Promise<void>}
*/
protected async loadScript(scriptUrl: string): Promise<void> {
if (scriptUrl) {
if (this.cache.has(scriptUrl)) {
return;
}
const url = this.parseUrl(scriptUrl);
const module = await System.import(url);
if (module) {
if (module.default) {
Vue.use(module.default);
} else {
throw new RuntimeError(
`远程插件加载失败, 远程插件未找到[default]默认导出`,
);
}
this.cache.set(scriptUrl, true);
} else {
throw new RuntimeError(`远程插件加载失败, 未找到文件`);
}
}
}
/**
* 加载插件样式文件
*
* @author chitanda
* @date 2022-10-31 12:10:23
* @protected
* @param {(string[])} styles
* @return {*} {Promise<void>}
*/
protected async loadStyles(styles: string[]): Promise<void> {
if (styles && styles.length > 0) {
const all = styles.map(styleUrl => {
if (this.cache.has(styleUrl)) {
return false;
}
return new Promise((resolve, reject) => {
const url = this.parseUrl(styleUrl);
const linkDom = document.createElement('link');
linkDom.setAttribute('type', 'text/css');
linkDom.setAttribute('rel', 'stylesheet');
linkDom.setAttribute('href', url);
linkDom.onload = resolve;
linkDom.onerror = reject;
document.head.appendChild(linkDom);
});
});
await Promise.all(all);
}
}
/**
* 编译请求文件地址
*
* @author chitanda
* @date 2022-10-31 14:10:19
* @protected
* @param {string} script
* @return {*} {string}
*/
protected parseUrl(script: string): string {
if (script.startsWith('http://') || script.startsWith('https://')) {
return script;
}
return `${ibiz.env.pluginBaseUrl}${script}`;
}
}
/**
* 远程插件配置
*
* @author chitanda
* @date 2022-10-31 16:10:34
* @export
* @interface RemotePluginConfig
*/
export interface RemotePluginConfig {
/**
* 脚本地址
*
* @author chitanda
* @date 2022-10-31 16:10:42
* @type {string}
*/
script: string;
/**
* 样式地址
*
* @author chitanda
* @date 2022-10-31 16:10:46
* @type {(string | string[])}
*/
styles: string | string[];
/**
* 是否为应用级
*
* @author chitanda
* @date 2022-10-31 16:10:51
* @type {boolean}
*/
app?: boolean;
}
/**
* 远程插件项
*
* @author chitanda
* @date 2022-10-31 12:10:41
* @export
* @class RemotePluginItem
*/
export class RemotePluginItem {
/**
* 唯一标识
*
* @author chitanda
* @date 2022-10-31 12:10:48
* @type {string}
*/
readonly tag: string;
/**
* 脚本文件地址
*
* @author chitanda
* @date 2022-10-31 12:10:05
* @type {string}
*/
readonly script: string = '';
/**
* 样式文件地址
*
* @author chitanda
* @date 2022-10-31 12:10:27
* @type {(string | string[])}
*/
readonly styles: string | string[] = '';
/**
* 是否为应用级插件
*
* @author chitanda
* @date 2022-10-31 16:10:13
* @type {boolean}
*/
readonly app?: boolean;
/**
* Creates an instance of RemotePluginItem.
*
* @author chitanda
* @date 2022-10-31 12:10:28
* @param {string} tag 插件唯一标识
* @param {RemotePluginConfig} config
*/
constructor(tag: string, config: RemotePluginConfig) {
this.tag = tag;
if (config.script) {
this.script = config.script;
}
if (config.styles) {
this.styles = config.styles;
}
if (config.app) {
this.app = true;
}
}
}
......@@ -2,6 +2,7 @@ import { presetControlProvider } from './control';
import { presetEditorProvider } from './editor';
import { presetFormDetailProvider } from './form-detail';
import { presetPortletPartProvider } from './portlet-part';
import { presetViewProvider } from './view';
export * from './editor';
export * from './form-detail';
......@@ -20,4 +21,5 @@ export function presetAllProviders(): void {
presetFormDetailProvider();
presetPortletPartProvider();
presetControlProvider();
presetViewProvider();
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 应用看板视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class AppPortalViewProvider
* @implements {IViewProvider}
*/
export class AppPortalViewProvider implements IViewProvider {
compName: string = 'AppPortalView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 编辑视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class EditViewProvider
* @implements {IViewProvider}
*/
export class EditViewProvider implements IViewProvider {
compName: string = 'EditView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 编辑视图(分页关系)适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class EditView3Provider
* @implements {IViewProvider}
*/
export class EditView3Provider implements IViewProvider {
compName: string = 'EditView3';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 表格视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class GridViewProvider
* @implements {IViewProvider}
*/
export class GridViewProvider implements IViewProvider {
compName: string = 'GridView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 首页视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class IndexViewProvider
* @implements {IViewProvider}
*/
export class IndexViewProvider implements IViewProvider {
compName: string = 'IndexView';
}
import { ViewType } from '@ibiz-template/model';
import { AppPortalViewProvider } from './app-portal-view-provider';
import { EditViewProvider } from './edit-view-provider';
import { EditView3Provider } from './edit-view3-provider';
import { GridViewProvider } from './grid-view-provider';
import { IndexViewProvider } from './index-view-provider';
import { MPickupViewProvider } from './mpickup-view-provider';
import { OptViewProvider } from './opt-view-provider';
import { PickupGridViewProvider } from './pickup-grid-view-provider';
import { PickupViewProvider } from './pickup-view-provider';
import { WFDynaActionViewProvider } from './wf-dyna-action-view-provider';
import { WFDynaEditView3Provider } from './wf-dyna-edit-view3-provider';
import { WFDynaStartViewProvider } from './wf-dyna-start-view-provider';
import { WFStepTraceViewProvider } from './wf-step-trace-view-provider';
/**
* 预置默认的视图适配器
*
* @author lxm
* @date 2022-10-26 11:10:46
* @export
* @returns {*} {void}
*/
export function presetViewProvider(): void {
const { view } = ibiz.register;
if (!view) {
return;
}
view.register(ViewType.APP_INDEX_VIEW, new IndexViewProvider());
view.register(ViewType.DE_EDIT_VIEW, new EditViewProvider());
view.register(ViewType.DE_GRID_VIEW, new GridViewProvider());
view.register(ViewType.DE_GRID_VIEW9, new GridViewProvider());
view.register(ViewType.DE_EDIT_VIEW3, new EditView3Provider());
view.register(ViewType.DE_OPT_VIEW, new OptViewProvider());
view.register(ViewType.DE_PICKUP_VIEW, new PickupViewProvider());
view.register(ViewType.DE_MPICKUP_VIEW, new MPickupViewProvider());
view.register(ViewType.DE_PICKUP_GRID_VIEW, new PickupGridViewProvider());
view.register(ViewType.DE_WF_DYNA_EDIT_VIEW3, new WFDynaEditView3Provider());
view.register(ViewType.DE_WF_DYNA_START_VIEW, new WFDynaStartViewProvider());
view.register(
ViewType.DE_WF_DYNA_ACTION_VIEW,
new WFDynaActionViewProvider(),
);
view.register(ViewType.APP_WF_STEP_TRACE_VIEW, new WFStepTraceViewProvider());
view.register(ViewType.APP_PORTAL_VIEW, new AppPortalViewProvider());
}
export {
EditViewProvider,
IndexViewProvider,
GridViewProvider,
EditView3Provider,
OptViewProvider,
PickupViewProvider,
MPickupViewProvider,
PickupGridViewProvider,
WFDynaEditView3Provider,
WFDynaStartViewProvider,
WFDynaActionViewProvider,
WFStepTraceViewProvider,
AppPortalViewProvider,
};
import { IViewProvider } from '@ibiz-template/controller';
/**
* 多项数据选择视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class MPickupViewProvider
* @implements {IViewProvider}
*/
export class MPickupViewProvider implements IViewProvider {
compName: string = 'MPickupView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 选项操作视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class OptViewProvider
* @implements {IViewProvider}
*/
export class OptViewProvider implements IViewProvider {
compName: string = 'OptView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 数据选择表格视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class PickupGridViewProvider
* @implements {IViewProvider}
*/
export class PickupGridViewProvider implements IViewProvider {
compName: string = 'PickupGridView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 单项数据选择视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class PickupViewProvider
* @implements {IViewProvider}
*/
export class PickupViewProvider implements IViewProvider {
compName: string = 'PickupView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 动态工作流操作视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class WFDynaActionViewProvider
* @implements {IViewProvider}
*/
export class WFDynaActionViewProvider implements IViewProvider {
compName: string = 'WFDynaActionView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 工作流动态视图(分页关系)适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class WFDynaEditView3Provider
* @implements {IViewProvider}
*/
export class WFDynaEditView3Provider implements IViewProvider {
compName: string = 'WFDynaEditView3';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 工作流动态启动视图适配器
*
* @author lxm
* @date 2022-10-26 11:10:03
* @export
* @class WFDynaStartViewProvider
* @implements {IViewProvider}
*/
export class WFDynaStartViewProvider implements IViewProvider {
compName: string = 'WFDynaStartView';
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 应用流程跟踪视图适配器
*
* @author lxm
* @date 2022-10-25 18:10:57
* @export
* @class WFStepTraceViewProvider
* @implements {IViewProvider}
*/
export class WFStepTraceViewProvider implements IViewProvider {
compName: string = 'WFStepTraceView';
}
......@@ -26,19 +26,20 @@ export class ErrorHandler {
) {
ibiz.message.error(err.message, 10, true);
} else if (err instanceof HttpError) {
ibiz.notification.error({
title: `网络异常 ${err.status}`,
desc: err.message,
duration: 10,
});
if (err.status === 401) {
UnauthorizedHandler.handle();
} else {
ibiz.notification.error({
title: `网络异常 ${err.status}`,
desc: err.message,
duration: 10,
});
}
} else if (err instanceof RuntimeError) {
ibiz.message.error(err.message);
console.error(err);
ibiz.message.error(err.message, 10);
ibiz.log.error(err);
} else {
console.error(err);
ibiz.log.error(err);
}
}
}
......@@ -4,7 +4,5 @@ export { ModalUtil } from './model-util/model-util';
export { NotificationUtil } from './notification-util/notification-util';
export { OpenViewUtil } from './open-view-util/open-view-util';
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';
......@@ -7,12 +7,12 @@ import {
ref,
} from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/util/drawer/drawer.scss';
import { ViewNeuron } from '@ibiz-template/controller';
import { isNumber } from 'lodash-es';
import { IModal, IModalData, ViewMode } from '@ibiz-template/runtime';
import { AppDrawerOptions } from '@/interface';
import { useUIStore } from '@/store';
import '@ibiz-template/theme/style/components/util/drawer/drawer.scss';
export const AppDrawerComponent = defineComponent({
props: {
......
......@@ -7,12 +7,12 @@ import {
ref,
} from 'vue';
import { useNamespace } from '@ibiz-template/vue-util';
import '@/styles/components/util/modal/modal.scss';
import { ViewNeuron } from '@ibiz-template/controller';
import { isNumber } from 'lodash-es';
import { IModal, IModalData, ViewMode } from '@ibiz-template/runtime';
import { AppModalOptions } from '@/interface';
import { useUIStore } from '@/store';
import '@ibiz-template/theme/style/components/util/modal/modal.scss';
export const AppModalComponent = defineComponent({
props: {
......
......@@ -4,7 +4,6 @@ import { IModalData, IOpenViewUtil } from '@ibiz-template/runtime';
import { generateRoutePath } from '@ibiz-template/vue-util';
import router from '@/router';
import { AppModal } from './app-modal/app-modal';
import { getViewComponentName } from '../component-name';
import { AppDrawer } from './app-drawer/app-drawer';
/**
......@@ -50,8 +49,6 @@ export class OpenViewUtil implements IOpenViewUtil {
): Promise<IModalData> {
// 获取视图组件名和path
const modelPath = appView.modelPath!;
const { viewType } = appView.refM;
const viewComponentName = getViewComponentName(viewType);
// 设置默认的modal参数
const opts = {
......@@ -61,7 +58,7 @@ export class OpenViewUtil implements IOpenViewUtil {
};
const res = await AppModal.openModal(
viewComponentName,
'ViewShell',
{
context,
params,
......@@ -77,7 +74,7 @@ export class OpenViewUtil implements IOpenViewUtil {
context?: IBizContext | undefined,
params?: IParams | undefined,
): Promise<IModalData> {
console.log('openPopover', appView, context, params);
ibiz.log.warn('openPopover', appView, context, params);
throw new Error();
}
......@@ -98,8 +95,6 @@ export class OpenViewUtil implements IOpenViewUtil {
): Promise<IModalData> {
// 获取视图组件名和path
const modelPath = appView.modelPath!;
const { viewType } = appView.refM;
const viewComponentName = getViewComponentName(viewType);
const placement = AppDrawer.getPlacement(appView.openMode);
// 设置默认的modal参数
......@@ -110,7 +105,7 @@ export class OpenViewUtil implements IOpenViewUtil {
};
const res = await AppDrawer.openDrawer(
viewComponentName,
'ViewShell',
{
context,
params,
......@@ -126,7 +121,7 @@ export class OpenViewUtil implements IOpenViewUtil {
context?: IBizContext | undefined,
params?: IParams | undefined,
): Promise<IModalData> {
console.log('openUserCustom', appView, context, params);
ibiz.log.warn('openUserCustom', appView, context, params);
throw new Error();
}
}
import { useNamespace, useRoute, useRouter } from '@ibiz-template/vue-util';
import { computed, defineComponent, getCurrentInstance, onMounted } from 'vue';
import '@/styles/components/views/404-view/404-view.scss';
import '@ibiz-template/theme/style/components/views/404-view/404-view.scss';
import { Route } from 'vue-router';
export default defineComponent({
......
......@@ -60,10 +60,6 @@ const onMenuRouteChange = () => {
deleteRouteCache(keyHistory.value.slice(1));
};
const onBackClick = () => {
closeView();
};
// 后退按钮触发事件,删除上一个路由的缓存
window.onpopstate = () => {
deleteRouteCache([keyHistory.value[1]]);
......@@ -80,7 +76,6 @@ const currentPath = computed(() => {
:is-complete="c.complete"
:model="c.model"
@onCollapseChange="collapseChange"
@backClick="onBackClick"
>
<template v-if="c.complete">
<AppMenu
......
......@@ -9,7 +9,7 @@ import {
import { setCookie } from 'qx-util';
import { useNamespace, useRoute } from '@ibiz-template/vue-util';
import router from '@/router';
import '@/styles/components/views/login-view/login-view.scss';
import '@ibiz-template/theme/style/components/views/login-view/login-view.scss';
interface LoginData {
username: string;
......
......@@ -74,18 +74,36 @@ function IBizVitePlugin(): Plugin[] {
);
writeFileSync(htmlFilePath, html, 'utf-8');
// 重新修改 system-import.json 补充时间戳
const systemImportPath = join(cwd, 'dist/extras/json/system-import.json');
const content = readFileSync(systemImportPath, 'utf-8');
if (content) {
const json = JSON.parse(content);
const items = json.imports;
const date = new Date();
// eslint-disable-next-line no-restricted-syntax, guard-for-in
for (const key in items) {
const val = items[key];
items[key] = `${val}?time=${date.getTime()}`;
{
const systemImportPath = join(
cwd,
'dist/extras/json/system-import.json',
);
const content = readFileSync(systemImportPath, 'utf-8');
if (content) {
const json = JSON.parse(content);
const items = json.imports;
const date = new Date();
// eslint-disable-next-line no-restricted-syntax, guard-for-in
for (const key in items) {
const val = items[key];
items[key] = `${val}?time=${date.getTime()}`;
}
writeFileSync(
systemImportPath,
JSON.stringify(json, null, 2),
'utf-8',
);
}
}
// 修改 dist/environments/environment.js 把 dev 模式改为 false
{
const envPath = join(cwd, 'dist/environments/environment.js');
let env = readFileSync(envPath, 'utf-8');
if (env) {
env = env.replace(/dev:(.*)true/, 'dev: false');
writeFileSync(envPath, env, 'utf-8');
}
writeFileSync(systemImportPath, JSON.stringify(json, null, 2), 'utf-8');
}
},
};
......
......@@ -60,7 +60,7 @@ export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/styles/global.scss";',
additionalData: '@import "@ibiz-template/theme/style/global.scss";',
},
},
},
......
此差异已折叠。
......@@ -50,7 +50,7 @@
</changeSet>
<!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-283-3">
<changeSet author="root" id="tab-book-325-3">
<createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -194,7 +194,7 @@
</changeSet>
<!--输出实体[REGINFO]数据结构 -->
<changeSet author="root" id="tab-reginfo-115-8">
<changeSet author="root" id="tab-reginfo-118-8">
<createTable tableName="T_REGINFO">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -303,7 +303,7 @@
</changeSet>
<!--输出实体[REGINFO]外键关系 -->
<changeSet author="root" id="fk-reginfo-115-12">
<changeSet author="root" id="fk-reginfo-118-12">
<addForeignKeyConstraint baseColumnNames="STUDENTID" baseTableName="T_REGINFO" constraintName="F328B6E61632896255" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="STUDENTID" referencedTableName="T_STUDENT" validate="true"/>
</changeSet>
......
......@@ -48,9 +48,6 @@
}, {
"expression" : "t1.`FIELD22`",
"name" : "FIELD22"
}, {
"expression" : "t1.`FIELD3`",
"name" : "FIELD3"
}, {
"expression" : "t1.`FIELD4`",
"name" : "FIELD4"
......@@ -93,6 +90,9 @@
}, {
"expression" : "t1.`FIELD2`",
"name" : "FIELD2"
}, {
"expression" : "t1.`FIELD3`",
"name" : "FIELD3"
}, {
"expression" : "t1.`ORGID`",
"name" : "ORGID"
......@@ -103,6 +103,6 @@
"expression" : "t1.`UPDATEMAN`",
"name" : "UPDATEMAN"
} ],
"queryCode" : "SELECT\nt1.`BOOKID`,\nt1.`BOOKNAME`,\nt1.`CREATEDATE`,\nt1.`CREATEMAN`,\nt1.`DEPTID`,\nt1.`FIELD`,\nt1.`FIELD2`,\nt1.`ORGID`,\nt1.`UPDATEDATE`,\nt1.`UPDATEMAN`\nFROM `T_BOOK` t1 \n",
"queryCode" : "SELECT\nt1.`BOOKID`,\nt1.`BOOKNAME`,\nt1.`CREATEDATE`,\nt1.`CREATEMAN`,\nt1.`DEPTID`,\nt1.`FIELD`,\nt1.`FIELD2`,\nt1.`FIELD3`,\nt1.`ORGID`,\nt1.`UPDATEDATE`,\nt1.`UPDATEMAN`\nFROM `T_BOOK` t1 \n",
"id" : "PSMODULES/common/PSDATAENTITIES/Book/PSDEDATAQUERIES/Simple/PSDEDQCODES/MYSQL5.json"
}
\ No newline at end of file
......@@ -35,6 +35,21 @@
}
} ],
"getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
......@@ -64,21 +79,6 @@
},
"getPSDEFormItemName" : "StuNo",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
} ],
"getPSDEFormItems" : [ {
"id" : "srfupdatedate",
......
......@@ -1021,6 +1021,21 @@
"id" : "FORM"
},
"getPSDEFormItemVRs" : [ {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFValueRule" : {
......@@ -1050,21 +1065,6 @@
},
"getPSDEFormItemName" : "StuNo",
"valueRuleType" : "DEFVALUERULE"
}, {
"checkMode" : 3,
"name" : "表单项值规则",
"getPSDEFormItemName" : "Name",
"getPSSysValueRule" : {
"codeName" : "ValueRule14",
"dynaModelFilePath" : "PSSYSVALUERULES/ValueRule14.json",
"name" : "由26个英文字母组成的字符串",
"regExCode" : "[A-Za-z]+",
"ruleInfo" : "内容必须为26个英文字母组成的字符串",
"ruleType" : "REG",
"enableBackend" : true,
"enableFront" : true
},
"valueRuleType" : "SYSVALUERULE"
} ],
"getPSDEFormItems" : [ {
"id" : "srfupdatedate",
......
......@@ -2265,6 +2265,7 @@
"viewType" : "DEEDITVIEW",
"xDataControlName" : "form",
"enableDP" : true,
"showCaptionBar" : false,
"showDataInfoBar" : true,
"modelid" : "7131781a86e8e2393c801585a48beebb",
"modeltype" : "PSAPPDEVIEW"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册