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

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

上级 29d6294a
...@@ -13,7 +13,7 @@ const emit = defineEmits<FormGroupEmit>(); ...@@ -13,7 +13,7 @@ const emit = defineEmits<FormGroupEmit>();
const selectItem: Ref<IParam> = ref({}); const selectItem: Ref<IParam> = ref({});
const items: Ref<any> = ref([]); const items: Ref<any> = ref([]);
const handleClick = ($event: any) => { 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; return;
} }
selectItem.value = $event; selectItem.value = $event;
...@@ -34,14 +34,14 @@ onBeforeMount(() => { ...@@ -34,14 +34,14 @@ onBeforeMount(() => {
<template> <template>
<a-space class="app-quick-group" :size="0"> <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 }"> <span :style="{ color: item.color }">
<AppIconText v-if="!item.children" :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" /> <AppIconText v-if="!item.children" :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" />
<a-dropdown v-else> <a-dropdown v-else>
<AppIconText :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" /> <AppIconText :text="item.text" :iconClass="item.iconClass" :imgPath="item.imgPath" />
<template #overlay> <template #overlay>
<a-menu> <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" /> <AppIconText :text="childItem.text" :iconClass="childItem.iconClass" :imgPath="childItem.imgPath" />
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
......
...@@ -111,7 +111,7 @@ export class MDView extends MainView { ...@@ -111,7 +111,7 @@ export class MDView extends MainView {
*/ */
public handleQuickGroupSearch(args: any = {}): void { public handleQuickGroupSearch(args: any = {}): void {
const { viewParams } = this.state; const { viewParams } = this.state;
Object.assign(viewParams,{quickGroup: args}) Object.assign(viewParams,{quickGroup: args.data})
const tag = this.getMDCtrl().name; const tag = this.getMDCtrl().name;
this.next({ tag: tag, action: 'load', data: viewParams }); this.next({ tag: tag, action: 'load', data: viewParams });
} }
......
export const viewState = { export const viewState = {
gridRowActiveMode: {{page.gridRowActiveMode}}, gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}}, 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}} {{> @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 ...@@ -50,7 +50,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
</template> </template>
{{#if page.enableQuickGroup}} {{#if page.enableQuickGroup}}
<template v-slot:quickGroupSearch> <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> </template>
{{/if}} {{/if}}
{{#page.ctrls}} {{#page.ctrls}}
...@@ -67,10 +67,11 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear ...@@ -67,10 +67,11 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
{{#if page.enableFilter}} {{#if page.enableFilter}}
<template v-slot:quickSearch> <template v-slot:quickSearch>
<div class='app-quick-search'> <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%'}"> <a-popover trigger="click" :overlayStyle="{width: '50%'}">
<template #content> <template #content>
<{{codeName}}SearchForm <{{codeName}}SearchForm
v-if="state.expandSearchForm"
:context="state.context" :context="state.context"
:viewParams="state.viewParams" :viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action" :controlAction="state.{{camelCase name}}.action"
...@@ -85,6 +86,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear ...@@ -85,6 +86,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent, onQuickSear
{{else}} {{else}}
<template v-slot:searchForm> <template v-slot:searchForm>
<{{codeName}}SearchForm <{{codeName}}SearchForm
v-if="state.expandSearchForm"
:context="state.context" :context="state.context"
:viewParams="state.viewParams" :viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action" :controlAction="state.{{camelCase name}}.action"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册