提交 42fcee83 编写于 作者: sq3536's avatar sq3536

Merge remote-tracking branch 'origin/master'

......@@ -59,4 +59,13 @@ public class CtrlModel extends BaseModel{
return (IPSControl)opt;
}
public String getTempFilter() {
String name = this.getControl().getName();
if ("QUICKSEARCHFORM".equals(name.toUpperCase())) {
return "QUICKSEARCHFORM";
} else {
return this.getControl().getControlType();
}
}
}
......@@ -179,7 +179,7 @@ public class ModelStorage {
{
getSystemModel().getApps().forEach(app->{
app.getCtrls().forEach(item->{
CliOption opt=newCliOption(TemplateFileType.ctrl).setCliSubType(item.getName().toUpperCase()).baseData(item,StringAdvUtils.spinalcase(item.getCodeName())).set("apps",app.getCodeName().toLowerCase()).set("appEntities",item.getFolder().toSpinalCase());
CliOption opt=newCliOption(TemplateFileType.ctrl).setCliSubType(item.getTempFilter().toUpperCase()).baseData(item,StringAdvUtils.spinalcase(item.getCodeName())).set("apps",app.getCodeName().toLowerCase()).set("appEntities",item.getFolder().toSpinalCase());
rt.addOption(opt);
});
});
......
......@@ -40,10 +40,10 @@
{{/eq}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -22,10 +22,10 @@
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -8,10 +8,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -5,11 +5,11 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
:context="state.context"
:viewParams="state.viewParams"/>
\ No newline at end of file
......@@ -26,10 +26,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
\ No newline at end of file
......@@ -53,10 +53,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
\ No newline at end of file
......@@ -47,10 +47,10 @@
{{/eq}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -28,11 +28,11 @@
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
:data="state.data"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -8,11 +8,11 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -38,10 +38,10 @@
{{/eq}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -38,10 +38,10 @@
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -22,10 +22,10 @@
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
\ No newline at end of file
......@@ -14,10 +14,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -12,10 +12,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -20,11 +20,11 @@
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
:data="state.data"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -18,10 +18,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -20,10 +20,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -11,10 +11,10 @@
{{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -31,10 +31,10 @@
{{/eq}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
@editorEvent="onEditorEvent"
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event) => handleEditorEvent(index,$event)"
@editorEvent="($event) => onEditorEvent(index,$event)"
{{/eq}}
/>
......@@ -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}}',
......
......@@ -12,7 +12,7 @@
:titleBarCloseMode="{{item.titleBarCloseMode}}"
:showCaption="{{item.showCaption}}"
:uIActionGroup="state.detailsModel.{{item.codeName}}.uIActionGroup"
@componentEvent="handleComponentEvent">
@componentEvent="onComponentEvent">
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-form-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
{{#each item.psDEFormDetails as | formDetail |}}
......@@ -43,7 +43,7 @@
:titleBarCloseMode="{{item.titleBarCloseMode}}"
:showCaption="{{item.showCaption}}"
:uIActionGroup="state.detailsModel.{{item.codeName}}.uIActionGroup"
@componentEvent="handleComponentEvent">
@componentEvent="onComponentEvent">
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-form-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
{{#each item.psDEFormDetails as | formDetail |}}
......
import { IParam } from "@core";
export const AppCodeListConfig:IParam = {
{{#each app.getAllPSAppCodeLists as |appCodeList|}}
'{{appCodeList.getCodeListTag}}':{
'name': '{{appCodeList.getName}}',
'codeName': '{{appCodeList.getCodeName}}',
'codeListTag': '{{appCodeList.getCodeListTag}}',
'codeListType': '{{appCodeList.getCodeListType}}',
'isEnableCache': {{appCodeList.isEnableCache}},
'cacheTimeout': {{appCodeList.getCacheTimeout}},
{{~#if appCodeList.getMinorSortDir}}'minorSortDir': '{{appCodeList.getMinorSortDir}}',{{/if~}}
{{~#if appCodeList.getMinorSortPSAppDEField}}'minorSortPSAppDEField': '{{lowerCase appCodeList.getMinorSortPSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getPredefinedType}}'predefinedType': '{{appCodeList.getPredefinedType}}',{{/if~}}
{{~#if appCodeList.getPSAppDataEntity}}'appDataEntity': '{{appCodeList.getPSAppDataEntity.codeName}}',{{/if~}}
{{~#if appCodeList.getPSAppDEDataSet}}'appDEDataSet': '{{appCodeList.getPSAppDEDataSet.codeName}}',{{/if~}}
{{~#if appCodeList.getTextPSAppDEField}}'textPSAppDEField': '{{lowerCase appCodeList.getTextPSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getValuePSAppDEField}}'valuePSAppDEField': '{{lowerCase appCodeList.getValuePSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getPValuePSAppDEField}}'pValuePSAppDEField': '{{lowerCase appCodeList.getPValuePSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getDisablePSAppDEField}}'disablePSAppDEField': '{{lowerCase appCodeList.getDisablePSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getIconPathPSAppDEField}}'iconPathPSAppDEField': '{{lowerCase appCodeList.getIconPathPSAppDEField.codeName}}',{{/if~}}
{{~#if appCodeList.getIconClsPSAppDEField}}'iconClsPSAppDEField': '{{lowerCase appCodeList.getIconClsPSAppDEField.codeName}}',{{/if}}
'emptyText': '{{appCodeList.getEmptyText}}',
{{#if appCodeList.getPSCodeItems}}
'items':[
{{#each appCodeList.getPSCodeItems as |codeItem|}}
{'value': {{#if appCodeList.isCodeItemValueNumber}}{{codeItem.getValue}}{{else}}'{{codeItem.getValue}}'{{/if}}, 'text': '{{codeItem.getText}}','codeName': '{{codeItem.codeName}}' }{{#unless @last}},{{/unless}}
{{/each}}
]
{{/if}}
}{{#unless @last}},{{/unless}}
{{/each}}
}
\ No newline at end of file
export { AppFuncConfig } from './app-func-config';
export { AppViewConfig } from './app-view-config';
export { AppCodeListConfig } from './app-code-list-config';
\ No newline at end of file
......@@ -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>
......@@ -29,7 +29,7 @@ export class MainView extends ViewBase {
* @param {IActionParam} actionParam
* @memberof MainView
*/
public handleToolbarEvent(actionParam: IActionParam) {
public onToolbarEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
if (!tag || !action || !data) {
console.warn("工具栏执行参数不足");
......@@ -58,7 +58,7 @@ export class MainView extends ViewBase {
* @param {IActionParam} actionParam
* @memberof MainView
*/
public handleCtrlEvent(actionParam: IActionParam) { }
public onCtrlEvent(actionParam: IActionParam) { }
/**
* @description 安装视图所有功能模块的方法
......@@ -70,8 +70,8 @@ export class MainView extends ViewBase {
return {
...superParams,
xDataControl: this.xDataControl,
handleToolbarEvent: this.handleToolbarEvent.bind(this),
handleCtrlEvent: this.handleCtrlEvent.bind(this),
onToolbarEvent: this.onToolbarEvent.bind(this),
onCtrlEvent: this.onCtrlEvent.bind(this),
};
}
}
......@@ -104,6 +104,18 @@ export class MDView extends MainView {
this.state.isLoadDefault = true;
}
/**
* @description 快速分组查询
* @param {*} [args={}]
* @memberof MDView
*/
public handleQuickGroupSearch(args: any = {}): void {
const { viewParams } = this.state;
Object.assign(viewParams,{quickGroup: args})
const tag = this.getMDCtrl().name;
this.next({ tag: tag, action: 'load', data: viewParams });
}
/**
* 搜索表单搜索
*
......@@ -205,6 +217,17 @@ export class MDView extends MainView {
throw new Error('Method not implemented.');
}
/**
* @description 处理快速分组事件
* @param {IActionParam} $event
* @memberof MDView
*/
public onQuickGroupEvent($event: IActionParam) {
if ($event) {
this.handleQuickGroupSearch($event);
}
}
/**
* @description 安装视图所有功能模块的方法
*
......@@ -216,7 +239,8 @@ export class MDView extends MainView {
...superParams,
xDataControl: this.xDataControl,
searchForm: this.searchForm,
searchBar: this.searchBar
searchBar: this.searchBar,
onQuickGroupEvent: this.onQuickGroupEvent.bind(this)
};
}
......
......@@ -605,7 +605,7 @@ export class FormControl extends MainControl {
* @param {IActionParam} actionParam 行为参数
* @memberof FormControl
*/
public handleEditorEvent(actionParam: IActionParam) {
public onEditorEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
switch (action) {
case 'valueChange':
......@@ -621,7 +621,7 @@ export class FormControl extends MainControl {
* @param {IActionParam} actionParam 行为参数
* @memberof FormControl
*/
public handleComponentEvent(actionParam: IActionParam) {
public onComponentEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
switch (action) {
case 'formGroupAction':
......@@ -654,8 +654,8 @@ export class FormControl extends MainControl {
load: this.useLoad(),
loadDraft: this.useLoadDraft(),
save: this.useSave(),
handleEditorEvent: this.handleEditorEvent.bind(this),
handleComponentEvent: this.handleComponentEvent.bind(this),
onEditorEvent: this.onEditorEvent.bind(this),
onComponentEvent: this.onComponentEvent.bind(this),
};
}
}
......@@ -91,11 +91,11 @@ export class GridControl extends MDControl {
};
});
// 列拖动
const handleResizeColumn = (width: number, column: IParam) => {
const onResizeColumn = (width: number, column: IParam) => {
column.width = width;
}
// 处理表格变化(分页,过滤,排序)
const handleGridChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
const onGridChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
if (pagination) {
this.useLoad().load();
}
......@@ -106,8 +106,8 @@ export class GridControl extends MDControl {
useRowClassName,
useCustomRow,
useRowSelectionOption,
handleResizeColumn,
handleGridChange
onResizeColumn,
onGridChange
}
}
......
......@@ -19,8 +19,8 @@ export class QuickSearchFormControl extends FormControl {
* @param {IActionParam} actionParam 行为参数
* @memberof FormControl
*/
public handleEditorEvent(actionParam: IActionParam) {
super.handleEditorEvent(actionParam);
public onEditorEvent(actionParam: IActionParam) {
super.onEditorEvent(actionParam);
this.emit("onCtrlEvent", {
tag: this.state.controlName,
action: "selectionChange",
......@@ -35,8 +35,6 @@ export class QuickSearchFormControl extends FormControl {
*/
public moduleInstall() {
const superParams = super.moduleInstall();
// 表单行为能力启用
const { loadDraft } = this.useLoadDraft();
return {
...superParams,
};
......
......@@ -40,7 +40,7 @@ export class SearchFormControl extends FormControl {
* @description 添加历史项
* @memberof SearchFormControl
*/
public addHistoryItem() {
public onSaveHistoryItem() {
//todo saveModel服务
this.state.showPopover = false;
}
......@@ -50,7 +50,7 @@ export class SearchFormControl extends FormControl {
* @param {IParam} item
* @memberof SearchFormControl
*/
public removeHistoryItem(item: IParam) {
public onRemoveHistoryItem(item: IParam) {
const index = this.state.historyItems.findIndex((_item: IParam) => {
return item.name == _item.name && item.value == _item.value;
})
......@@ -80,8 +80,8 @@ export class SearchFormControl extends FormControl {
...superParams,
onSearch: this.onSearch.bind(this),
onCancel: this.onCancel.bind(this),
addHistoryItem: this.addHistoryItem.bind(this),
removeHistoryItem: this.removeHistoryItem.bind(this),
onSaveHistoryItem: this.onSaveHistoryItem.bind(this),
onRemoveHistoryItem: this.onRemoveHistoryItem.bind(this),
};
}
}
......@@ -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
......@@ -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
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, form, handleToolbarEvent } = new EditView(viewState, props, emit).moduleInstall();
const { state, form, onToolbarEvent } = new EditView(viewState, props, emit).moduleInstall();
</script>
......@@ -51,7 +51,7 @@ const { state, form, handleToolbarEvent } = new EditView(viewState, props, emit)
mode="button"
name="{{lowerCase codeName}}"
:actionModel="state.toolbar"
@onToolbarEvent="handleToolbarEvent"/>
@onToolbarEvent="onToolbarEvent"/>
</template>
{{/eq}}
{{#eq controlType "FORM"}}
......
......@@ -36,7 +36,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewState, props, emit).moduleInstall();
const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = 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="onQuickGroupEvent" />
</template>
{{/if}}
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
<template v-slot:toolbar>
......@@ -52,7 +57,7 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
mode="button"
name="{{lowerCase codeName}}"
:actionModel="state.toolbar"
@onToolbarEvent="handleToolbarEvent"/>
@onToolbarEvent="onToolbarEvent"/>
</template>
{{/eq}}
{{#if (and (eq controlType "SEARCHFORM") (eq name 'searchform'))}}
......@@ -67,7 +72,7 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="handleCtrlEvent"
@onCtrlEvent="onCtrlEvent"
></{{codeName}}SearchForm>
</template>
<a-button><filter-outlined /></a-button>
......@@ -81,7 +86,7 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="handleCtrlEvent"
@onCtrlEvent="onCtrlEvent"
></{{codeName}}SearchForm>
</template>
{{/if}}
......@@ -93,7 +98,7 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="handleCtrlEvent"
@onCtrlEvent="onCtrlEvent"
></{{codeName}}QuickSearchForm>
</template>
{{/if}}
......@@ -107,7 +112,7 @@ const { state, grid, handleCtrlEvent, handleToolbarEvent } = new GridView(viewSt
:viewParams="state.viewParams"
:controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="handleCtrlEvent"
@onCtrlEvent="onCtrlEvent"
></{{codeName}}Grid>
{{/eq}}
{{/page.ctrls}}
......
......@@ -25,7 +25,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent, handleComponentEvent } = new FormControl(ctrlState, props, emit).moduleInstall();
const { state, onEditorEvent, onComponentEvent } = new FormControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -31,7 +31,7 @@ const emit = defineEmits<{(event: 'onCtrlevent', value: IActionParam): void;}>()
// 安装功能模块,提供状态和能力
const { state, useCustom } = new GridControl(ctrlState, props, emit).moduleInstall();
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, handleResizeColumn, handleGridChange } = useCustom;
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange } = useCustom;
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......@@ -51,8 +51,8 @@ defineExpose({ state, name: '{{ctrl.name}}' });
:pagination="state.mdCtrlPaging.pagination"
:customRow="customRow"
:rowClassName="rowClassName"
@change="handleGridChange"
@resizeColumn="handleResizeColumn"
@change="onGridChange"
@resizeColumn="onResizeColumn"
>
<template #emptyText>
<div class="not-data">
......
......@@ -26,7 +26,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent } = new QuickSearchFormControl(ctrlState, props, emit).moduleInstall();
const { state, onEditorEvent } = new QuickSearchFormControl(ctrlState, props, emit).moduleInstall();
</script>
<template>
......
......@@ -26,7 +26,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent, handleComponentEvent, onSearch, loadDraft, addHistoryItem, onCancel, removeHistoryItem } = new SearchFormControl(ctrlState, props, emit).moduleInstall();
const { state, onEditorEvent, onComponentEvent, onSearch, loadDraft, onSaveHistoryItem, onCancel, onRemoveHistoryItem } = new SearchFormControl(ctrlState, props, emit).moduleInstall();
</script>
<template>
......@@ -63,7 +63,7 @@ const { state, handleEditorEvent, handleComponentEvent, onSearch, loadDraft, add
v-model:Value="state.selectHistoryItem"
@change="handleChange"
>
<a-select-option class="search-form-history-option" v-for="(item,index) in state.historyItems" :key="index" :value="item.value">\{{item.name}} <close-outlined @click="() => removeHistoryItem(item)" /></a-select-option>
<a-select-option class="search-form-history-option" v-for="(item,index) in state.historyItems" :key="index" :value="item.value">\{{item.name}} <close-outlined @click="() => onRemoveHistoryItem(item)" /></a-select-option>
</a-select>
<a-button class='search-button' @click="onSearch" type="primary">搜索</a-button>
<a-button class='reset-button' @click='loadDraft'>重置</a-button>
......@@ -72,7 +72,7 @@ const { state, handleEditorEvent, handleComponentEvent, onSearch, loadDraft, add
<a-input />
<div class="search-form-buttons">
<a-button @click="onCancel">取消</a-button>
<a-button @click="addHistoryItem" type="primary">保存</a-button>
<a-button @click="onSaveHistoryItem" type="primary">保存</a-button>
</div>
</template>
<a-button><save-outlined /></a-button>
......
import { ControlVOBase, TreeControlVO, TreeNodeVO, TreeNodeRSVO, TreeService } from "@core";
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@api/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
export class ControlVO extends ControlVOBase implements TreeControlVO {
get rootVisible(): boolean {
return {{ctrl.rootVisible}};
}
get treeNodes(): TreeNodeVO[] {
return [
{{#each ctrl.psDETreeNodes as | treeNode |}}
{
allowDrag: {{treeNode.allowDrag}},
allowDrop: {{treeNode.allowDrop}},
allowEditText: {{treeNode.allowEditText}},
allowOrder: {{treeNode.allowOrder}},
{{#if treeNode.psAppDataEntity}}
appDataEntity: {
codeName: '{{treeNode.psAppDataEntity.codeName}}',
{{#each treeNode.psAppDataEntity.allPSAppDEFields as | field |}}
{{#if field.keyField}}
keyField: '{{field.codeName}}',
{{/if}}
{{#if field.majorField}}
majorField: '{{field.majorField}}',
{{/if}}
{{/each}}
},
{{/if}}
{{#if treeNode.psAppDEDataSet}}
appDeDataSet: { codeName: '{{treeNode.psAppDEDataSet.codeName}}' },
{{/if}}
appendPNodeId: {{treeNode.appendPNodeId}},
{{#if treeNode.psCodeList}}
codeList: {
codeName: '{{treeNode.psCodeList.codeName}}',
type: '{{treeNode.psCodeList.codeListType}}'
},
{{/if}}
counterId: '{{treeNode.counterId}}',
counterMode: {{treeNode.counterMode}},
{{#if treeNode.psSysCss}}
cssName: '{{treeNode.psSysCss.cssName}}'
{{/if}}
{{#if treeNode.psDETreeNodeDataItems}}
deTreeNodeDataItems: [
customCode: {{dataItem.customCode}},
{{#each treeNode.psDETreeNodeDataItems as | dataItem |}}
{{#if dataItem.psAppDEField}}
fieldCodeName: '{{dataItem.psAppDEField.codeName}}',
{{/if}}
name: '{{dataItem.name}}',
scriptCode: `{{dataItem.scriptCode}}`
{{/each}}
],
{{/if}}
disableSelect: {{treeNode.disableSelect}},
enableCheck: {{treeNode.enableCheck}},
enableQuickSearch: {{treeNode.enableQuickSearch}},
expandFirstOnly: {{treeNode.expandFirstOnly}},
expanded: {{treeNode.expanded}},
hasPSDETreeNodeRSs: {{treeNode.hasPSDETreeNodeRSs}},
{{#if treeNode.leafFlagPSAppDEField}}
leafFlagPSAppDEField: { codeName: '{{treeNode.leafFlagPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNode.idPSAppDEField}}
idPSAppDEField: { codeName: '{{treeNode.idPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNode.iconPSAppDEField}}
iconPSAppDEField: { codeName: '{{treeNode.iconPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNode.psSysImage}}
{{#if treeNode.psSysImage.cssClass}}
iconcls: '{{treeNode.psSysImage.cssClass}}',
{{else if (treeNode.psSysImage.imagePath)}}
icon: '{{treeNode.psSysImage.imagePath}}',
{{/if}}
{{/if}}
id: '{{treeNode.id}}',
navFilter: '{{treeNode.navFilter}}',
{{#if treeNode.psNavigateContexts}}
navigateContext: {
{{#each treeNode.psNavigateContexts as | navContext |}}
{{navContext.key}}: '{{#if navContext.rawValue}}{{navContext.value}}{{else}}%{{navContext.value}}%{{/if}}',
{{/each}}
},
{{/if}}
{{#if treeNode.psNavigateParams}}
navigateParams: {
{{#each treeNode.psNavigateParams as | navParam |}}
{{navParam.key}}: '{{#if navParam.rawValue}}{{navParam.value}}{{else}}%{{navParam.value}}%{{/if}}',
{{/each}}
},
{{/if}}
{{#if treeNode.navPSAppView}}
navView: {
viewName: '{{treeNode.navPSAppView.codeName}}'
},
{{/if}}
{{#if treeNode.nodeValue}}
nodeValue: '{{treeNode.nodeValue}}',
{{/if}}
nodeType: '{{treeNode.nodeType}}',
rootNode: {{treeNode.rootNode}},
selectFirstOnly: {{treeNode.selectFirstOnly}},
selected: {{treeNode.selected}},
{{#if treeNode.sortDir}}
sortDir: '{{treeNode.sortDir}}',
{{/if}}
{{#if treeNode.sortPSAppDEField}}
sortPSAppDEField: { codeName: '{{treeNode.sortPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNode.textFormat}}
textFormat: '{{treeNode.textFormat}}',
{{/if}}
{{#if treeNode.textPSAppDEField}}
textPSAppDEField: { codeName: '{{treeNode.textPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNode.text}}
text: '{{treeNode.text}}',
{{/if}}
{{#if treeNode.tooltip}}
tooltip: '{{treeNode.tooltip}}',
{{/if}}
treeNodeType: '{{treeNode.treeNodeType}}',
},
{{/each}}
];
}
get treeNodeRSs(): TreeNodeRSVO[] {
return [
{{#each ctrl.psDETreeNodeRSs as | treeNodeRS |}}
{
{{#if treeNodeRS.childPSDETreeNode}}
childDeTreeNode: {
id: '{{treeNodeRS.childPSDETreeNode.id}}'
},
{{/if}}
{{#if treeNodeRS.psNavigateContexts}}
navigateContext: {
{{#each treeNodeRS.psNavigateContexts as | navContext |}}
{{navContext.key}}: '{{#if navContext.rawValue}}{{navContext.value}}{{else}}%{{navContext.value}}%{{/if}}',
{{/each}}
},
{{/if}}
{{#if treeNodeRS.psNavigateParams}}
navigateParams: {
{{#each treeNodeRS.psNavigateParams as | navParam |}}
{{navParam.key}}: '{{#if navParam.rawValue}}{{navParam.value}}{{else}}%{{navParam.value}}%{{/if}}',
{{/each}}
},
{{/if}}
{{#if treeNodeRS.psDETreeNodeRSParams}}
params: {
{{#each treeNodeRS.psDETreeNodeRSParams as | param |}}
{{param.key}}: { value: '{{param.value}}' }
{{/each}}
},
{{/if}}
{{#if treeNodeRS.parentFilter}}
parentFilter: '{{treeNodeRS.parentFilter}}',
{{/if}}
{{#if treeNodeRS.parentPSDER1N}}
parentPSDER1N: { codeName: '{{treeNodeRS.parentPSDER1N.codeName}}' },
{{/if}}
{{#if treeNodeRS.parentPSAppDEField}}
parentPSAppDEField: { codeName: '{{treeNodeRS.parentPSAppDEField.codeName}}' },
{{/if}}
{{#if treeNodeRS.parentPSDETreeNode}}
parentPSDETreeNode: { id: '{{treeNodeRS.parentPSDETreeNode.id}}' },
{{/if}}
parentValueLevel: {{#if treeNodeRS.parentValueLevel}}{{treeNodeRS.parentValueLevel}}{{else}}null{{/if}},
searchMode: {{treeNodeRS.searchMode}}
},
{{/each}}
];
}
}
export const ctrlState = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new TreeService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
currentselectedNode: {},
data: [],
selectedNodes: []
};
\ No newline at end of file
......@@ -45,13 +45,14 @@ export class ControlVO extends ControlVOBase implements TreeControlVO {
{{/if}}
{{#if treeNode.psDETreeNodeDataItems}}
deTreeNodeDataItems: [
customCode: {{dataItem.customCode}},
{{#each treeNode.psDETreeNodeDataItems as | dataItem |}}
{
customCode: {{dataItem.customCode}},
{{#if dataItem.psAppDEField}}
fieldCodeName: '{{dataItem.psAppDEField.codeName}}',
{{/if}}
name: '{{dataItem.name}}',
scriptCode: `{{dataItem.scriptCode}}`
name: '{{dataItem.name}}'
},
{{/each}}
],
{{/if}}
......
import {{ctrl.codeName}}Tree from "./{{spinalCase ctrl.codeName}}-tree.vue";
export { {{ctrl.codeName}}Tree };
<script setup lang="ts">
import { Subject } from 'rxjs';
import { IActionParam, IParam, ControlAction, TreeControl, IContext } from '@core';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-tree-state';
interface Props {
context: IContext;
multiple: boolean;
selectedData: IParam[];
selectFirstDefault: boolean;
isBranchAvailable: boolean;
viewParams?: IParam;
controlAction: ControlAction;
showBusyIndicator?: boolean;
viewSubject: Subject<IActionParam>;
}
const props = withDefaults(defineProps<Props>(), {
viewSubject: () => new Subject<IActionParam>(),
showBusyIndicator: true,
selectFirstDefault: false,
isBranchAvailable: false
})
// emit声明
interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, load, treeNodeSelect } = new TreeControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
</script>
// TODO 树节点待支持图标和自定义绘制
<template>
<a-tree
class="app-tree{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
:tree-data="state.data"
:load-data="load"
:fieldNames="{ title: 'text', key: 'id' }"
@select="treeNodeSelect">
<template #title="{ text, id }">
<div class="app-tree-node">
<span class="tree-node__title">\{{ text }}</span>
</div>
</template>
</a-tree>
</template>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册