提交 175ccb92 编写于 作者: zhujiamin's avatar zhujiamin

update:表格视图支持快速分组、默认展开搜索表单、快速分组代码表

上级 29d6294a
......@@ -13,7 +13,7 @@ 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) {
if ((selectItem.value && selectItem.value.id && selectItem.value.id === $event.id) || $event.children) {
return;
}
selectItem.value = $event;
......@@ -34,14 +34,14 @@ onBeforeMount(() => {
<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)">
<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">
<a-menu-item v-for="(childItem,index) in item.children" :key="index">
<AppIconText :text="childItem.text" :iconClass="childItem.iconClass" :imgPath="childItem.imgPath" />
</a-menu-item>
</a-menu>
......
......@@ -111,7 +111,7 @@ export class MDView extends MainView {
*/
public handleQuickGroupSearch(args: any = {}): void {
const { viewParams } = this.state;
Object.assign(viewParams,{quickGroup: args})
Object.assign(viewParams,{quickGroup: args.data})
const tag = this.getMDCtrl().name;
this.next({ tag: tag, action: 'load', data: viewParams });
}
......
export const viewState = {
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
{{> @macro/front-end/views/view-base-config.hbs}}
};
\ No newline at end of file
......@@ -50,7 +50,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
</template>
{{#if page.enableQuickGroup}}
<template v-slot:quickGroupSearch>
<app-quick-group :quickGroupModel="state.quickGroupPSCodeList" @onQuickGroupEvent="onQuickGroupEvent" />
<app-quick-group v-if="state.enableQuickGroup" :quickGroupModel="state.quickGroupPSCodeList" @onQuickGroupEvent="onQuickGroupEvent" />
</template>
{{/if}}
{{#page.ctrls}}
......@@ -67,10 +67,11 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
{{#if page.enableFilter}}
<template v-slot:quickSearch>
<div class='app-quick-search'>
<a-input @pressEnter="onQuickSearchEvent($event)" allowClear/>
<a-input v-if="state.enableQuickSearch" @pressEnter="onQuickSearchEvent($event)" allowClear/>
<a-popover trigger="click" :overlayStyle="{width: '50%'}">
<template #content>
<{{codeName}}SearchForm
v-if="state.expandSearchForm"
:context="state.context"
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
......@@ -85,6 +86,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
{{else}}
<template v-slot:searchForm>
<{{codeName}}SearchForm
v-if="state.expandSearchForm"
:context="state.context"
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册