提交 f1928a55 编写于 作者: RedPig97's avatar RedPig97

add: 新增快速分组代码表

上级 3dd64b5f
......@@ -4,6 +4,19 @@
viewCaption: '{{page.caption}}',
height: '{{page.height}}',
width: '{{page.width}}',
enableQuickGroup: {{#if page.enableQuickGroup}}true{{else}}false{{/if}},
{{#if page.quickGroupPSCodeList}}
quickGroupPSCodeList: {
codeName: '{{page.quickGroupPSCodeList.codeName}}',
codeListTag: '{{page.quickGroupPSCodeList.codeListTag}}',
codeListType: '{{page.quickGroupPSCodeList.codeListType}}',
codeItems: [
{{#page.quickGroupPSCodeList.psCodeItems}}
{codeName: '{{codeName}}', color: '{{color}}', data: '{{data}}', text: '{{text}}', value: '{{value}}', iconClass: '{{iconcls}}', imgPath: '{{icon}}'},
{{/page.quickGroupPSCodeList.psCodeItems}}
]
},
{{/if}}
appEntityName: '{{page.appEntity.codeName}}',
isLoadDefault: true,
keyPSDEField: '{{lowerCase page.appEntity.codeName}}',
......
......@@ -11,13 +11,13 @@
<slot name="caption" />
</template>
<template v-slot:header-content>
<slot name="quickGroupSearch" />
<slot name="quickSearch" />
</template>
<template v-slot:header-right>
<slot name="toolbar" />
</template>
<template v-slot:header-bottom>
<slot name="quickGroupSearch" />
<slot name="quickSearchForm" />
<slot name="searchForm" />
</template>
......
<script setup lang="ts">
import { IActionParam, IParam } from '@core';
import { Ref, onBeforeMount } from 'vue';
interface QuickGroupProps {
quickGroupModel: IParam;
}
interface FormGroupEmit {
(name: 'onQuickGroupEvent', value: IActionParam): void;
}
const props = withDefaults(defineProps<QuickGroupProps>(), {});
const emit = defineEmits<FormGroupEmit>();
const selectItem: Ref<IParam> = ref({});
const items: Ref<any> = ref([]);
const handleClick = ($event: any) => {
if ((selectItem.value && selectItem.value.id === $event.id) || $event.children) {
return;
}
selectItem.value = $event;
emit('onQuickGroupEvent', {
tag: 'quickGroup',
action: "valueChange",
data: $event,
});
};
onBeforeMount(() => {
items.value = props.quickGroupModel.codeItems;
//todo
// let res: any = await this.codeListService.getDataItems({ tag: this.quickGroupCodeList.codeName, type: this.quickGroupCodeList.codeListType, data: this.quickGroupCodeList, context: this.context });
// this.quickGroupModel = this.handleDynamicData(JSON.parse(JSON.stringify(res)));
});
</script>
<template>
<a-space class="app-quick-group" :size="0">
<a-button class="quick-group-item" v-for="(item, index) in items" :key="index" type="text" @click="() => handleClick(item)">
<span :style="{ color: item.color }">
<AppIconText v-if="!item.children" :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" />
<a-dropdown v-else>
<AppIconText :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" />
<template #overlay>
<a-menu>
<a-menu-item v-for="(childItem,index) in item.children">
<AppIconText :text="childItem.text" :iconClass="childItem.iconClass" :imgPath="childItem.imgPath" />
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</span>
</a-button>
</a-space>
</template>
......@@ -205,6 +205,17 @@ export class MDView extends MainView {
throw new Error('Method not implemented.');
}
/**
* @description 处理快速分组事件
* @param {IActionParam} $event
* @memberof MDView
*/
public handleQuickGroupEvent($event: IActionParam) {
if ($event) {
this.onSearchFormSearch($event);
}
}
/**
* @description 安装视图所有功能模块的方法
*
......@@ -216,7 +227,8 @@ export class MDView extends MainView {
...superParams,
xDataControl: this.xDataControl,
searchForm: this.searchForm,
searchBar: this.searchBar
searchBar: this.searchBar,
handleQuickGroupEvent: this.handleQuickGroupEvent.bind(this)
};
}
......
......@@ -35,8 +35,6 @@ export class QuickSearchFormControl extends FormControl {
*/
public moduleInstall() {
const superParams = super.moduleInstall();
// 表单行为能力启用
const { loadDraft } = this.useLoadDraft();
return {
...superParams,
};
......
......@@ -18,6 +18,7 @@
display: flex;
justify-content: space-between;
height: var(--app-view-layout-header-height);
min-height: var(--app-view-layout-header-min-height);
margin: --app-view-layout-header-padding;
.app-view__caption {
white-space: nowrap;
......
.app-quick-group {
.ant-space-item {
height: 100%;
max-height: 48px;
.quick-group-item {
padding: 0;
margin: 0 10px;
height: 100%;
border-bottom: 2px solid var(--app-color-primary);
&:hover .app-icon-text {
color: var(--app-color-primary);
}
}
}
}
\ No newline at end of file
@use './icon-text.scss';
\ No newline at end of file
@use './icon-text.scss';
@use './app-quick-group.scss';
\ No newline at end of file
......@@ -25,6 +25,7 @@
--app-view-layout-body-bg-color: var(--app-color-white);
--app-view-layout-footer-bg-color: var(--app-color-white);
--app-view-layout-header-height: auto;
--app-view-layout-header-min-height: 48px;
--app-view-layout-header-border-bottom: var(--app-color-border);
--app-view-caption-font-size: var(--app-font-size-lg)
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewState, props, emit).moduleInstall();
const { state, grid, handleCtrlEvent, handleToolbarEvent, handleQuickGroupEvent } = new GridView(viewState, props, emit).moduleInstall();
</script>
......@@ -45,6 +45,11 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
<template v-slot:caption>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
{{#if page.enableQuickGroup}}
<template v-slot:quickGroupSearch>
<app-quick-group :quickGroupModel="state.quickGroupPSCodeList" @onQuickGroupEvent="handleQuickGroupEvent" />
</template>
{{/if}}
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
<template v-slot:toolbar>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册