提交 bb21ee4c 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 5ef05d72
......@@ -6,4 +6,4 @@
{{#*inline "PASSWORD"}}{{>@macro/form-detail/input.hbs}}{{/inline}}
{{#*inline "TEXTAREA"}}{{>@macro/form-detail/input.hbs}}{{/inline}}
{{#*inline "SPAN"}}{{>@macro/form-detail/span.hbs}}{{/inline}}
{{#*inline "DROPDOWNLIST"}}{{>@macro/form-detail/dropdownList.hbs}}{{/inline}}
\ No newline at end of file
{{#*inline "DROPDOWNLIST"}}{{>@macro/form-detail/dropdown-list.hbs}}{{/inline}}
\ No newline at end of file
<AppInput
<IbizInput
{{#if item.psEditor.getPlaceHolder}}
placeholder="{{item.psEditor.getPlaceHolder}}"
{{/if}}
......
<AppSpan
<IbizSpan
name="{{item.codeName}}"
{{!-- :value="data.{{item.psEditor.name}}" --}}
value="标签测试"
......
......@@ -4,9 +4,7 @@
declare module 'vue' {
export interface GlobalComponents {
DefaultViewLayout: typeof import('./src/components/layout/DefaultViewLayout/DefaultViewLayout.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
IconText: typeof import('./src/components/render/IconText/IconText.vue')['default']
}
}
......
......@@ -16,5 +16,7 @@ import { JobsInfoEditView } from '@page/jobs-info/jobs-info-edit-view';
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
height: 100%;
width: 100%;
}
</style>
\ No newline at end of file
import AppInput from './app-input.vue';
import AppDropdownList from './app-dropdown-list.vue';
import AppSpan from './app-span.vue';
export {
AppInput,
AppDropdownList,
AppSpan,
}
\ No newline at end of file
export * from './custom'
export * from './editors'
export * from './layout'
export * from './render'
\ No newline at end of file
import DefaultIndexViewLayout from './DefaultIndexViewLayout.vue'
export const IbizDefaultIndexViewLayout = DefaultIndexViewLayout;
\ No newline at end of file
import DefaultViewLayout from './DefaultViewLayout.vue'
export const IbizDefaultViewLayout = DefaultViewLayout;
\ No newline at end of file
......@@ -48,5 +48,8 @@ const props = withDefaults(defineProps<LayoutProps>(), {
background-color: #fff;
justify-content: space-between;
}
.ant-layout-sider {
overflow-y: auto;
}
}
</style>
\ No newline at end of file
export * from './DefaultViewLayout';
export * from './DefaultIndexViewLayout';
import FormGroup from './FormGroup.vue'
export const IbizFormGroup = FormGroup;
\ No newline at end of file
import FormItem from './FormItem.vue'
export const IbizFormItem = FormItem;
\ No newline at end of file
......@@ -14,18 +14,22 @@ const props = withDefaults(defineProps<Props>(), {});
<template v-if="!item.items">
<a-menu-item v-if="!item.hidden" :key="item.name">
<template #icon>
<UserOutlined />
<div class="menu-icon">
<UserOutlined />
</div>
</template>
{{item.caption}}
\{{item.caption}}
</a-menu-item>
</template>
<template v-else>
<a-sub-menu v-if="!item.hidden" :key="item.name">
<template #icon>
<UserOutlined />
<div class="menu-icon">
<UserOutlined />
</div>
</template>
<template #title> {{item.caption}}</template>
<app-menu-item :items="item.items" />
<template #title>\{{item.caption}}</template>
<IbizMenuItem :items="item.items" />
</a-sub-menu>
</template>
</template>
......
import IconText from './IconText.vue'
export const IbizIconText = IconText;
\ No newline at end of file
import MenuItem from './MenuItem.vue'
export const IbizMenuItem = MenuItem;
\ No newline at end of file
export * from './IconText';
export * from './FormItem';
export * from './FormGroup';
export * from './MenuItem';
\ No newline at end of file
import { MainViewProps } from "@ibiz-core";
/**
* 编辑视图props
* @description 编辑视图props
* @export
* @interface EditViewProps
* @extends {MainViewProps}
*/
export interface EditViewProps extends MainViewProps {
export interface EditViewProps extends MainViewProps {
}
\ No newline at end of file
import { MainViewState } from "@ibiz-core";
/**
* 编辑视图状态
* @description 编辑视图状态
* @export
* @interface EditViewState
* @extends {MainViewState}
*/
export interface EditViewState extends MainViewState {
export interface EditViewState extends MainViewState {
}
\ No newline at end of file
import { EditViewProps, EditViewState, MainView } from '@ibiz-core';
/**
* 编辑视图
* @description 编辑视图
* @export
* @class ViewBase
* @class EditView
* @extends {MainView}
*/
export class EditView extends MainView {
/**
* 视图状态
* @description 视图状态
* @type {EditViewState}
* @memberof EditView
*/
public declare viewState: EditViewState;
/**
* 使用加载功能模块
* @param props 传入的props
* @description 使用加载功能模块
* @param {EditViewProps} props 传入的props
* @memberof EditView
*/
public useLoad(props: EditViewProps){
const { viewSubject } = this.viewState;
......@@ -23,9 +28,11 @@ export class EditView extends MainView {
}
/**
* 安装视图所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装视图所有功能模块的方法
* @param {EditViewProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof EditView
*/
public moduleInstall(props: EditViewProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
......
......@@ -19,7 +19,7 @@ export class IndexView extends ViewBase {
public useLoad(props: IndexViewProps){
const { viewSubject } = this.viewState;
onMounted(()=>{
viewSubject.next({tag: 'menu', action: "load", data: {}})
viewSubject.next({tag: 'appmenu', action: "load", data: {}})
})
}
......
import { ViewPropsBase } from '@ibiz-core';
/**
* 实体部件的props
* @description 实体部件的props
* @export
* @interface MainViewProps
* @extends {ViewPropsBase}
*/
export interface MainViewProps extends ViewPropsBase {
}
import { ControlAction, ViewStateBase } from '@ibiz-core';
/**
* 实体部件状态
* @description 实体部件状态
* @export
* @interface MainViewState
* @extends {ViewStateBase}
*/
export interface MainViewState extends ViewStateBase {
/**
* 视图所有部件的部件行为
* @description 视图所有部件的部件行为
* @type {Record<string,ControlAction>}
* @memberof MainViewState
*/
controlsAction: Record<string,ControlAction>;
}
import { ViewPropsBase, ViewStateBase, toOneWayRef } from '@ibiz-core';
/**
* 视图基类
* @description 视图基类
* @export
* @class ViewBase
*/
export class ViewBase {
/**
* 视图状态
* @description 视图状态
* @type {ViewStateBase}
* @memberof ViewBase
*/
public viewState: ViewStateBase;
/**
* 构造方法,初始化状态
* Creates an instance of ViewBase.
* @param {*} options 配置参数
* @memberof ViewBase
*/
constructor(options: any) {
this.viewState = reactive(options);
}
/**
* 根据props调整设置部分视图基类
* @param props 传入的Props
* @description 根据props调整设置部分视图基类
* @param {ViewPropsBase} props 传入参数
* @memberof ViewBase
*/
public setState(props: ViewPropsBase) {
public setState(props: ViewPropsBase) {
// todo 项目级配置入口,优先级大于平台,提供全局的一次性配置
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
......@@ -29,8 +36,10 @@ export class ViewBase {
}
/**
* 使用视图上下文参数逻辑块
* @param props 传入的Props
* @description 使用视图上下文参数逻辑块
* @param {ViewPropsBase} props 传入的Props
* @return {*}
* @memberof ViewBase
*/
public useViewContextParams(props: ViewPropsBase) {
const context = toOneWayRef(props, 'context');
......@@ -48,16 +57,18 @@ export class ViewBase {
}
/**
* 使用计数器服务模块
* @todo
* @param props
* @description 使用计数器服务模块
* @param {ViewPropsBase} props 传入参数
* @memberof ViewBase
*/
public useCounterService(props: ViewPropsBase){}
/**
* 安装视图所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装视图所有功能模块的方法
* @param {ViewPropsBase} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof ViewBase
*/
public moduleInstall(props: ViewPropsBase, emit?: Function) {
this.setState(props);
......
......@@ -2,26 +2,37 @@ import { Subject } from "rxjs";
import { IActionParam, IParam } from "@ibiz-core";
/**
* 视图props的基类
* @description 视图props的基类
* @export
* @interface ViewPropsBase
*/
export interface ViewPropsBase {
/**
* 上下文参数(外部传入)
* @description 上下文参数(外部传入)
* @type {IParam}
* @memberof ViewPropsBase
*/
context?: IParam;
/**
* 视图参数(外部传入)
* @description 视图参数(外部传入)
* @type {IParam}
* @memberof ViewPropsBase
*/
viewParams?: IParam;
/**
* 视图参数(外部传入)
* @description 视图参数(外部传入)
* @type {Subject<IActionParam>}
* @memberof ViewPropsBase
*/
viewSubject?: Subject<IActionParam>;
/**
* 视图打开方式,路由、模态、内嵌,默认为路由方式
* @description 视图打开方式,默认为路由方式
* @type {("ROUTE" | "MODAL" | "EMBED")} 路由 | 模态 | 内嵌
* @memberof ViewPropsBase
*/
openType?: "ROUTE" | "MODAL" | "EMBED";
}
\ No newline at end of file
import { Subject } from "rxjs";
import { IActionParam, IParam } from '@ibiz-core';
/**
* 视图基类状态
* @description 视图基类状态
* @export
* @interface ViewStateBase
*/
export interface ViewStateBase {
/**
* 视图名称
* @description 视图名称
* @type {string}
* @memberof ViewStateBase
*/
viewName: string;
/**
* 视图代码名称
* @description 视图代码名称
* @type {string}
* @memberof ViewStateBase
*/
viewCodeName: string;
/**
* 上下文参数
* @description 上下文参数
* @type {IParam}
* @memberof ViewStateBase
*/
context: IParam;
/**
* 视图参数
* @description 视图参数
* @type {IParam}
* @memberof ViewStateBase
*/
viewParams: IParam;
/**
* 视图参数(外部传入)
* @description 视图参数(外部传入)
* @type {Subject<IActionParam>}
* @memberof ViewStateBase
*/
viewSubject: Subject<IActionParam>;
......
import { ControlPropsBase, ControlStateBase, toOneWayRef } from '@ibiz-core';
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
/**
* 部件基类
* @description 部件基类
* @export
* @class ControlBase
*/
export class ControlBase {
/**
* 部件状态
* @description 部件状态
* @type {ControlStateBase}
* @memberof ControlBase
*/
public controlState: ControlStateBase;
/**
* 构造方法,初始化状态
* @description 路由器
* @type {Router}
* @memberof ControlBase
*/
public router: Router = useRouter();
/**
* @description 路由
* @type {RouteLocationNormalizedLoaded}
* @memberof ControlBase
*/
public route: RouteLocationNormalizedLoaded = useRoute();
/**
* Creates an instance of ControlBase.
* @param {*} options 配置参数
* @memberof ControlBase
*/
constructor(options: any) {
this.controlState = reactive(options);
}
/**
* 根据props调整设置部分部件基类
* @param props 传入的Props
* @description 根据props调整设置部分部件基类
* @param {ControlPropsBase} props 传入props
* @memberof ControlBase
*/
public setState(props: ControlPropsBase) {
// toDo 项目级配置入口,优先级大于平台,提供全局的一次性配置
......@@ -29,8 +51,10 @@ export class ControlBase {
}
/**
* 使用部件上下文参数逻辑块
* @param props 传入的Props
* @description 使用部件上下文参数逻辑块
* @param {ControlPropsBase} props
* @return {*}
* @memberof ControlBase
*/
public useControlContextParams(props: ControlPropsBase) {
const context = toOneWayRef(props, 'context');
......@@ -44,9 +68,11 @@ export class ControlBase {
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装部件所有功能模块的方法
* @param {ControlPropsBase} props 传入的Props
* @param {Function} [emit] 事件
* @return {*}
* @memberof ControlBase
*/
public moduleInstall(props: ControlPropsBase, emit?: Function) {
this.setState(props);
......
......@@ -2,21 +2,30 @@ import { Subject } from "rxjs";
import { IActionParam, IParam } from "@ibiz-core";
/**
* 部件props的基类
* @description 部件props的基类
* @export
* @interface ControlPropsBase
*/
export interface ControlPropsBase {
export interface ControlPropsBase {
/**
* 上下文参数(外部传入)
* @description 上下文参数(外部传入)
* @type {IParam}
* @memberof ControlPropsBase
*/
context?: IParam;
/**
* 视图参数(外部传入)
* @description 视图参数(外部传入)
* @type {IParam}
* @memberof ControlPropsBase
*/
viewParams?: IParam;
/**
* 视图参数(外部传入)
* @description 视图参数(外部传入)
* @type {Subject<IActionParam>}
* @memberof ControlPropsBase
*/
viewSubject: Subject<IActionParam>;
}
\ No newline at end of file
......@@ -2,31 +2,44 @@ import { IActionParam, IParam } from "@ibiz-core";
import { Subject } from "rxjs";
/**
* 部件基类状态
* @description 部件状态基类
* @export
* @interface ControlStateBase
*/
export interface ControlStateBase {
export interface ControlStateBase {
/**
* 部件名称
* @description 部件名称
* @type {string}
* @memberof ControlStateBase
*/
controlName: string;
/**
* 部件代码名称
* @description 部件代码名称
* @type {string}
* @memberof ControlStateBase
*/
controlCodeName: string;
/**
* 上下文参数
* @description 上下文参数
* @type {IParam}
* @memberof ControlStateBase
*/
context: IParam;
/**
* 视图参数
* @description 视图参数
* @type {IParam}
* @memberof ControlStateBase
*/
viewParams: IParam;
/**
* 视图参数(外部传入)
* @description 视图订阅对象
* @type {Subject<IActionParam>}
* @memberof ControlStateBase
*/
viewSubject: Subject<IActionParam>;
......
import { MainControlProps } from "@ibiz-core";
/**
* 表单部件的props
* @description 表单部件的props
* @export
* @interface FormControlProps
* @extends {MainControlProps}
*/
export interface FormControlProps extends MainControlProps {
export interface FormControlProps extends MainControlProps {
}
\ No newline at end of file
import { IParam, MainControlState } from '@ibiz-core';
/**
* 表单部件状态
* @description 表单部件状态
* @export
* @interface FormControlState
* @extends {MainControlState}
*/
export interface FormControlState extends MainControlState {
/**
......
import { deepCopy, FormControlProps, FormControlState, IActionParam, MainControl } from '@ibiz-core';
/**
* 表单部件
* @description 表单部件
* @export
* @class FormControl
* @extends {MainControl}
*/
export class FormControl extends MainControl {
/**
* 部件状态
* @description 部件状态
* @type {FormControlState}
* @memberof FormControl
*/
public declare controlState: FormControlState;
......@@ -22,15 +26,13 @@ export class FormControl extends MainControl {
}
/**
* 使用加载功能模块
* @param props 传入的props
* @description 使用加载功能模块
* @param {FormControlProps} props 传入的props
* @return {*}
* @memberof FormControl
*/
public useLoad(props: FormControlProps){
const { viewSubject, controlName } = this.controlState;
/**
* 加载方法
* @param [opt={}]
*/
const load = async (opt: any = {})=>{
try {
const loadAction = this.controlState.controlAction.loadAction;
......@@ -73,9 +75,11 @@ export class FormControl extends MainControl {
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装部件所有功能模块的方法
* @param {FormControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof FormControl [emit] 事件
*/
public moduleInstall(props: FormControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
......
import { ControlAction, ControlPropsBase } from "@ibiz-core";
/**
* 实体部件的props
* @description 实体部件的props
* @export
* @interface MainControlProps
* @extends {ControlPropsBase}
*/
export interface MainControlProps extends ControlPropsBase {
export interface MainControlProps extends ControlPropsBase {
/**
* 是否显示处理提示(外部控制,优先级高于state)
* @description 是否显示处理提示(外部控制,优先级高于state)
* @type {boolean}
* @memberof MainControlProps
*/
showBusyIndicator?: boolean;
/**
* 部件行为
* @description 部件行为
* @type {ControlAction}
* @memberof MainControlProps
*/
controlAction: ControlAction;
}
\ No newline at end of file
import { ControlAction, ControlStateBase, IParam } from "@ibiz-core";
/**
* 实体部件状态
* @description 实体部件状态
* @export
* @interface MainControlState
* @extends {ControlStateBase}
*/
export interface MainControlState extends ControlStateBase {
export interface MainControlState extends ControlStateBase {
/**
* 是否显示处理提示
* @description 是否显示处理提示
* @type {boolean}
* @memberof MainControlState
*/
showBusyIndicator?: boolean;
/**
* 部件行为
* @description 部件行为
* @type {ControlAction}
* @memberof MainControlState
*/
controlAction: ControlAction;
/**
* 部件服务
* @description 部件服务
* @type {IParam}
* @memberof MainControlState
*/
controlService: IParam;
}
\ No newline at end of file
import { ControlBase, MainControlProps, MainControlState } from '@ibiz-core';
/**
* 实体部件
* @description 实体部件
* @export
* @class ControlBase
* @class MainControl
* @extends {ControlBase}
*/
export class MainControl extends ControlBase {
/**
* 部件状态
* @description 部件状态
* @type {MainControlState}
* @memberof MainControl
*/
public declare controlState: MainControlState;
/**
* 根据props调整设置部件state
* @param props 传入的Props
* @description 根据props调整设置部件state
* @param {MainControlProps} props 传入的Props
* @memberof MainControl
*/
public setState(props: MainControlProps) {
super.setState(props);
......@@ -23,9 +28,11 @@ export class MainControl extends ControlBase {
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装部件所有功能模块的方法
* @param {MainControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MainControl
*/
public moduleInstall(props: MainControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
......
import { Ref } from 'vue';
import { MenuControlProps, MenuControlState, IActionParam, ControlBase, IParam } from '@ibiz-core';
/**
......@@ -7,14 +8,17 @@ import { MenuControlProps, MenuControlState, IActionParam, ControlBase, IParam }
* @extends {ControlBase}
*/
export class MenuControl extends ControlBase {
/**
* 部件状态
* @description 部件状态
* @type {MenuControlState}
* @memberof MenuControl
*/
public declare controlState: MenuControlState;
/**
* @description 根据props调整设置部分部件基类
* @param {MenuControlProps} props
* @param {MenuControlProps} props 菜单输入属性
* @memberof MenuControl
*/
public setState(props: MenuControlProps) {
......@@ -23,16 +27,6 @@ export class MenuControl extends ControlBase {
this.controlState.menuAlign = toRef(props, 'menuAlign') as any;
}
/**
* 修改表单的数据对象的某一属性的值。
* 可通过模块扩展增加一系列相关后续操作。
* @param name 属性名称
* @param value 属性值
*/
public async formDataChange(name: string, value: any){
this.controlState.data[name] = value;
}
/**
* @description 计算有效菜单项
* @param {IParam[]} items 菜单项集合
......@@ -41,9 +35,10 @@ export class MenuControl extends ControlBase {
public computedEffectiveMenus(items: IParam[]) {
items.forEach((item: IParam) => {
const { authService } = this.controlState;
if (!authService?.getMenusPermission?.(item)) {
item.hidden = true;
}
// TODO 获取菜单权限
// if (!authService?.getMenusPermission?.(item)) {
// item.hidden = true;
// }
if (item.items?.length > 0) {
this.computedEffectiveMenus(item.items);
}
......@@ -52,13 +47,13 @@ export class MenuControl extends ControlBase {
/**
* @description 处理默认展开项
* @param {IParam[]} items
* @param {IParam[]} items 菜单集合
* @memberof MenuControl
*/
public handleDefaultOpens(items: IParam[], defaultOpens: string[]) {
public handleDefaultOpens(items: IParam[], defaultOpens: Ref<string[]>) {
items.forEach((item: any) => {
if (item.expanded) {
defaultOpens = [...defaultOpens,item.id];
defaultOpens.value = [... defaultOpens.value, item.name];
}
if (item.items?.length > 0) {
this.handleDefaultOpens(item.items, defaultOpens);
......@@ -71,11 +66,11 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public handleDefaultSelect() {
const { route, funcs, defaultView, menuAlign } = this.controlState;
const { funcs, defaultView, menuAlign } = this.controlState;
const defaultSelectRef = toRef(this.controlState, 'defaultSelect');
const dataRef = toRef(this.controlState, 'menus');
if (route?.matched?.length == 2) {
const [{ }, matched] = route.matched;
if (this.route?.matched?.length == 2) {
const [{ }, matched] = this.route.matched;
const appFunc: any = funcs.find((func: any) => Object.is(func.routePath, matched.path) && Object.is(func.funcType, 'APPVIEW'));
if (appFunc) {
this.computeMenuSelect(dataRef.value, appFunc.funcTag);
......@@ -103,10 +98,10 @@ export class MenuControl extends ControlBase {
* @description 计算菜单选中项
* @param {IParam[]} menus 菜单及he
* @param {string} funcTag 应用标识
* @return {*}
* @return {boolean}
* @memberof MenuControl
*/
public computeMenuSelect(menus: IParam[], funcTag: string) {
public computeMenuSelect(menus: IParam[], funcTag: string): boolean {
const { funcs } = this.controlState;
const defaultSelectRef = toRef(this.controlState, 'defaultSelect');
const defaultOpensRef = toRef(this.controlState, 'defaultOpens');
......@@ -139,19 +134,19 @@ export class MenuControl extends ControlBase {
/**
* @description 获取指定菜单项数据
* @param {IParam[]} menus 菜单集合
* @param {string} id 指定菜单标识
* @param {string} name 指定菜单标识
* @return {*}
* @memberof MenuControl
*/
public compute(menus: IParam[], id: string) {
const item: any = {};
public compute(menus: IParam[], name: string): IParam {
const item: IParam = {};
menus.some((_item: any) => {
if (Object.is(_item.id, id)) {
if (Object.is(_item.name, name)) {
Object.assign(item, _item);
return true;
}
if (_item.items?.length > 0) {
const subItem = this.compute(_item.items, id);
const subItem = this.compute(_item.items, name);
if (Object.keys(subItem).length > 0) {
Object.assign(item, subItem);
return true;
......@@ -172,23 +167,20 @@ export class MenuControl extends ControlBase {
}
/**
* 使用加载功能模块
* @param props 传入的props
* @description 使用加载功能模块
* @param {MenuControlProps} props 传入的props
* @return {*}
* @memberof MenuControl
*/
public useLoad(props: MenuControlProps){
const { viewSubject, controlName } = this.controlState;
/**
* 加载方法
* @param [opt={}]
*/
const load = async (opt: any = {})=>{
const dataRef = toRef(this.controlState, 'menus');
const defaultOpensRef = toRef(this.controlState, 'defaultOpens');
this.computedEffectiveMenus(dataRef.value);
this.handleDefaultOpens(dataRef.value, defaultOpensRef.value);
this.handleDefaultOpens(dataRef.value, defaultOpensRef);
this.handleDefaultSelect();
}
// 订阅viewSubject,监听load行为
if(viewSubject){
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam)=>{
......@@ -206,28 +198,34 @@ export class MenuControl extends ControlBase {
}
}
public menuSelect($event: any) {
console.log($event);
/**
* @description 菜单项选中
* @param {IParam} $event 选中项数据
* @memberof MenuControl
*/
public menuSelect($event: IParam) {
const { key } = $event;
const dataRef = toRef(this.controlState, 'menus');
let item = this.compute(dataRef.value, '');
let item = this.compute(dataRef.value, key);
if (Object.keys(item).length > 0) {
this.menuClick(item);
}
}
/**
* 安装部件所有功能模块的方法
* @param props 传入的Props
* @param [emit] 事件
* @description 安装部件所有功能模块的方法
* @param {MenuControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MenuControl
*/
public moduleInstall(props: MenuControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props)
const menuSelect = this.menuSelect.bind(this);
this.menuSelect =($event: any) => {
menuSelect($event)
this.menuSelect =($event: IParam) => {
menuSelect($event);
}
return {
......
......@@ -3,13 +3,15 @@ import { Subject } from 'rxjs'
import { Ref } from 'vue';
import { IndexView, IActionParam, IParam } from '@ibiz-core';
import { ViewConfig } from './{{page.codeName.spinalCase}}-config';
import { IbizDefaultIndexViewLayout } from '@components';
{{#page.ctrls}}
{{#eq controlType "APPMENU"}}
import { {{codeName}}Menu } from '@widgets/app/{{codeName.spinalCase}}-menu';
{{/eq}}
{{/page.ctrls}}
// props声明和默认值处理
import {
MenuUnfoldOutlined,
MenuFoldOutlined
} from '@ant-design/icons-vue';
interface Props {
context: IParam;
viewParams?: IParam;
......@@ -22,8 +24,7 @@ const props = withDefaults(defineProps<Props>(), {
})
interface ViewEmit {
(name: "CLOSE", value: IActionParam): void;
(name: "VIEWCHANGE", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......@@ -37,9 +38,7 @@ const collapsed: Ref<boolean> = ref(false);
<IbizDefaultIndexViewLayout class="ibiz-index-view" :menuAlign="state.menuAlign" :collapsed="collapsed">
<template #header>
<div class="index-view-header">
{{{{raw-loud}}}}
{{state.viewCaption}}
{{{{/raw-loud}}}}
\{{state.viewCaption}}
<MenuUnfoldOutlined
v-if="collapsed"
class="trigger"
......
......@@ -7,7 +7,6 @@ import { ViewConfig } from './{{page.codeName.spinalCase}}-config';
import { {{codeName}}Form } from '@widgets/{{appEntity.codeName.spinalCase}}/{{codeName.spinalCase}}-form';
{{/eq}}
{{/page.ctrls}}
import { IbizDefaultViewLayout, IbizIconText } from '@components';
// props声明和默认值处理
interface Props {
......@@ -24,8 +23,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface ViewEmit {
(name: "CLOSE", value: IActionParam): void;
(name: "VIEWCHANGE", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......
......@@ -2,6 +2,8 @@
export const CtrlConfig = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
defaultOpens: [],
defaultSelect: [],
menus: [
{{#each ctrl.pSAppMenuItems as | item |}}
{{>(lookup 'MENUITEM') item=item}}
......
......@@ -2,8 +2,6 @@
import { Subject } from "rxjs";
import { CtrlConfig } from "./{{ctrl.codeName.spinalCase}}-menu-config";
import { IParam, IActionParam, MenuControl } from "@ibiz-core";
import { IbizMenuItem } from "@components";
import { useRoute, useRouter } from "vue-router";
interface Props{
context: IParam;
defaultView: string;
......@@ -17,11 +15,8 @@ const props = withDefaults(defineProps<Props>(), {
collapsed: false,
});
const router = useRouter();
const route = useRoute();
interface CtrlEmit {
(name: "Ctrl", value: IActionParam): void;
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
......
......@@ -3,7 +3,6 @@
import { Subject } from 'rxjs';
import { CtrlConfig } from './{{ctrl.codeName.spinalCase}}-form-config';
import { FormControl, IActionParam, IParam, ControlAction } from '@ibiz-core';
import { IbizFormItem, IbizFormGroup } from '@components';
interface Props {
context: IParam;
......@@ -20,7 +19,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface CtrlEmit {
(name: "Ctrl", value: IActionParam): void;
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册