提交 366b75a1 编写于 作者: xignzi006's avatar xignzi006

Merge remote-tracking branch 'origin/master'

...@@ -2,6 +2,7 @@ package cn.ibizlab.codegen.templating.handlebars; ...@@ -2,6 +2,7 @@ package cn.ibizlab.codegen.templating.handlebars;
import cn.ibizlab.codegen.utils.Inflector; import cn.ibizlab.codegen.utils.Inflector;
import cn.ibizlab.codegen.utils.StringAdvUtils; import cn.ibizlab.codegen.utils.StringAdvUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.jknack.handlebars.Helper; import com.github.jknack.handlebars.Helper;
import com.github.jknack.handlebars.Options; import com.github.jknack.handlebars.Options;
import com.github.jknack.handlebars.TagType; import com.github.jknack.handlebars.TagType;
...@@ -117,6 +118,12 @@ public enum StringHelpers implements Helper<Object> { ...@@ -117,6 +118,12 @@ public enum StringHelpers implements Helper<Object> {
protected CharSequence safeApply(final Object value, final Options options) { protected CharSequence safeApply(final Object value, final Options options) {
return Inflector.getInstance().pluralize(StringAdvUtils.camelcase(value.toString()).toLowerCase()); return Inflector.getInstance().pluralize(StringAdvUtils.camelcase(value.toString()).toLowerCase());
} }
},
jsonParse {
@Override
protected CharSequence safeApply(Object context, Options options) throws IOException {
return options.fn(JSONObject.parseObject(context.toString()));
}
}; };
...@@ -137,7 +144,7 @@ public enum StringHelpers implements Helper<Object> { ...@@ -137,7 +144,7 @@ public enum StringHelpers implements Helper<Object> {
* @param options The options object. * @param options The options object.
* @return A string result. * @return A string result.
*/ */
protected abstract CharSequence safeApply(Object context, Options options); protected abstract CharSequence safeApply(Object context, Options options) throws IOException;
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
codeListType="{{item.psEditor.psAppCodeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
{{/if}} {{/if}}
{{#if item.dataType}} {{#if item.dataType}}
dataType="{{item.dataType}}" :dataType="{{item.dataType}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.unitName}} {{#if item.psEditor.editorParams.unitName}}
unitName="{{item.psEditor.editorParams.unitName}}" unitName="{{item.psEditor.editorParams.unitName}}"
......
...@@ -24,17 +24,21 @@ ...@@ -24,17 +24,21 @@
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readonly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.precision}} {{#if item.psEditor.editorParams}}
:precision="{{item.psEditor.editorParams.precision}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if precision}}
{{#if item.psEditor.editorParams.stepValue}} :precision="{{precision}}"
:step="{{item.psEditor.editorParams.stepValue}}" {{/if}}
{{/if}} {{#if step}}
{{#if item.psEditor.editorParams.minValue}} :step="{{step}}"
:min="{{item.psEditor.editorParams.minValue}}" {{/if}}
{{/if}} {{#if max}}
{{#if item.psEditor.editorParams.maxValue}} :max="{{max}}"
:max="{{item.psEditor.editorParams.maxValue}}" {{/if}}
{{#if min}}
:min="{{min}}"
{{/if}}
{{/jsonParse}}
{{/if}} {{/if}}
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}} {{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}" :value="state.data.{{item.psEditor.name}}"
......
...@@ -130,9 +130,12 @@ const handleContentShowStatusChange = (event: MouseEvent) => { ...@@ -130,9 +130,12 @@ const handleContentShowStatusChange = (event: MouseEvent) => {
} }
} }
.ant-card-body { .ant-card-body {
height: calc(100% - 38px); height: 100%;
padding-top: 6px; padding-top: 6px;
} }
.ant-card-head + .ant-card-body {
height: calc(100% - 38px);
}
} }
.show-content-icon { .show-content-icon {
position: absolute; position: absolute;
......
...@@ -162,7 +162,7 @@ const handelViewEvent = (actionParam: IActionParam) => { ...@@ -162,7 +162,7 @@ const handelViewEvent = (actionParam: IActionParam) => {
case 'viewDataChange': case 'viewDataChange':
viewDataChange(data); viewDataChange(data);
break; break;
case 'close': case 'viewClose':
close(data); close(data);
break; break;
} }
......
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, Ref, ref } from 'vue'; import { onBeforeMount, Ref, ref } from 'vue';
import { SearchOutlined, ExportOutlined } from '@ant-design/icons-vue'; import { SearchOutlined, ExportOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import { deepCopy, IParam, IActionParam, EditorBase, IContext, PickupView } from '@core'; import { deepCopy, IParam, IActionParam, EditorBase, IContext, PickupView, isExistAndNotEmpty } from '@core';
interface DataPickerProps { interface DataPickerProps {
/** /**
* @description 编辑器名称 * @description 编辑器名称
...@@ -116,12 +116,12 @@ interface DataPickerProps { ...@@ -116,12 +116,12 @@ interface DataPickerProps {
/** /**
* @description 无AC * @description 无AC
*/ */
noAc?:boolean; noAc?: boolean;
/** /**
* @description 显示按钮 * @description 显示按钮
*/ */
showButton?:boolean; showButton?: boolean;
/** /**
* @description 是否下拉 * @description 是否下拉
...@@ -200,15 +200,18 @@ const onSearch = (value: string) => { ...@@ -200,15 +200,18 @@ const onSearch = (value: string) => {
App.getNotificationService().warning({ message: '获取数据失败', desription: '查询参数不存在' }); App.getNotificationService().warning({ message: '获取数据失败', desription: '查询参数不存在' });
} else { } else {
const { serviceName, interfaceName } = props.acParams; const { serviceName, interfaceName } = props.acParams;
props.service.getItems(serviceName, interfaceName, _navContext, _navViewParam).then((response: any) => { props.service
if (!response) { .getItems(serviceName, interfaceName, _navContext, _navViewParam)
App.getNotificationService().warning({ message: '获取数据失败', desription: '' }); .then((response: any) => {
return; if (!response) {
} App.getNotificationService().warning({ message: '获取数据失败', desription: '' });
items.value = [...response]; return;
}).catch((error: any) => { }
App.getNotificationService().warning({ message: '获取数据失败', desription: error?.message }); items.value = [...response];
}) })
.catch((error: any) => {
App.getNotificationService().warning({ message: '获取数据失败', desription: error?.message });
});
} }
}; };
...@@ -216,6 +219,7 @@ const filterOption = (inputValue: string, option: IParam) => { ...@@ -216,6 +219,7 @@ const filterOption = (inputValue: string, option: IParam) => {
return option[props.deMajorField].toUpperCase().indexOf(inputValue.toUpperCase()) >= 0; return option[props.deMajorField].toUpperCase().indexOf(inputValue.toUpperCase()) >= 0;
}; };
// 选中
const onSelect = (value: any) => { const onSelect = (value: any) => {
const selectItem = items.value.find((item: IParam) => Object.is(item[props.deKeyField!], value)); const selectItem = items.value.find((item: IParam) => Object.is(item[props.deKeyField!], value));
emit('editorEvent', { emit('editorEvent', {
...@@ -223,17 +227,35 @@ const onSelect = (value: any) => { ...@@ -223,17 +227,35 @@ const onSelect = (value: any) => {
action: 'valueChange', action: 'valueChange',
data: selectItem[props.deMajorField!], data: selectItem[props.deMajorField!],
}); });
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField!] }); if (props.valueItem) {
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField!] });
}
fillPickUpData(selectItem); fillPickUpData(selectItem);
}; };
// 清空值
const clear = (value: any) => {
emit('editorEvent', {
tag: props.name,
action: 'valueChange',
data: null,
});
if (props.valueItem) {
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: null });
}
};
// 编辑器抛值 // 编辑器抛值
const doEditorEmit = (data: any[]): any => { const doEditorEmit = (data: any[]): any => {
let majorValue: any = ''; let majorValue: any = '';
let keyValue: any = ''; let keyValue: any = '';
data.forEach((item: any) => { data.forEach((item: any) => {
majorValue = item[props.deMajorField] ? majorValue + (majorValue ? props.separator : '') + item[props.deMajorField] : majorValue + (majorValue ? props.separator : '') + item['srfmajortext']; majorValue = item[props.deMajorField]
keyValue = item[props.deKeyField] ? keyValue + (keyValue ? props.separator : '') + item[props.deKeyField] : keyValue + (keyValue ? props.separator : '') + item['srfkey']; ? majorValue + (majorValue ? props.separator : '') + item[props.deMajorField]
: majorValue + (majorValue ? props.separator : '') + item['srfmajortext'];
keyValue = item[props.deKeyField]
? keyValue + (keyValue ? props.separator : '') + item[props.deKeyField]
: keyValue + (keyValue ? props.separator : '') + item['srfkey'];
}); });
if (props.valueItem) { if (props.valueItem) {
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: keyValue }); emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: keyValue });
...@@ -252,9 +274,28 @@ const openView = () => { ...@@ -252,9 +274,28 @@ const openView = () => {
return; return;
} }
const params: IParam = {}; const params: IParam = {};
if (!Object.is(view.openMode,'POPOVER') && !Object.is(view.openMode,'POPOVER')) { // 选中数据
Object.assign(params,{openMode: 'POPUPMODAL'}) const selectedData: IParam = {};
// 值项
if (props.data && props.valueItem && isExistAndNotEmpty(props.data[props.valueItem])) {
Object.assign(selectedData, { srfkey: props.data[props.valueItem] });
} }
if (isExistAndNotEmpty(props.value)) {
Object.assign(selectedData, { srfmajortext: props.value });
}
// 导航参数
const tempViewParams = deepCopy(navViewParam);
Object.assign(tempViewParams, { selectedData: [selectedData] });
if (!Object.is(view.openMode, 'POPOVER') && !Object.is(view.openMode, 'POPOVER')) {
Object.assign(params, { openMode: 'POPUPMODAL' });
}
Object.assign(params, {
context: deepCopy(navContext),
viewParams: tempViewParams
});
const subject = App.getOpenViewService().openView(view, params); const subject = App.getOpenViewService().openView(view, params);
const subjectEvent = subject?.subscribe((data: any) => { const subjectEvent = subject?.subscribe((data: any) => {
if (data?.ret == 'OK' && data.resultData) { if (data?.ret == 'OK' && data.resultData) {
...@@ -267,7 +308,6 @@ const openView = () => { ...@@ -267,7 +308,6 @@ const openView = () => {
const onChange = (date: string, dateString: string) => { const onChange = (date: string, dateString: string) => {
// todo // todo
}; };
</script> </script>
<template> <template>
...@@ -277,7 +317,6 @@ const onChange = (date: string, dateString: string) => { ...@@ -277,7 +317,6 @@ const onChange = (date: string, dateString: string) => {
<template v-else-if="!isAC && !isDropdown"> <template v-else-if="!isAC && !isDropdown">
<a-auto-complete <a-auto-complete
:class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]" :class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]"
:allowClear="true"
v-model:value="value" v-model:value="value"
:placeholder="placeholder" :placeholder="placeholder"
:options="items" :options="items"
...@@ -291,6 +330,7 @@ const onChange = (date: string, dateString: string) => { ...@@ -291,6 +330,7 @@ const onChange = (date: string, dateString: string) => {
</template> </template>
<a-input :placeholder="placeholder"> <a-input :placeholder="placeholder">
<template #suffix> <template #suffix>
<CloseCircleOutlined @click="clear" />
<SearchOutlined v-if="pickUpView" class="certain-category-icon" @click="openView" /> <SearchOutlined v-if="pickUpView" class="certain-category-icon" @click="openView" />
<ExportOutlined v-if="linkView" @click="openLinkView" /> <ExportOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
...@@ -308,7 +348,6 @@ const onChange = (date: string, dateString: string) => { ...@@ -308,7 +348,6 @@ const onChange = (date: string, dateString: string) => {
<template v-else-if="isDropdown"> <template v-else-if="isDropdown">
<a-select <a-select
:class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]" :class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]"
allowClear
showSearch showSearch
v-model:value="value" v-model:value="value"
:disabled="disabled" :disabled="disabled"
...@@ -318,6 +357,7 @@ const onChange = (date: string, dateString: string) => { ...@@ -318,6 +357,7 @@ const onChange = (date: string, dateString: string) => {
:placeholder="placeholder" :placeholder="placeholder"
> >
<template #suffixIcon> <template #suffixIcon>
<CloseCircleOutlined @click="clear" />
<SearchOutlined v-if="pickUpView" @click="openPickUpView" /> <SearchOutlined v-if="pickUpView" @click="openPickUpView" />
<ExportOutlined v-if="linkView" @click="openLinkView" /> <ExportOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
...@@ -328,4 +368,18 @@ const onChange = (date: string, dateString: string) => { ...@@ -328,4 +368,18 @@ const onChange = (date: string, dateString: string) => {
</template> </template>
</template> </template>
<style scoped></style> <style scoped lang="scss">
.app-data-picker {
.anticon {
padding: 0 3px;
}
.anticon-close-circle {
display: none;
}
&:hover {
.anticon-close-circle {
display: block;
}
}
}
</style>
<template> <template>
<div class="app-stepper"> <div class="app-stepper">
<a-input :value="result" :min="min" :max="max" :step="step" :precision="precision" :disabled="disabled || readonly"> <a-input-number v-model:value="result" :min="min" :max="max" :step="step" :precision="precision" :disabled="disabled || readonly" :controls="false">
<template #addonBefore> <template #addonBefore>
<a-button type="text" :disabled="disabled || readonly || result <= min" @click="btnReduce">-</a-button> <a-button type="text" :disabled="disabled || readonly || result <= min" @click="btnReduce">-</a-button>
</template> </template>
<template #addonAfter> <template #addonAfter>
<a-button type="text" :disabled="disabled || readonly || result >= max" @click="btnIcrease">+</a-button> <a-button type="text" :disabled="disabled || readonly || result >= max" @click="btnIcrease">+</a-button>
</template> </template>
</a-input> </a-input-number>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -128,10 +128,10 @@ const btnIcrease = () => { ...@@ -128,10 +128,10 @@ const btnIcrease = () => {
background: transparent; background: transparent;
} }
} }
.ant-input-group-addon { .ant-input-number-group-addon {
padding: 0; padding: 0;
} }
.ant-input { .ant-input-number-input {
text-align: center; text-align: center;
} }
} }
......
import { PickupViewState } from '@core'; import { IParam, PickupViewState } from '@core';
/** /**
* @description 多选视图状态 * @description 多选视图状态
...@@ -7,5 +7,11 @@ import { PickupViewState } from '@core'; ...@@ -7,5 +7,11 @@ import { PickupViewState } from '@core';
* @extends {PickupViewState} * @extends {PickupViewState}
*/ */
export interface MPickupViewState extends PickupViewState { export interface MPickupViewState extends PickupViewState {
/**
* 选中数据
*
* @type {IParam[]}
* @memberof MPickupViewState
*/
selections: IParam[];
} }
import { IActionParam, IParam, PickupView } from "@core"; import { IParam, PickupView } from "@core";
import { MainView } from "../main-view";
import { MPickupViewProps } from "./mpickup-view-prop"; import { MPickupViewProps } from "./mpickup-view-prop";
import { MPickupViewState } from "./mpickup-view-state"; import { MPickupViewState } from "./mpickup-view-state";
...@@ -18,18 +17,25 @@ export class MPickupView extends PickupView { ...@@ -18,18 +17,25 @@ export class MPickupView extends PickupView {
*/ */
public declare state: MPickupViewState; public declare state: MPickupViewState;
public select: IParam = {}; /**
* @description 视图输入参数
* @type {MPickupViewProps}
* @memberof MPickupView
*/
public declare props: MPickupViewProps;
public useSelections: any[] = []; public select: IParam = {};
public onMoveRight() { public onMoveRight() {
this.useSelections.push(this.selectData); const { selections, selectedData } = toRefs(this.state);
selections.value.push(selectedData.value);
} }
public onMoveLeft() { public onMoveLeft() {
const index = this.useSelections.findIndex((selection: any) => Object.is(this.select.srfkey, selection.srfkey)); const { selections } = toRefs(this.state);
const index = selections.value.findIndex((selection: any) => Object.is(this.select.srfkey, selection.srfkey));
if (index !== -1) { if (index !== -1) {
this.useSelections.splice(index, 1); selections.value.splice(index, 1);
} }
} }
...@@ -38,7 +44,8 @@ export class MPickupView extends PickupView { ...@@ -38,7 +44,8 @@ export class MPickupView extends PickupView {
} }
public onAllMoveLeft() { public onAllMoveLeft() {
this.useSelections = []; const { selections } = toRefs(this.state);
selections.value.splice(0, selections.value.length);
} }
/** /**
...@@ -50,7 +57,6 @@ export class MPickupView extends PickupView { ...@@ -50,7 +57,6 @@ export class MPickupView extends PickupView {
const superParams = super.moduleInstall(); const superParams = super.moduleInstall();
return { return {
...superParams, ...superParams,
useSelections: this.useSelections,
onMoveRight: this.onMoveRight.bind(this), onMoveRight: this.onMoveRight.bind(this),
onMoveLeft: this.onMoveLeft.bind(this), onMoveLeft: this.onMoveLeft.bind(this),
onAllMoveRight: this.onAllMoveRight.bind(this), onAllMoveRight: this.onAllMoveRight.bind(this),
......
import { GridViewState } from '@core'; import { GridViewState, IParam } from '@core';
/** /**
* @description 选择视图状态 * @description 选择视图状态
...@@ -7,5 +7,11 @@ import { GridViewState } from '@core'; ...@@ -7,5 +7,11 @@ import { GridViewState } from '@core';
* @extends {GridViewState} * @extends {GridViewState}
*/ */
export interface PickupGridViewState extends GridViewState { export interface PickupGridViewState extends GridViewState {
/**
* 选中数据
*
* @type {IParam[]}
* @memberof PickupGridViewState
*/
selectedData: IParam[];
} }
import { ControlAction, MainViewState } from '@core'; import { MainViewState, IParam } from '@core';
/** /**
* @description 选择视图状态 * @description 选择视图状态
...@@ -7,5 +7,12 @@ import { ControlAction, MainViewState } from '@core'; ...@@ -7,5 +7,12 @@ import { ControlAction, MainViewState } from '@core';
* @extends {ViewStateBase} * @extends {ViewStateBase}
*/ */
export interface PickupViewState extends MainViewState { export interface PickupViewState extends MainViewState {
/**
* 选中数据
*
* @type {IParam[]}
* @memberof PickupViewState
*/
selectedData: IParam[];
} }
...@@ -18,19 +18,22 @@ export class PickupView extends MainView { ...@@ -18,19 +18,22 @@ export class PickupView extends MainView {
*/ */
public declare state: PickupViewState; public declare state: PickupViewState;
/**
public selectData: any[] = []; * @description 选择视图输入参数
* @type {PickupViewProps}
* @memberof PickupView
*/
public declare props: PickupViewProps;
/** /**
* @description 使用加载功能模块 * 使用视图初始化模块
* @param {PickupViewProps} props 传入的props *
* @memberof PickupView * @memberof PickupView
*/ */
public useLoad(props: PickupViewProps) { public useViewInit() {
const { viewSubject } = this.state; super.useViewInit();
onMounted(() => { const { viewParams } = this.state;
viewSubject.next({ tag: 'grid', action: "load", data: {} }) this.state.selectedData = ref(viewParams.selectedData) || ref([]);
})
} }
/** /**
...@@ -38,7 +41,7 @@ export class PickupView extends MainView { ...@@ -38,7 +41,7 @@ export class PickupView extends MainView {
* @memberof PickupView * @memberof PickupView
*/ */
public onCancel() { public onCancel() {
this.emit('close', []); this.emit('viewEvent', { tag: this.state.viewName, action: 'viewClose', data: null });
} }
/** /**
...@@ -46,24 +49,27 @@ export class PickupView extends MainView { ...@@ -46,24 +49,27 @@ export class PickupView extends MainView {
* @memberof PickupView * @memberof PickupView
*/ */
public onConfirm() { public onConfirm() {
this.emit('viewEvent', { data: this.selectData, tag: '', action: 'close' }) this.emit('viewEvent', { tag: this.state.viewName, action: 'viewDataChange', data: this.state.selectedData });
this.emit('viewEvent', { tag: this.state.viewName, action: 'viewClose', data: null });
} }
/**
* 处理部件事件
*
* @param {IActionParam} actionParam
* @memberof PickupView
*/
public onCtrlEvent(actionParam: IActionParam) { public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam; const { tag, action, data } = actionParam;
// TODO
if (action === 'selectionChange') { if (action === 'selectionChange') {
this.selectData = data; const { selectedData } = toRefs(this.state);
this.emit('viewEvent', { data: this.selectData, tag: '', action: 'viewDataChange' }) if (data && data.length > 0) {
} selectedData.value = [...data];
if (action === 'close') { }
this.emit('viewEvent', { data: this.selectData, tag: '', action: 'viewDataChange' })
} }
super.onCtrlEvent(actionParam);
} }
/** /**
* @description 安装视图所有功能模块的方法 * @description 安装视图所有功能模块的方法
* @return {*} * @return {*}
...@@ -73,7 +79,6 @@ export class PickupView extends MainView { ...@@ -73,7 +79,6 @@ export class PickupView extends MainView {
const superParams = super.moduleInstall(); const superParams = super.moduleInstall();
return { return {
...superParams, ...superParams,
selectData:this.selectData,
onCancel: this.onCancel.bind(this), onCancel: this.onCancel.bind(this),
onConfirm: this.onConfirm.bind(this) onConfirm: this.onConfirm.bind(this)
}; };
......
...@@ -93,7 +93,7 @@ export class ViewBase { ...@@ -93,7 +93,7 @@ export class ViewBase {
window.history.back(); window.history.back();
} else { } else {
// 非路由模式继续向外抛关闭视图事件 // 非路由模式继续向外抛关闭视图事件
this.emit('viewEvent', { tag: this.state.viewName, action: 'closeView', data: this.xDataControl?.getData() }); this.emit('viewEvent', { tag: this.state.viewName, action: 'viewClose', data: this.xDataControl?.getData() });
} }
} }
...@@ -228,7 +228,7 @@ export class ViewBase { ...@@ -228,7 +228,7 @@ export class ViewBase {
*/ */
public onCtrlEvent(actionParam: IActionParam) { public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam; const { tag, action, data } = actionParam;
if (Object.is(action, 'closeView')) { if (Object.is(action, 'viewClose')) {
this.closeView(); this.closeView();
} }
} }
......
...@@ -87,6 +87,14 @@ export class ControlBase { ...@@ -87,6 +87,14 @@ export class ControlBase {
}); });
} }
/**
* 使用部件初始化模块
*
* @protected
* @memberof ControlBase
*/
protected useCtrlInit(): void {};
/** /**
* 获取当前激活数据 * 获取当前激活数据
* *
...@@ -101,7 +109,7 @@ export class ControlBase { ...@@ -101,7 +109,7 @@ export class ControlBase {
* *
*/ */
public closeView() { public closeView() {
this.emit('ctrlEvent', { tag: this.props.name, action: 'closeView', data: undefined }); this.emit('ctrlEvent', { tag: this.props.name, action: 'viewClose', data: undefined });
} }
/** /**
...@@ -124,7 +132,9 @@ export class ControlBase { ...@@ -124,7 +132,9 @@ export class ControlBase {
// 处理导航参数 // 处理导航参数
this.useControlContextParams(); this.useControlContextParams();
// 使用计数器服务 // 使用计数器服务
this.useCounterService(); this.useCounterService();
// 使用部件初始化模块
this.useCtrlInit();
return { return {
state: this.state, state: this.state,
name: this.state.controlName, name: this.state.controlName,
......
import { DataTypes, dateFormat, deepCopy, GridControlState, IActionParam, IParam, isExistAndNotEmpty, MDControl, Verify } from "@core"; import { DataTypes, dateFormat, deepCopy, GridControlState, IActionParam, IParam, isExistAndNotEmpty, MDControl } from "@core";
import { createUUID } from "qx-util"; import { createUUID } from "qx-util";
import schema, { ErrorList, FieldErrorList } from 'async-validator'; import schema, { ErrorList, FieldErrorList } from 'async-validator';
import { Ref } from "vue"; import { Ref } from "vue";
...@@ -25,15 +25,6 @@ export class GridControl extends MDControl { ...@@ -25,15 +25,6 @@ export class GridControl extends MDControl {
*/ */
private formRef: any; private formRef: any;
/**
* @description
* @param {GridControlProps} props
* @memberof GridControl
*/
public setState() {
super.setState();
}
/** /**
* @description 使用自定义模块(蚂蚁金服UI自定义) * @description 使用自定义模块(蚂蚁金服UI自定义)
* @memberof GridControl * @memberof GridControl
...@@ -61,48 +52,18 @@ export class GridControl extends MDControl { ...@@ -61,48 +52,18 @@ export class GridControl extends MDControl {
return { return {
onClick: () => { onClick: () => {
// 单击激活 // 单击激活
if (this.state.rowActiveMode === 1) { if (this.state.rowActiveMode === 1 && !rowEditState) {
if (!rowEditState) { this.selectRow(record, index);
const activeIndex: number = this.state.selectedRowKeys.findIndex((key: string) => { if (!record.children) {
return record.srfkey === key; this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [record] });
});
if (activeIndex === -1) {
this.state.selectedRowKeys.push(record.srfkey);
this.state.selectedData.push(record);
} else {
this.state.selectedRowKeys = this.state.selectedRowKeys.filter((key: string) => {
return key !== record.srfkey;
})
this.state.selectedData = this.state.selectedData.filter((item: any) => {
return item.srfkey !== record.srfkey;
})
}
if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [record] });
this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [record] });
}
} }
} }
}, },
onDblclick: () => { onDblclick: () => {
// 双击激活 // 双击激活
if (this.state.rowActiveMode === 2) { if (this.state.rowActiveMode === 2 && !rowEditState) {
if (!record.children) { if (!record.children) {
const activeIndex: number = this.state.selectedRowKeys.findIndex((key: string) => { this.selectRow(record, index);
return record.srfkey === key;
});
if (activeIndex === -1) {
this.state.selectedRowKeys.push(record.srfkey);
this.state.selectedData.push(record);
} else {
this.state.selectedRowKeys = this.state.selectedRowKeys.filter((key: string) => {
return key !== record.srfkey;
})
this.state.selectedData = this.state.selectedData.filter((item: any) => {
return item.srfkey !== record.srfkey;
})
}
this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [record] }); this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [record] });
} }
} }
...@@ -116,11 +77,12 @@ export class GridControl extends MDControl { ...@@ -116,11 +77,12 @@ export class GridControl extends MDControl {
} }
// 表格选择功能配置 // 表格选择功能配置
const useRowSelectionOption = computed(() => { const useRowSelectionOption = computed(() => {
// 作为导航部件或单选时不呈现多选框
if (selectFirstDefault) { if (selectFirstDefault) {
return false; return false;
} }
return { return {
type: isSingleSelect ? 'radio' : 'checkbox', type: this.state.isMultiple ? 'checkbox' : 'radio',
columnWidth: selectColumnWidth, columnWidth: selectColumnWidth,
selectedRowKeys: this.state.selectedRowKeys, selectedRowKeys: this.state.selectedRowKeys,
checkStrictly: false, checkStrictly: false,
...@@ -143,7 +105,7 @@ export class GridControl extends MDControl { ...@@ -143,7 +105,7 @@ export class GridControl extends MDControl {
} }
}) })
// 选中赋值 // 选中赋值
this.state.selectedData = selection; this.state.selections = selection;
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: selection }) this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: selection })
}, },
}; };
...@@ -396,16 +358,22 @@ export class GridControl extends MDControl { ...@@ -396,16 +358,22 @@ export class GridControl extends MDControl {
* @memberof GridControl * @memberof GridControl
*/ */
public handleDefaultSelect() { public handleDefaultSelect() {
const { selectedData, selectFirstDefault, controlName, items } = this.state; const { selectedData, selectFirstDefault, items } = this.state;
const { selectedRowKeys } = toRefs(this.state); const { selectedRowKeys, selections } = toRefs(this.state);
if (selectedData?.length > 0) { if (selectedData?.length > 0) {
const _selectedRowKeys: string[] = []; const _selectedRowKeys: string[] = [];
const _selections: IParam[] = [];
selectedData.forEach((selected: IParam) => { selectedData.forEach((selected: IParam) => {
if (selected.srfkey) { if (selected.srfkey) {
_selectedRowKeys.push(selected.srfkey); _selectedRowKeys.push(selected.srfkey);
const item = items.find((item: IParam) => item.srfkey === selected.srfkey);
if (item) {
_selections.push(item);
}
} }
}); });
selectedRowKeys.value = _selectedRowKeys; selectedRowKeys.value = [..._selectedRowKeys];
selections.value = [..._selections];
} else if (selectFirstDefault) { } else if (selectFirstDefault) {
if (items && items.length > 0) { if (items && items.length > 0) {
this.emit("ctrlEvent", { this.emit("ctrlEvent", {
...@@ -828,6 +796,35 @@ export class GridControl extends MDControl { ...@@ -828,6 +796,35 @@ export class GridControl extends MDControl {
return validateStatus; return validateStatus;
} }
/**
* 选中行(手动单击或双击激活行触发)
*
* @private
* @param {IParam} record
* @param {number} index
* @memberof GridControl
*/
private selectRow(record: IParam, index: number) {
const { isMultiple } = this.state;
const { selections, selectedRowKeys } = toRefs(this.state);
const _index = selections.value.findIndex((selection: any) => selection.srfkey === record.srfkey);
// 存在选中则删除
if (_index !== -1) {
selections.value.splice(_index, 1);
selectedRowKeys.value.splice(_index, 1);
} else {
// 单选清空已选中
if (!isMultiple) {
selections.value.splice(_index, selections.value.length);
selectedRowKeys.value.splice(_index, selectedRowKeys.value.length);
}
selections.value.push(record);
selectedRowKeys.value.push(record.srfkey);
}
this.emit('ctrlEvent', { tag: this.props.name, action: 'selectionChange', data: selections.value });
}
/** /**
* @description 安装部件所有功能模块的方法 * @description 安装部件所有功能模块的方法
* @return {*} * @return {*}
......
...@@ -144,10 +144,10 @@ export class ListControl extends MDControl { ...@@ -144,10 +144,10 @@ export class ListControl extends MDControl {
*/ */
private handleDefaultSelect() { private handleDefaultSelect() {
const { selectFirstDefault } = this.state; const { selectFirstDefault } = this.state;
const { selectedData, items } = toRefs(this.state); const { selections, items } = toRefs(this.state);
if (selectFirstDefault) { if (selectFirstDefault) {
if (items.value && items.value.length > 0) { if (items.value && items.value.length > 0) {
selectedData.value.push(items.value[0]); selections.value.push(items.value[0]);
this.emit("ctrlEvent", { this.emit("ctrlEvent", {
tag: this.props.name, tag: this.props.name,
action: "selectionChange", action: "selectionChange",
...@@ -195,19 +195,19 @@ export class ListControl extends MDControl { ...@@ -195,19 +195,19 @@ export class ListControl extends MDControl {
*/ */
const onListItemSelected = (item: IParam, event: MouseEvent) => { const onListItemSelected = (item: IParam, event: MouseEvent) => {
const { isMultiple } = this.state; const { isMultiple } = this.state;
const { selectedData } = toRefs(this.state); const { selections } = toRefs(this.state);
const index = selectedData.value.findIndex((selection: any) => selection.srfkey === item.srfkey); const index = selections.value.findIndex((selection: any) => selection.srfkey === item.srfkey);
// 存在选中则删除 // 存在选中则删除
if (index !== -1) { if (index !== -1) {
selectedData.value.splice(index, 1); selections.value.splice(index, 1);
} else { } else {
// 单选清空已选中 // 单选清空已选中
if (!isMultiple) { if (!isMultiple) {
selectedData.value.splice(index, selectedData.value.length); selections.value.splice(index, selections.value.length);
} }
selectedData.value.push(item); selections.value.push(item);
} }
this.emit('ctrlEvent', { tag: this.props.name, action: 'selectionChange', data: selectedData.value }); this.emit('ctrlEvent', { tag: this.props.name, action: 'selectionChange', data: selections.value });
} }
/** /**
...@@ -216,8 +216,8 @@ export class ListControl extends MDControl { ...@@ -216,8 +216,8 @@ export class ListControl extends MDControl {
* @returns * @returns
*/ */
const isSelected = (item: IParam): boolean => { const isSelected = (item: IParam): boolean => {
const { selectedData } = toRefs(this.state); const { selections } = toRefs(this.state);
return selectedData.value.findIndex((selection: any) => selection.srfkey === item.srfkey) !== -1; return selections.value.findIndex((selection: any) => selection.srfkey === item.srfkey) !== -1;
} }
/** /**
......
...@@ -72,12 +72,19 @@ export interface MDControlState extends MainControlState { ...@@ -72,12 +72,19 @@ export interface MDControlState extends MainControlState {
rowActiveMode: 0 | 1 | 2; rowActiveMode: 0 | 1 | 2;
/** /**
* @description 选中数据 * @description 选中数据(选择视图传递)
* @type {IParam[]} * @type {IParam[]}
* @memberof MDControlState * @memberof MDControlState
*/ */
selectedData: IParam[]; selectedData: IParam[];
/**
* @description 选中数据
* @type {IParam[]}
* @memberof MDControlState
*/
selections: IParam[];
/** /**
* @description 选中行keys * @description 选中行keys
* @type {string[]} * @type {string[]}
......
...@@ -16,23 +16,45 @@ export class MDControl extends MainControl { ...@@ -16,23 +16,45 @@ export class MDControl extends MainControl {
public declare state: MDControlState; public declare state: MDControlState;
/** /**
* @description * @description 设置多数据部件状态
* @memberof MDControl * @memberof MDControl
*/ */
public setState() { public setState() {
super.setState(); super.setState();
// 交联输入Props // 交联输入Props
this.state.isMultiple = toRef(this.props, 'isMultiple') as any; this.state.isMultiple = toRef(this.props, 'multiple') as any;
this.state.rowEditState = toRef(this.props, 'rowEditState') as any; this.state.rowEditState = toRef(this.props, 'rowEditState') as any;
this.state.rowActiveMode = toRef(this.props, 'rowActiveMode') as any; this.state.rowActiveMode = toRef(this.props, 'rowActiveMode') as any;
if (this.props['selectedData']) { this.state.selectFirstDefault = toRef(this.props, 'selectFirstDefault') as any;
this.state.selectedData = UIBase.toOneWayRef(this.props, 'selectedData') as any; }
} else {
if (!this.state.selectedData) { protected useCtrlInit() {
this.state.selectedData = ref([]) as any; super.useCtrlInit();
this.handleSelectedData();
}
/**
* 处理选中数据
*
* @private
* @memberof MDControl
*/
protected handleSelectedData() {
const { viewParams } = this.state;
// 存在该字段则表示在选择视图中
if (viewParams && viewParams.selectedData) {
const data = viewParams.selectedData[0];
const keys = data?.srfkey?.split(',') || [];
this.state.selectedData = [];
if (keys.length) {
keys.forEach((key: string) => {
this.state.selectedData.push({ srfkey: key });
});
} else {
// 无值时给一个空对象,确保清空选中数据
this.state.selectedData.push({});
} }
} }
this.state.selectFirstDefault = toRef(this.props, 'selectFirstDefault') as any;
} }
/** /**
...@@ -626,7 +648,7 @@ export class MDControl extends MainControl { ...@@ -626,7 +648,7 @@ export class MDControl extends MainControl {
* @memberof MDControl * @memberof MDControl
*/ */
public getData(): IParam[] { public getData(): IParam[] {
return this.state.selectedData; return this.state.selections;
} }
/** /**
......
...@@ -27,5 +27,5 @@ export interface PickupViewPanelControlState extends MainControlState { ...@@ -27,5 +27,5 @@ export interface PickupViewPanelControlState extends MainControlState {
* @type {string} * @type {string}
* @memberof PickupViewPanelControlState * @memberof PickupViewPanelControlState
*/ */
selectedData: string; selectedData: IParam[];
} }
\ No newline at end of file
import { IActionParam, MainControl } from '@core'; import { IActionParam, MainControl } from '@core';
import { IParam } from '@core/interface';
import { PickupViewPanelControlProps } from './pickup-view-panel-control-prop'; import { PickupViewPanelControlProps } from './pickup-view-panel-control-prop';
import { PickupViewPanelControlState } from './pickup-view-panel-control-state'; import { PickupViewPanelControlState } from './pickup-view-panel-control-state';
...@@ -17,6 +18,16 @@ export class PickupViewPanelControl extends MainControl { ...@@ -17,6 +18,16 @@ export class PickupViewPanelControl extends MainControl {
*/ */
public declare state: PickupViewPanelControlState; public declare state: PickupViewPanelControlState;
/**
* 设置部件状态
*
* @memberof PickupViewPanelControl
*/
public setState(): void {
super.setState();
this.state.selectedData = toRef(this.props, 'selectedData') as any;
}
/** /**
* @description * @description
* @param {PickupViewPanelControlProps} props * @param {PickupViewPanelControlProps} props
...@@ -49,8 +60,32 @@ export class PickupViewPanelControl extends MainControl { ...@@ -49,8 +60,32 @@ export class PickupViewPanelControl extends MainControl {
const { tag, action, data } = actionParam; const { tag, action, data } = actionParam;
const { controlName } = this.state; const { controlName } = this.state;
if (Object.is("selectionChange", action)) { if (Object.is("selectionChange", action)) {
this.emit("onCtrlEvent", { tag: this.props.name, action: action, data: data }); this.handleSelectionChange(data);
}
}
/**
* 处理数据变化
*
* @private
* @param {IParam[]} items
* @return {*}
* @memberof PickupViewPanelControl
*/
private handleSelectionChange(items: IParam[]) {
if (items && items.length) {
const { appDeKeyFieldName, appDeMajorFieldName } = this.state;
const _items: IParam[] = [];
items.forEach((item: IParam, index: number) => {
_items.push({
srfkey: item.srfkey ? item.srfkey : item[appDeKeyFieldName.toLowerCase()],
srfmajortext: item.srfmajortext ? item.srfmajortext : item[appDeMajorFieldName.toLowerCase()]
});
});
this.emit("onCtrlEvent", { tag: this.props.name, action: 'selectionChange', data: _items });
return;
} }
this.emit("onCtrlEvent", { tag: this.props.name, action: 'selectionChange', data: [] });
} }
/** /**
......
...@@ -30,7 +30,7 @@ const emit = defineEmits<ViewEmit>(); ...@@ -30,7 +30,7 @@ const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法 // 安装功能模块,提供状态和能力方法
const mpickupView = new MPickupView(viewState, props, emit).moduleInstall(); const mpickupView = new MPickupView(viewState, props, emit).moduleInstall();
const { state, onCancel, onConfirm, onCtrlEvent, useSelections, onMoveRight, onMoveLeft, onAllMoveRight, onAllMoveLeft } = mpickupView; const { state, onCancel, onConfirm, onCtrlEvent, onMoveRight, onMoveLeft, onAllMoveRight, onAllMoveLeft } = mpickupView;
</script> </script>
<template> <template>
...@@ -62,6 +62,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, useSelections, onMoveRight, onM ...@@ -62,6 +62,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, useSelections, onMoveRight, onM
:viewParams="state.viewParams" :viewParams="state.viewParams"
:controlAction="state.{{name}}.action" :controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject" :viewSubject="state.viewSubject"
:multiple="true"
:parent="mpickupView" :parent="mpickupView"
@onCtrlEvent="onCtrlEvent" @onCtrlEvent="onCtrlEvent"
></{{codeName}}PickupViewPanel> ></{{codeName}}PickupViewPanel>
...@@ -77,7 +78,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, useSelections, onMoveRight, onM ...@@ -77,7 +78,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, useSelections, onMoveRight, onM
</a-space> </a-space>
</a-col> </a-col>
<a-col :span="5" class="split__right"> <a-col :span="5" class="split__right">
<div v-for="(item,index) in useSelections" :key="index">\{{item.srfmajortext}}</div> <div v-for="(item,index) in state.selections" :key="index">\{{item.srfmajortext}}</div>
</a-col> </a-col>
</a-row> </a-row>
<template v-slot:footer> <template v-slot:footer>
......
export const viewState = { export const viewState = {
enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}}, enableQuickSearch: {{#if page.enableQuickSearch}}{{page.enableQuickSearch}}{{else}}false{{/if}},
expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}}, expandSearchForm: {{#if page.expandSearchForm}}{{page.expandSearchForm}}{{else}}false{{/if}},
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{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
...@@ -22,11 +22,13 @@ interface Props { ...@@ -22,11 +22,13 @@ interface Props {
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
selectedData?: string; selectedData?: string;
multiple?: boolean;
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
openType:'ROUTE', openType: 'ROUTE',
multiple: false,
viewSubject: () => new Subject<IActionParam>() viewSubject: () => new Subject<IActionParam>()
}) })
...@@ -105,7 +107,7 @@ const { state, grid, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick ...@@ -105,7 +107,7 @@ const { state, grid, onCtrlEvent, onQuickGroupEvent, onQuickSearchEvent } = pick
ref="grid" ref="grid"
name="{{name}}" name="{{name}}"
:context="state.context" :context="state.context"
:multiple="false" :multiple="multiple"
:rowEditState="state.rowEditState" :rowEditState="state.rowEditState"
:rowActiveMode="state.gridRowActiveMode" :rowActiveMode="state.gridRowActiveMode"
:showBusyIndicator="true" :showBusyIndicator="true"
......
...@@ -29,7 +29,7 @@ const emit = defineEmits<ViewEmit>(); ...@@ -29,7 +29,7 @@ const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法 // 安装功能模块,提供状态和能力方法
const pickupView = new PickupView(viewState, props, emit).moduleInstall(); const pickupView = new PickupView(viewState, props, emit).moduleInstall();
const { state, onCancel, onConfirm, onCtrlEvent, selectData } = pickupView; const { state, onCancel, onConfirm, onCtrlEvent } = pickupView;
</script> </script>
<template> <template>
...@@ -57,7 +57,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, selectData } = pickupView; ...@@ -57,7 +57,7 @@ const { state, onCancel, onConfirm, onCtrlEvent, selectData } = pickupView;
:viewParams="state.viewParams" :viewParams="state.viewParams"
:controlAction="state.{{name}}.action" :controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject" :viewSubject="state.viewSubject"
:selectData="selectData" :selectedData="state.selectedData"
:parent="pickupView" :parent="pickupView"
@onCtrlEvent="onCtrlEvent" @onCtrlEvent="onCtrlEvent"
></{{codeName}}PickupViewPanel> ></{{codeName}}PickupViewPanel>
......
...@@ -81,6 +81,7 @@ export const ctrlState = { ...@@ -81,6 +81,7 @@ export const ctrlState = {
], ],
{{/if}} {{/if}}
items: [], items: [],
selections: [],
selectedRowKeys: [], selectedRowKeys: [],
// 多数据部件分组 // 多数据部件分组
mdCtrlGroup: { mdCtrlGroup: {
......
...@@ -14,7 +14,6 @@ interface Props { ...@@ -14,7 +14,6 @@ interface Props {
multiple?: boolean; multiple?: boolean;
rowEditState?: boolean; rowEditState?: boolean;
rowActiveMode?: 0 | 1 | 2; rowActiveMode?: 0 | 1 | 2;
selectedData?: IParam[];
selectFirstDefault?: boolean; selectFirstDefault?: boolean;
controlAction: ControlAction; controlAction: ControlAction;
showBusyIndicator?: boolean; showBusyIndicator?: boolean;
......
...@@ -45,6 +45,7 @@ export const ctrlState = { ...@@ -45,6 +45,7 @@ export const ctrlState = {
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}', appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}', appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlService: new ListService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ), controlService: new ListService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
selections: [],
dataItems: [ dataItems: [
{{#if ctrl.psDEListDataItems}} {{#if ctrl.psDEListDataItems}}
{{#each ctrl.psDEListDataItems as | dataItem |}} {{#each ctrl.psDEListDataItems as | dataItem |}}
......
...@@ -17,7 +17,6 @@ interface Props { ...@@ -17,7 +17,6 @@ interface Props {
context: IContext; context: IContext;
viewParams: IParam; viewParams: IParam;
multiple?: boolean; multiple?: boolean;
selectedData?: IParam[];
selectFirstDefault?: boolean; selectFirstDefault?: boolean;
controlAction: ControlAction; controlAction: ControlAction;
showBusyIndicator?: boolean; showBusyIndicator?: boolean;
......
export const ctrlState = { export const ctrlState = {
appEntityCodeName: '{{ctrl.psAppDataEntity.codeName}}',
appDeCodeName:'{{ctrl.psAppDataEntity.codeName}}',
appDeLogicName: '{{ctrl.psAppDataEntity.logicName}}',
appDeKeyFieldName: '{{#if ctrl.psAppDataEntity.keyPSAppDEField}}{{ctrl.psAppDataEntity.keyPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{#if ctrl.psAppDataEntity.majorPSAppDEField}}{{ctrl.psAppDataEntity.majorPSAppDEField.codeName}}{{/if}}',
controlCodeName: '{{ctrl.codeName}}', controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}', controlName: '{{ctrl.name}}',
selectedData: [],
data: {}, data: {},
}; };
\ No newline at end of file
...@@ -17,6 +17,7 @@ interface Props { ...@@ -17,6 +17,7 @@ interface Props {
selectedData?: string; selectedData?: string;
isShowButton?: boolean; isShowButton?: boolean;
viewSubject: Subject<IActionParam>; viewSubject: Subject<IActionParam>;
multiple?: boolean;
} }
const props = withDefaults(defineProps < Props > (), { const props = withDefaults(defineProps < Props > (), {
...@@ -25,6 +26,7 @@ const props = withDefaults(defineProps < Props > (), { ...@@ -25,6 +26,7 @@ const props = withDefaults(defineProps < Props > (), {
isSingleSelect: false, isSingleSelect: false,
isShowButton: true, isShowButton: true,
showBusyIndicator: true, showBusyIndicator: true,
multiple: false
}) })
// emit声明 // emit声明
...@@ -51,10 +53,11 @@ defineExpose({ name, state}); ...@@ -51,10 +53,11 @@ defineExpose({ name, state});
:isShowButton="state.isShowButton" :isShowButton="state.isShowButton"
:selectedData="state.selectedData" :selectedData="state.selectedData"
:viewSubject="state.viewSubject" :viewSubject="state.viewSubject"
:multiple="multiple"
@viewEvent="onViewEvent" @viewEvent="onViewEvent"
/> />
{{else}} {{else}}
<div class="app-pickup-view-panel--empty">视图不存在,请配置选择视图</div> <div class="app-pickup-view-panel--empty">视图不存在,请配置选择视图</div>
{{/if}} {{/if}}
</div> </div>
</template> </template>
\ No newline at end of file
...@@ -225,5 +225,6 @@ export const ctrlState = { ...@@ -225,5 +225,6 @@ export const ctrlState = {
echoSelectedNodes: [], echoSelectedNodes: [],
expandedKeys: [], expandedKeys: [],
selectedKeys: [], selectedKeys: [],
selectedNodes: [] selectedNodes: [],
selections: []
}; };
\ No newline at end of file
...@@ -8,7 +8,6 @@ interface Props { ...@@ -8,7 +8,6 @@ interface Props {
name:string, name:string,
parent: IParam; parent: IParam;
context: IContext; context: IContext;
selectedData?: IParam[];
selectFirstDefault?: boolean; selectFirstDefault?: boolean;
isBranchAvailable?: boolean; isBranchAvailable?: boolean;
viewParams?: IParam; viewParams?: IParam;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册