提交 a11967a6 编写于 作者: WodahsOrez's avatar WodahsOrez

update: 报错修复

上级 32d42da9
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
{{capFirst "dddd"}}
{{#if item.psEditor.isReadOnly}} {{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}" :readonly="{{item.psEditor.isReadOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.codeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
valueSeparator="{{item.psEditor.codeList.valueSeparator}}" {{~#if item.psEditor.psAppCodeList.valueSeparator}}valueSeparator="{{item.psEditor.psAppCodeList.valueSeparator}}"{{/if}}
{{/if}} {{/if}}
{{#if item.psEditor.psNavigateContexts}} {{#if item.psEditor.psNavigateContexts}}
localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}" localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}"
......
<appDropdownList <appDropdownList
name="{{item.codeName}}" name="{{item.codeName}}"
{{#if item.psEditor.codeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
valueSeparator="{{item.psEditor.codeList.valueSeparator}}" {{#if item.psEditor.psAppCodeList.valueSeparator}}valueSeparator="{{item.psEditor.psAppCodeList.valueSeparator}}"{{/if}}
{{/if}} {{/if}}
{{#if item.psEditor.placeHolder}} {{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}" placeholder="{{item.psEditor.placeHolder}}"
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
{{#if item.psEditor.isReadOnly}} {{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}" :readonly="{{item.psEditor.isReadOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.codeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
valueSeparator="{{item.psEditor.codeList.valueSeparator}}" {{#if item.psEditor.psAppCodeList.valueSeparator}}valueSeparator="{{item.psEditor.psAppCodeList.valueSeparator}}"{{/if}}
{{/if}} {{/if}}
{{#if item.psEditor.psNavigateContexts}} {{#if item.psEditor.psNavigateContexts}}
localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}" localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}"
......
<appRadioGroup <appRadioGroup
name="{{item.codeName}}" name="{{item.codeName}}"
:data="state.data" :data="state.data"
{{#if item.psEditor.codeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
valueSeparator="{{item.psEditor.codeList.valueSeparator}}" {{#if item.psEditor.psAppCodeList.valueSeparator}}valueSeparator="{{item.psEditor.psAppCodeList.valueSeparator}}"{{/if}}
{{/if}} {{/if}}
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}} {{/eq}}
{{#if item.psEditor.codeList}} {{#if item.psEditor.psAppCodeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}" codeListTag="{{item.psEditor.psAppCodeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}" codeListType="{{item.psEditor.psAppCodeList.codeListType}}"
{{/if}} {{/if}}
{{#if item.getDataType}} {{#if item.getDataType}}
dataType="{{item.getDataType}}" dataType="{{item.getDataType}}"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`); const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`);
{{else if (eq singleAppMethod.methodType "FETCH")}} {{else if (eq singleAppMethod.methodType "FETCH")}}
{{! 方法类型为FETCH }} {{! 方法类型为FETCH }}
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`); const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`,data);
{{else}} {{else}}
{{! 方法类型为DEACTION }} {{! 方法类型为DEACTION }}
this.beforeExecuteAction(context,data,'{{singleAppMethod.codeName}}'); this.beforeExecuteAction(context,data,'{{singleAppMethod.codeName}}');
......
{{#eq item.psLayoutPos 'FLEX'}} {{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};"> <div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<AppFormDruipart v-show="state.detailsModel.{{item.codeName}}.visible" {{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}} name="{{item.codeName}}" title="{{item.caption}}" v-slot="druipartParams"> <AppFormDruipart
v-show="state.detailsModel.{{item.codeName}}.visible"
{{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}}
name="{{item.codeName}}"
title="{{item.caption}}"
:context="context"
:viewParams="viewParams"
:data="state.data"
:viewSubject="state.viewSubject"
v-slot="druipartParams">
<{{item.psAppView.codeName}} <{{item.psAppView.codeName}}
:class="['app-view-layout--from-druipart']" :class="['app-view-layout--from-druipart']"
:context="druipartParams.context" :context="druipartParams.context"
...@@ -15,7 +24,16 @@ ...@@ -15,7 +24,16 @@
{{else}} {{else}}
<a-col <a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=item.psLayoutPos}} > {{> @macro/front-end/widgets/common/layout-pos.hbs item=item.psLayoutPos}} >
<AppFormDruipart v-show="state.detailsModel.{{item.codeName}}.visible" {{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}} name="{{item.codeName}}" title="{{item.caption}}" v-slot="druipartParams"> <AppFormDruipart
v-show="state.detailsModel.{{item.codeName}}.visible"
{{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}}
name="{{item.codeName}}"
title="{{item.caption}}"
:context="context"
:viewParams="viewParams"
:data="state.data"
:viewSubject="state.viewSubject"
v-slot="druipartParams">
<{{item.psAppView.codeName}} <{{item.psAppView.codeName}}
:class="['app-view-layout--from-druipart']" :class="['app-view-layout--from-druipart']"
:context="druipartParams.context" :context="druipartParams.context"
......
...@@ -10,7 +10,7 @@ interface AutoCompleteProps { ...@@ -10,7 +10,7 @@ interface AutoCompleteProps {
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: IParam; value?: IParam;
/** /**
* @description 编辑器名称 * @description 编辑器名称
...@@ -20,7 +20,7 @@ interface AutoCompleteProps { ...@@ -20,7 +20,7 @@ interface AutoCompleteProps {
/** /**
* @description 占位提示信息 * @description 占位提示信息
*/ */
placeholder: string; placeholder?: string;
/** /**
* @description 上下文 * @description 上下文
...@@ -70,22 +70,22 @@ interface AutoCompleteProps { ...@@ -70,22 +70,22 @@ interface AutoCompleteProps {
/** /**
* @description 是否默认展开 * @description 是否默认展开
*/ */
defaultOpen: boolean; defaultOpen?: boolean;
/** /**
* @description 是否显示按钮 * @description 是否显示按钮
*/ */
showButton: boolean; showButton?: boolean;
/** /**
* @description 禁用 * @description 禁用
*/ */
disabled: boolean; disabled?: boolean;
/** /**
* @description 禁用 * @description 禁用
*/ */
readonly: boolean; readonly?: boolean;
} }
interface EditorEmit { interface EditorEmit {
(name: "editorEvent", value: IActionParam): void; (name: "editorEvent", value: IActionParam): void;
...@@ -141,12 +141,12 @@ const filterOption= (inputValue: string,option: IParam) => { ...@@ -141,12 +141,12 @@ const filterOption= (inputValue: string,option: IParam) => {
const onSelect = (value: any) => { const onSelect = (value: any) => {
const selectItem = items.value.find((item: IParam) => const selectItem = items.value.find((item: IParam) =>
Object.is(item[props.deKeyField], value) Object.is(item[props.deKeyField!], value)
); );
emit("editorEvent", { emit("editorEvent", {
tag: props.name, tag: props.name,
action: "valueChange", action: "valueChange",
data: selectItem[props.deMajorField], data: selectItem[props.deMajorField!],
}); });
} }
...@@ -165,7 +165,7 @@ const onSelect = (value: any) => { ...@@ -165,7 +165,7 @@ const onSelect = (value: any) => {
:defaultOpen="true" :defaultOpen="true"
> >
<template #option="option"> <template #option="option">
<div @click="onSelect(option[deKeyField])">\{{option[deMajorField]}}</div> <div @click="onSelect(option[deKeyField!])">\{{option[deMajorField!]}}</div>
</template> </template>
<a-input :placeholder="placeholder"> <a-input :placeholder="placeholder">
<template #suffix><search-outlined v-if="showButton" class="certain-category-icon" /></template> <template #suffix><search-outlined v-if="showButton" class="certain-category-icon" /></template>
......
...@@ -32,7 +32,7 @@ interface CheckboxListProps { ...@@ -32,7 +32,7 @@ interface CheckboxListProps {
* @type {string} * @type {string}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
valueSeparator: string; valueSeparator?: string;
/** /**
* 模式(数字或者字符串) * 模式(数字或者字符串)
...@@ -40,7 +40,7 @@ interface CheckboxListProps { ...@@ -40,7 +40,7 @@ interface CheckboxListProps {
* @type {'string' | 'number'} * @type {'string' | 'number'}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
mode: 'string' | 'number'; mode?: 'string' | 'number';
/** /**
* 属性类型 * 属性类型
...@@ -48,7 +48,7 @@ interface CheckboxListProps { ...@@ -48,7 +48,7 @@ interface CheckboxListProps {
* @type {'string' | 'number'} * @type {'string' | 'number'}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
valueType: 'string' | 'number'; valueType?: 'string' | 'number';
/** /**
* 代码表标识 * 代码表标识
...@@ -88,7 +88,7 @@ interface CheckboxListProps { ...@@ -88,7 +88,7 @@ interface CheckboxListProps {
* @type {any} * @type {any}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
localContext: IParam; localContext?: IParam;
/** /**
* 局部导航参数 * 局部导航参数
...@@ -96,7 +96,7 @@ interface CheckboxListProps { ...@@ -96,7 +96,7 @@ interface CheckboxListProps {
* @type {any} * @type {any}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
localParam: IParam; localParam?: IParam;
/** /**
* 是否禁用 * 是否禁用
......
...@@ -12,7 +12,7 @@ interface CheckboxProps { ...@@ -12,7 +12,7 @@ interface CheckboxProps {
* @type {any} * @type {any}
* @memberof checkbox * @memberof checkbox
*/ */
value: number; value?: number;
/** /**
* 是否禁用 * 是否禁用
......
...@@ -24,7 +24,7 @@ interface CodeProps { ...@@ -24,7 +24,7 @@ interface CodeProps {
* @type {*} * @type {*}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
value: string; value?: string;
/** /**
* 主题 * 主题
...@@ -32,7 +32,7 @@ interface CodeProps { ...@@ -32,7 +32,7 @@ interface CodeProps {
* @type {string} * @type {string}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
theme: 'vs-light' | 'vs-dark'; theme?: 'vs-light' | 'vs-dark';
/** /**
* 语言 * 语言
...@@ -40,7 +40,7 @@ interface CodeProps { ...@@ -40,7 +40,7 @@ interface CodeProps {
* @type {string} * @type {string}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
language: 'json' | 'javascript' | 'typescript' | 'css' | 'less' | 'sass' | 'java'; language?: 'json' | 'javascript' | 'typescript' | 'css' | 'less' | 'sass' | 'java';
/** /**
* 只读模式 * 只读模式
...@@ -48,7 +48,7 @@ interface CodeProps { ...@@ -48,7 +48,7 @@ interface CodeProps {
* @type {boolean} * @type {boolean}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
readonly: boolean; readonly?: boolean;
/** /**
* 是否显示小地图 * 是否显示小地图
...@@ -56,7 +56,7 @@ interface CodeProps { ...@@ -56,7 +56,7 @@ interface CodeProps {
* @type {boolean} * @type {boolean}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
isMinimap: boolean; isMinimap?: boolean;
/** /**
* 是否能够更换语言 * 是否能够更换语言
...@@ -64,7 +64,7 @@ interface CodeProps { ...@@ -64,7 +64,7 @@ interface CodeProps {
* @type {boolean} * @type {boolean}
* @memberof AppCodeEditor * @memberof AppCodeEditor
*/ */
isChangeLanguage: boolean; isChangeLanguage?: boolean;
} }
const props = withDefaults(defineProps<CodeProps>(), { const props = withDefaults(defineProps<CodeProps>(), {
......
...@@ -88,11 +88,11 @@ interface DataPickerViewProps { ...@@ -88,11 +88,11 @@ interface DataPickerViewProps {
*/ */
pickUpData?: string; pickUpData?: string;
linkOnly: boolean; linkOnly?: boolean;
isAC: boolean; isAC?: boolean;
isDropdown: boolean; isDropdown?: boolean;
} }
interface EditorEmit { interface EditorEmit {
(name: 'editorEvent', value: IActionParam): void; (name: 'editorEvent', value: IActionParam): void;
...@@ -115,8 +115,8 @@ let items: Ref<any[]> = ref([]); ...@@ -115,8 +115,8 @@ let items: Ref<any[]> = ref([]);
const initItems = () => { const initItems = () => {
if (props.valueItem && props.data) { if (props.valueItem && props.data) {
items.value.push({ items.value.push({
[props.deMajorField]: props.value, [props.deMajorField!]: props.value,
[props.deKeyField]: props.data[props.valueItem], [props.deKeyField!]: props.data[props.valueItem],
}); });
} }
}; };
...@@ -185,16 +185,20 @@ const filterOption = (inputValue: string, option: IParam) => { ...@@ -185,16 +185,20 @@ const filterOption = (inputValue: string, option: IParam) => {
}; };
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', {
tag: props.name, tag: props.name,
action: 'valueChange', action: 'valueChange',
data: selectItem[props.deMajorField], data: selectItem[props.deMajorField!],
}); });
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField] }); emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField!] });
fillPickUpData(selectItem); fillPickUpData(selectItem);
}; };
const onChange = (date: string, dateString: string) => {
// todo
};
</script> </script>
<template> <template>
...@@ -211,7 +215,7 @@ const onSelect = (value: any) => { ...@@ -211,7 +215,7 @@ const onSelect = (value: any) => {
:placeholder="placeholder" :placeholder="placeholder"
> >
<template #suffixIcon> <template #suffixIcon>
<select-outlined v-if="linkView" @click="openLinkView" /> <SearchOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
<template #option="item"> <template #option="item">
......
...@@ -23,6 +23,11 @@ interface DataPickerProps { ...@@ -23,6 +23,11 @@ interface DataPickerProps {
*/ */
disabled?: boolean; disabled?: boolean;
/**
* @description 只读
*/
readonly?: boolean;
/** /**
* @description 占位提示信息 * @description 占位提示信息
*/ */
...@@ -93,11 +98,13 @@ interface DataPickerProps { ...@@ -93,11 +98,13 @@ interface DataPickerProps {
*/ */
pickUpData?: string; pickUpData?: string;
linkOnly: boolean; linkOnly?: boolean;
isAC?: boolean;
isAC: boolean; noAc?:boolean;
isDropdown: boolean; isDropdown?: boolean;
} }
interface EditorEmit { interface EditorEmit {
(name: 'editorEvent', value: IActionParam): void; (name: 'editorEvent', value: IActionParam): void;
...@@ -121,8 +128,8 @@ let items: Ref<any[]> = ref([]); ...@@ -121,8 +128,8 @@ let items: Ref<any[]> = ref([]);
const initItems = () => { const initItems = () => {
if (props.valueItem && props.data) { if (props.valueItem && props.data) {
items.value.push({ items.value.push({
[props.deMajorField]: props.value, [props.deMajorField!]: props.value,
[props.deKeyField]: props.data[props.valueItem], [props.deKeyField!]: props.data[props.valueItem],
}); });
} }
}; };
...@@ -191,13 +198,13 @@ const filterOption = (inputValue: string, option: IParam) => { ...@@ -191,13 +198,13 @@ const filterOption = (inputValue: string, option: IParam) => {
}; };
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', {
tag: props.name, tag: props.name,
action: 'valueChange', action: 'valueChange',
data: selectItem[props.deMajorField], data: selectItem[props.deMajorField!],
}); });
emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField] }); emit('editorEvent', { tag: props.valueItem, action: 'valueChange', data: selectItem[props.deKeyField!] });
fillPickUpData(selectItem); fillPickUpData(selectItem);
}; };
...@@ -206,7 +213,7 @@ const doEditorEmit = (data: any[]): any => { ...@@ -206,7 +213,7 @@ 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 = majorValue + (majorValue ? props.separator : '') + item[props.deMajorField]; majorValue = majorValue + (majorValue ? props.separator : '') + item[props.deMajorField!];
keyValue = keyValue + (keyValue ? props.separator : '') + item[props.deKeyField]; keyValue = keyValue + (keyValue ? props.separator : '') + item[props.deKeyField];
}); });
if (props.valueItem) { if (props.valueItem) {
...@@ -233,6 +240,11 @@ const openView = () => { ...@@ -233,6 +240,11 @@ const openView = () => {
subjectEvent?.unsubscribe(); subjectEvent?.unsubscribe();
}); });
}; };
const onChange = (date: string, dateString: string) => {
// todo
};
</script> </script>
<template> <template>
...@@ -252,12 +264,12 @@ const openView = () => { ...@@ -252,12 +264,12 @@ const openView = () => {
:defaultOpen="true" :defaultOpen="true"
> >
<template #option="option"> <template #option="option">
<div @click="onSelect(option[deKeyField])">{{ option[deMajorField] }}</div> <div @click="onSelect(option[deKeyField!])">{{ option[deMajorField!] }}</div>
</template> </template>
<a-input :placeholder="placeholder"> <a-input :placeholder="placeholder">
<template #suffix> <template #suffix>
<search-outlined v-if="pickUpView" class="certain-category-icon" @click="openView" /> <SearchOutlined v-if="pickUpView" class="certain-category-icon" @click="openView" />
<export-outlined v-if="linkView" @click="openLinkView" /> <ExportOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
</a-input> </a-input>
</a-auto-complete> </a-auto-complete>
...@@ -265,8 +277,8 @@ const openView = () => { ...@@ -265,8 +277,8 @@ const openView = () => {
<template v-else-if="noAc"> <template v-else-if="noAc">
<a-input :class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]" :placeholder="placeholder"> <a-input :class="['app-editor-container', 'app-data-picker', `app-data-picker-${name}`]" :placeholder="placeholder">
<template #suffix> <template #suffix>
<search-outlined v-if="pickUpView && showButton" class="certain-category-icon" @click="openView" /> <SearchOutlined v-if="pickUpView && showButton" class="certain-category-icon" @click="openView" />
<export-outlined v-if="linkView" @click="openLinkView" /> <ExportOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
</a-input> </a-input>
</template> </template>
...@@ -283,11 +295,11 @@ const openView = () => { ...@@ -283,11 +295,11 @@ const openView = () => {
:placeholder="placeholder" :placeholder="placeholder"
> >
<template #suffixIcon> <template #suffixIcon>
<search-outlined v-if="pickUpView" @click="openPickUpView" /> <SearchOutlined v-if="pickUpView" @click="openPickUpView" />
<select-outlined v-if="linkView" @click="openLinkView" /> <ExportOutlined v-if="linkView" @click="openLinkView" />
</template> </template>
<a-select-option v-for="(item, index) in items" :key="index" :value="item[deKeyField]"> <a-select-option v-for="(item, index) in items" :key="index" :value="item[deKeyField!]">
{{ item[deMajorField] }} {{ item[deMajorField!] }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</template> </template>
......
...@@ -10,7 +10,7 @@ interface DatePickerProps { ...@@ -10,7 +10,7 @@ interface DatePickerProps {
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
value: string; value?: string;
/** /**
* checked选中状态 * checked选中状态
...@@ -26,7 +26,7 @@ interface DatePickerProps { ...@@ -26,7 +26,7 @@ interface DatePickerProps {
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
dateFormat: string; dateFormat?: string;
/** /**
* 时间类型 * 时间类型
...@@ -34,7 +34,7 @@ interface DatePickerProps { ...@@ -34,7 +34,7 @@ interface DatePickerProps {
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
dateType: 'time' | 'date' | 'dateTime'; dateType?: 'time' | 'date' | 'dateTime';
/** /**
* 提示信息 * 提示信息
...@@ -42,7 +42,7 @@ interface DatePickerProps { ...@@ -42,7 +42,7 @@ interface DatePickerProps {
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
placeholder: string; placeholder?: string;
/** /**
* 禁用 * 禁用
...@@ -67,7 +67,6 @@ interface EditorEmit { ...@@ -67,7 +67,6 @@ interface EditorEmit {
const props = withDefaults(defineProps<DatePickerProps>(), { const props = withDefaults(defineProps<DatePickerProps>(), {
disabled: false, disabled: false,
readonly: false, readonly: false,
picker: 'date',
dateType: 'date', dateType: 'date',
dateFormat: 'yyyy-MM-dd HH:mm:ss', dateFormat: 'yyyy-MM-dd HH:mm:ss',
placeholder: '请选择日期', placeholder: '请选择日期',
......
...@@ -11,7 +11,7 @@ interface DropdownListProps { ...@@ -11,7 +11,7 @@ interface DropdownListProps {
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: string; value?: string;
/** /**
* @description 禁用 * @description 禁用
...@@ -110,7 +110,7 @@ onBeforeMount(() => { ...@@ -110,7 +110,7 @@ onBeforeMount(() => {
:class="['app-editor-container', 'app-dropdown-list', `app-dropdown-list-${name}`]" :class="['app-editor-container', 'app-dropdown-list', `app-dropdown-list-${name}`]"
v-model:value="curValue" v-model:value="curValue"
:options="items" :options="items"
:mode="multiple ? 'multiple': 'combobox'" :mode="multiple ? 'multiple': undefined"
:disabled="disabled" :disabled="disabled"
@change="onChange" @change="onChange"
:placeholder="placeholder"> :placeholder="placeholder">
......
...@@ -10,7 +10,7 @@ interface InputIpProps{ ...@@ -10,7 +10,7 @@ interface InputIpProps{
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: string; value?: string;
/** /**
* @description 禁用 * @description 禁用
...@@ -20,7 +20,7 @@ interface InputIpProps{ ...@@ -20,7 +20,7 @@ interface InputIpProps{
/** /**
* @description 只读 * @description 只读
*/ */
readonly: boolean; readonly?: boolean;
} }
interface EditorEmit{ interface EditorEmit{
...@@ -52,16 +52,16 @@ onBeforeMount(() => { ...@@ -52,16 +52,16 @@ onBeforeMount(() => {
<a-input-group size="large"> <a-input-group size="large">
<a-row :gutter="8"> <a-row :gutter="8">
<a-col :span="5"> <a-col :span="5">
<a-input @change="onChange" v-model:value="ipData[0]" /> <a-form-item-rest><a-input @change="onChange" v-model:value="ipData[0]" /></a-form-item-rest>
</a-col> </a-col>
<a-col :span="5"> <a-col :span="5">
<a-input @change="onChange" v-model:value="ipData[1]" /> <a-form-item-rest><a-input @change="onChange" v-model:value="ipData[1]" /></a-form-item-rest>
</a-col> </a-col>
<a-col :span="5"> <a-col :span="5">
<a-input @change="onChange" v-model:value="ipData[2]" /> <a-form-item-rest><a-input @change="onChange" v-model:value="ipData[2]" /></a-form-item-rest>
</a-col> </a-col>
<a-col :span="5"> <a-col :span="5">
<a-input @change="onChange" v-model:value="ipData[3]" /> <a-form-item-rest><a-input @change="onChange" v-model:value="ipData[3]" /></a-form-item-rest>
</a-col> </a-col>
</a-row> </a-row>
</a-input-group> </a-input-group>
......
...@@ -9,7 +9,7 @@ interface InputProps{ ...@@ -9,7 +9,7 @@ interface InputProps{
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: string | number; value?: string | number;
/** /**
* @description 禁用 * @description 禁用
...@@ -71,15 +71,6 @@ const onChange = ($event: any) => { ...@@ -71,15 +71,6 @@ const onChange = ($event: any) => {
<template> <template>
<div :class="['app-editor-container','app-input',`app-input-${name}`]"> <div :class="['app-editor-container','app-input',`app-input-${name}`]">
<a-input
allowClear
v-if="Object.is('text', type)"
v-model:value="value"
:disabled="disabled"
:maxlength="maxLength"
:type="type"
@blur="onChange"
:placeholder="showMaxLength ? `最大内容长度为${maxLength}` : placeholder" />
<a-input-number <a-input-number
v-if="Object.is('number', type)" v-if="Object.is('number', type)"
:value="value" :value="value"
...@@ -90,18 +81,27 @@ const onChange = ($event: any) => { ...@@ -90,18 +81,27 @@ const onChange = ($event: any) => {
@change="onChange" @change="onChange"
:placeholder="placeholder" /> :placeholder="placeholder" />
<a-input-password <a-input-password
v-if="Object.is('password', type)" v-else-if="Object.is('password', type)"
v-model:value="value" v-model:value="value"
:disabled="disabled" :disabled="disabled"
@blur="onChange" @blur="onChange"
:placeholder="placeholder"/> :placeholder="placeholder"/>
<a-textarea <a-textarea
showCount showCount
v-if="Object.is('textarea', type)" v-else-if="Object.is('textarea', type)"
v-model:value="value" v-model:value="value"
:disabled="disabled" :disabled="disabled"
:maxlength="maxLength" :maxlength="maxLength"
@blur="onChange" @blur="onChange"
:placeholder="placeholder"/> :placeholder="placeholder"/>
<a-input
allowClear
v-else="Object.is('text', type)"
v-model:value="value"
:disabled="disabled"
:maxlength="maxLength"
:type="type"
@blur="onChange"
:placeholder="showMaxLength ? `最大内容长度为${maxLength}` : placeholder" />
</div> </div>
</template> </template>
\ No newline at end of file
...@@ -32,7 +32,7 @@ interface ListBoxProps { ...@@ -32,7 +32,7 @@ interface ListBoxProps {
* @type {string} * @type {string}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
valueSeparator: string; valueSeparator?: string;
/** /**
* 模式(数字或者字符串) * 模式(数字或者字符串)
...@@ -40,7 +40,7 @@ interface ListBoxProps { ...@@ -40,7 +40,7 @@ interface ListBoxProps {
* @type {'string' | 'number'} * @type {'string' | 'number'}
* @memberof CheckboxListProps * @memberof CheckboxListProps
*/ */
mode: 'string' | 'number'; mode?: 'string' | 'number';
/** /**
* 属性类型 * 属性类型
...@@ -48,7 +48,7 @@ interface ListBoxProps { ...@@ -48,7 +48,7 @@ interface ListBoxProps {
* @type {'string' | 'number'} * @type {'string' | 'number'}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
valueType: 'string' | 'number'; valueType?: 'string' | 'number';
/** /**
* 代码表标识 * 代码表标识
...@@ -56,7 +56,7 @@ interface ListBoxProps { ...@@ -56,7 +56,7 @@ interface ListBoxProps {
* @type {string} * @type {string}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
codeListTag: string; codeListTag?: string;
/** /**
* 代码表类型 * 代码表类型
...@@ -64,15 +64,15 @@ interface ListBoxProps { ...@@ -64,15 +64,15 @@ interface ListBoxProps {
* @type {string} * @type {string}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
codeListType: string; codeListType?: string;
/** /**
* 表单服务 * 表单服务(todo 编辑器应该脱钩)
* *
* @type {*} * @type {*}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
service: any; service?: any;
/** /**
* 编辑器类型 * 编辑器类型
...@@ -80,7 +80,7 @@ interface ListBoxProps { ...@@ -80,7 +80,7 @@ interface ListBoxProps {
* @type {*} * @type {*}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
editorType: 'LISTBOX' | 'LISTBOXPICKUP'; editorType?: 'LISTBOX' | 'LISTBOXPICKUP';
/** /**
* ac参数 * ac参数
...@@ -88,7 +88,7 @@ interface ListBoxProps { ...@@ -88,7 +88,7 @@ interface ListBoxProps {
* @type {*} * @type {*}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
acParams: any; acParams?: any;
/** /**
* 视图上下文 * 视图上下文
...@@ -112,7 +112,7 @@ interface ListBoxProps { ...@@ -112,7 +112,7 @@ interface ListBoxProps {
* @type {any} * @type {any}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
localContext: IParam; localContext?: IParam;
/** /**
* 局部导航参数 * 局部导航参数
...@@ -120,7 +120,7 @@ interface ListBoxProps { ...@@ -120,7 +120,7 @@ interface ListBoxProps {
* @type {any} * @type {any}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
localParam: IParam; localParam?: IParam;
/** /**
* 是否多选 * 是否多选
...@@ -128,7 +128,7 @@ interface ListBoxProps { ...@@ -128,7 +128,7 @@ interface ListBoxProps {
* @type {any} * @type {any}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
multiple: Boolean; multiple?: Boolean;
/** /**
* 应用实体主信息属性名称 * 应用实体主信息属性名称
...@@ -136,7 +136,7 @@ interface ListBoxProps { ...@@ -136,7 +136,7 @@ interface ListBoxProps {
* @type {string} * @type {string}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
deMajorField: string; deMajorField?: string;
/** /**
* 应用实体主键属性名称 * 应用实体主键属性名称
...@@ -144,7 +144,7 @@ interface ListBoxProps { ...@@ -144,7 +144,7 @@ interface ListBoxProps {
* @type {string} * @type {string}
* @memberof ListBoxProps * @memberof ListBoxProps
*/ */
deKeyField: string; deKeyField?: string;
/** /**
* 是否禁用 * 是否禁用
...@@ -169,6 +169,7 @@ interface EditorEmit { ...@@ -169,6 +169,7 @@ interface EditorEmit {
const props = withDefaults(defineProps<ListBoxProps>(), { const props = withDefaults(defineProps<ListBoxProps>(), {
disabled: false, disabled: false,
readonly: false, readonly: false,
multiple: false,
valueType: 'string', valueType: 'string',
valueSeparator: ',', valueSeparator: ',',
mode: 'string', mode: 'string',
......
...@@ -69,7 +69,7 @@ interface RadioGroupProps { ...@@ -69,7 +69,7 @@ interface RadioGroupProps {
* @type {any} * @type {any}
* @memberof AppCheckBox * @memberof AppCheckBox
*/ */
localContext: IParam; localContext?: IParam;
/** /**
* 局部导航参数 * 局部导航参数
...@@ -77,7 +77,7 @@ interface RadioGroupProps { ...@@ -77,7 +77,7 @@ interface RadioGroupProps {
* @type {any} * @type {any}
* @memberof AppCheckBox * @memberof AppCheckBox
*/ */
localParam: IParam; localParam?: IParam;
/** /**
* 是否禁用 * 是否禁用
......
...@@ -6,7 +6,7 @@ interface RatingProps { ...@@ -6,7 +6,7 @@ interface RatingProps {
* @type {any} * @type {any}
* @memberof AppRating * @memberof AppRating
*/ */
value: number; value?: number;
/** /**
* 数据名称 * 数据名称
...@@ -41,14 +41,14 @@ interface RatingProps { ...@@ -41,14 +41,14 @@ interface RatingProps {
* @type {*} * @type {*}
* @memberof AppRating * @memberof AppRating
*/ */
max: number; max?: number;
/** /**
* 是否半星 * 是否半星
* @type {boolean} * @type {boolean}
* @memberof AppRating * @memberof AppRating
*/ */
allowHalf: boolean; allowHalf?: boolean;
} }
interface EditorEmit { interface EditorEmit {
......
...@@ -9,12 +9,12 @@ interface RawProps { ...@@ -9,12 +9,12 @@ interface RawProps {
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: string; value?: string;
/** /**
* @description 输入框类型 * @description 输入框类型
*/ */
contentType: "RAW" | "HTML" | "IMAGE" | "MARKDOWN"; contentType?: "RAW" | "HTML" | "IMAGE" | "MARKDOWN";
/** /**
* @description 输入框类型 * @description 输入框类型
......
...@@ -30,7 +30,7 @@ interface RichTextProps { ...@@ -30,7 +30,7 @@ interface RichTextProps {
/** /**
* @description 编辑器值 * @description 编辑器值
*/ */
value: string; value?: string;
/** /**
* @description 表单数据或表格行数据 * @description 表单数据或表格行数据
...@@ -50,7 +50,7 @@ interface RichTextProps { ...@@ -50,7 +50,7 @@ interface RichTextProps {
/** /**
* @description 编辑器高度 * @description 编辑器高度
*/ */
height: number; height?: number;
/** /**
* @description 上传参数 * @description 上传参数
...@@ -68,7 +68,7 @@ interface RichTextProps { ...@@ -68,7 +68,7 @@ interface RichTextProps {
* @description 是否禁用 * @description 是否禁用
* *
*/ */
disabled: boolean; disabled?: boolean;
} }
interface EditorEmit { interface EditorEmit {
......
...@@ -6,7 +6,7 @@ interface sliderProps { ...@@ -6,7 +6,7 @@ interface sliderProps {
* @type {any} * @type {any}
* @memberof AppSlider * @memberof AppSlider
*/ */
value: number; value?: number;
/** /**
* 属性项名称 * 属性项名称
......
...@@ -8,7 +8,7 @@ interface SpanProps { ...@@ -8,7 +8,7 @@ interface SpanProps {
* @type {*} * @type {*}
* @memberof AppSpan * @memberof AppSpan
*/ */
value: string; value?: string;
/** /**
* 传入表单数据 * 传入表单数据
......
...@@ -6,7 +6,7 @@ interface StepperProps { ...@@ -6,7 +6,7 @@ interface StepperProps {
* @type {any} * @type {any}
* @memberof AppSlider * @memberof AppSlider
*/ */
value: number; value?: number;
/** /**
* 属性项名称 * 属性项名称
...@@ -21,14 +21,14 @@ interface StepperProps { ...@@ -21,14 +21,14 @@ interface StepperProps {
* @type {number} * @type {number}
* @memberof AppSlider * @memberof AppSlider
*/ */
precision: number; precision?: number;
/** /**
* 步长 * 步长
* @type {number} * @type {number}
* @memberof AppSlider * @memberof AppSlider
*/ */
step: number; step?: number;
/** /**
* 最小值 * 最小值
......
...@@ -8,7 +8,7 @@ interface SwitchProps { ...@@ -8,7 +8,7 @@ interface SwitchProps {
* @type {number} * @type {number}
* @memberof Appswitch * @memberof Appswitch
*/ */
value: number; value?: number;
/** /**
* checked选中状态 * checked选中状态
...@@ -38,7 +38,7 @@ interface SwitchProps { ...@@ -38,7 +38,7 @@ interface SwitchProps {
* *
* @type {boolean} * @type {boolean}
*/ */
size: string; size?: string;
} }
interface EditorEmit { interface EditorEmit {
......
...@@ -8,7 +8,7 @@ interface UploadProps { ...@@ -8,7 +8,7 @@ interface UploadProps {
* @type {any} * @type {any}
* @memberof UploadProps * @memberof UploadProps
*/ */
value: number; value?: number;
/** /**
* 属性项名称 * 属性项名称
...@@ -23,49 +23,49 @@ interface UploadProps { ...@@ -23,49 +23,49 @@ interface UploadProps {
* *
* @type {boolean} * @type {boolean}
*/ */
accept: string; accept?: string;
/** /**
* 上传请求的 http 方法 * 上传请求的 http 方法
* *
* @type {boolean} * @type {boolean}
*/ */
method: string; method?: string;
/** /**
* 文件是否多选 * 文件是否多选
* *
* @type {boolean} * @type {boolean}
*/ */
multiple: boolean; multiple?: boolean;
/** /**
* 是否展示文件列表 * 是否展示文件列表
* *
* @type {boolean} * @type {boolean}
*/ */
showUploadList: boolean; showUploadList?: boolean;
/** /**
* 最大文件数 * 最大文件数
* *
* @type {boolean} * @type {boolean}
*/ */
limit: number; limit?: number;
/** /**
* 文件列表样式 * 文件列表样式
* *
* @type {boolean} * @type {boolean}
*/ */
listType: string; listType?: string;
/** /**
* 按钮提示信息 * 按钮提示信息
* *
* @type {boolean} * @type {boolean}
*/ */
tooltip: string; tooltip?: string;
/** /**
* 只读模式 * 只读模式
......
...@@ -3,17 +3,17 @@ interface LayoutProps { ...@@ -3,17 +3,17 @@ interface LayoutProps {
/** /**
* @description 菜单方向 * @description 菜单方向
*/ */
menuAlign: 'LEFT' | 'TOP' | 'CENTER' | 'TABEXP_LEFT' | 'TABEXP_TOP' | 'TABEXP_RIGHT' | 'TABEXP_BOTTOM' | 'NONE'; menuAlign?: 'LEFT' | 'TOP' | 'CENTER' | 'TABEXP_LEFT' | 'TABEXP_TOP' | 'TABEXP_RIGHT' | 'TABEXP_BOTTOM' | 'NONE';
/** /**
* @description 收缩 * @description 收缩
*/ */
collapsed: boolean; collapsed?: boolean;
/** /**
* @description 显示标题栏 * @description 显示标题栏
*/ */
showCaptionBar: boolean; showCaptionBar?: boolean;
} }
const props = withDefaults(defineProps<LayoutProps>(), { const props = withDefaults(defineProps<LayoutProps>(), {
menuAlign: 'LEFT', menuAlign: 'LEFT',
......
...@@ -2,36 +2,34 @@ ...@@ -2,36 +2,34 @@
import { IActionParam, IParam, RouteUtil } from '@core'; import { IActionParam, IParam, RouteUtil } from '@core';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
interface FormDruipartProps { interface FormDruipartProps {
// 关联视图
viewName: string;
// 刷新关系项 // 刷新关系项
tempMode: string; tempMode?: string;
// 禁止加载 // 禁止加载
isForbidLoad: string; isForbidLoad?: boolean;
// 传入参数项名称 // 传入参数项名称
paramItem: string; paramItem?: string;
// 视图上下文 // 视图上下文
context: string; context: any;
// 视图参数 // 视图参数
viewParams: boolean; viewParams: any;
// 应用实体参数名称 // 应用实体参数名称
parentName: number; parentName?: string;
// 应用实体映射实体名称 // 应用实体映射实体名称
parentDeName: boolean; parentDeName?: string;
// 标题 // 标题
title: string; title?: string;
// 刷新关系项 // 刷新关系项
refreshItems: string; refreshItems?: string;
// 表单数据 // 表单数据
data: string; data: any;
// 表单订阅对象 // 视图订阅对象
formState: Subject<any>; viewSubject: Subject<any>;
// 视图路由参数 // 视图路由参数
parameters: any[]; parameters?: any[];
// 名称 // 名称
name: string; name: string;
// 是否忽略表单项值变化 // 是否忽略表单项值变化
ignoreFieldValueChange: boolean; ignoreFieldValueChange?: boolean;
} }
interface FormDruipartEmit { interface FormDruipartEmit {
(name: 'componentEvent', value: IActionParam): void; (name: 'componentEvent', value: IActionParam): void;
...@@ -40,7 +38,7 @@ const props = withDefaults(defineProps<FormDruipartProps>(), {}); ...@@ -40,7 +38,7 @@ const props = withDefaults(defineProps<FormDruipartProps>(), {});
const emit = defineEmits<FormDruipartEmit>(); const emit = defineEmits<FormDruipartEmit>();
let formStateEvent: undefined | Subscription = undefined; let viewSubjectEvent: undefined | Subscription = undefined;
const formDruipart: Subject<any> = new Subject<any>(); const formDruipart: Subject<any> = new Subject<any>();
...@@ -67,10 +65,10 @@ onBeforeMount(() => { ...@@ -67,10 +65,10 @@ onBeforeMount(() => {
}); });
// 关系界面初始化 // 关系界面初始化
const druipartInit = () => { const druipartInit = () => {
if (!props.formState) { if (!props.viewSubject) {
return; return;
} }
formStateEvent = props.formState.subscribe(($event: any) => { viewSubjectEvent = props.viewSubject.subscribe(($event: any) => {
// 表单加载完成 // 表单加载完成
if (Object.is($event.type, 'load')) { if (Object.is($event.type, 'load')) {
refreshDRUIPart($event.data); refreshDRUIPart($event.data);
......
...@@ -3,14 +3,14 @@ import { IActionParam, IParam } from "@core"; ...@@ -3,14 +3,14 @@ import { IActionParam, IParam } from "@core";
interface FormGroupProps{ interface FormGroupProps{
name: string; name: string;
title: string; title?: string;
imgPath: string; imgPath?: string;
iconClass: string; iconClass?: string;
titleStyle: string; titleStyle?: string;
infoGroupMode: boolean; infoGroupMode?: boolean;
titleBarCloseMode: number; titleBarCloseMode?: number;
showCaption: boolean; showCaption?: boolean;
uIActionGroup: IParam; uIActionGroup?: IParam;
} }
interface FormGroupEmit{ interface FormGroupEmit{
(name: 'componentEvent', value: IActionParam): void (name: 'componentEvent', value: IActionParam): void
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { IParam } from "@core"; import { IParam } from "@core";
interface Props{ interface Props{
items: IParam[], items: IParam[],
collapsed: boolean, collapsed?: boolean,
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
collapsed: false, collapsed: false,
...@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<Props>(), { ...@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<Props>(), {
<template v-if="!item.items"> <template v-if="!item.items">
<a-menu-item v-if="!item.hidden" :key="item.name" :class="['app-menu-item',item.itemSysCss]"> <a-menu-item v-if="!item.hidden" :key="item.name" :class="['app-menu-item',item.itemSysCss]">
<template #icon> <template #icon>
<AppIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed && item.caption[0]"/> <AppIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed ? item.caption[0] : undefined"/>
</template> </template>
<a-tooltip :title="item.tooltip">\{{item.caption}}</a-tooltip> <a-tooltip :title="item.tooltip">\{{item.caption}}</a-tooltip>
</a-menu-item> </a-menu-item>
...@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<Props>(), { ...@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<Props>(), {
<template v-else> <template v-else>
<a-sub-menu v-if="!item.hidden" :key="item.name" :class="['app-menu-item',item.itemSysCss]"> <a-sub-menu v-if="!item.hidden" :key="item.name" :class="['app-menu-item',item.itemSysCss]">
<template #icon> <template #icon>
<AppIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed && item.caption[0]"/> <AppIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed ? item.caption[0] : undefined"/>
</template> </template>
<template #title><a-tooltip :title="item.tooltip">\{{item.caption}}</a-tooltip></template> <template #title><a-tooltip :title="item.tooltip">\{{item.caption}}</a-tooltip></template>
<AppMenuItem :items="item.items" /> <AppMenuItem :items="item.items" />
......
...@@ -11,7 +11,7 @@ interface ToolbarProps { ...@@ -11,7 +11,7 @@ interface ToolbarProps {
/** /**
* @description 模式 * @description 模式
*/ */
mode: 'button' | 'link'; mode?: 'button' | 'link';
/** /**
* @description 行为模型 * @description 行为模型
*/ */
...@@ -49,14 +49,14 @@ const itemClick = (item: IParam) => { ...@@ -49,14 +49,14 @@ const itemClick = (item: IParam) => {
@click="itemClick(item)" @click="itemClick(item)"
> >
<AppIconText <AppIconText
:text="item.showCaption && item.caption" :text="item.showCaption ? item.caption : undefined"
:iconClass="item.showIcon && item.iconClass" :iconClass="item.showIcon ? item.iconClass : undefined"
:imgPath="item.showIcon && item.imgPath"/> :imgPath="item.showIcon ? item.imgPath : undefined"/>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-dropdown v-else-if="Object.is(item.itemType, 'ITEMS')" v-show="item.visible"> <!-- todo 模型缺失 -->
<!-- todo 模型缺失 --> <!-- <a-dropdown v-else-if="Object.is(item.itemType, 'ITEMS')" v-show="item.visible">
<!-- <a-menu slot="overlay" @click="itemClick"> <a-menu slot="overlay" @click="itemClick" v-show="item.visible">
<a-tooltip <a-tooltip
v-for="(childItem, index) in item" v-for="(childItem, index) in item"
v-if="Object.is(item.itemType, 'DEUIACTION')" v-if="Object.is(item.itemType, 'DEUIACTION')"
...@@ -74,8 +74,8 @@ const itemClick = (item: IParam) => { ...@@ -74,8 +74,8 @@ const itemClick = (item: IParam) => {
:imgPath="item.showIcon && item.imgPath"/> :imgPath="item.showIcon && item.imgPath"/>
</a-menu-item> </a-menu-item>
</a-tooltip> </a-tooltip>
</a-menu> --> </a-menu>
</a-dropdown> </a-dropdown> -->
<template v-else-if="Object.is(item.itemType, 'SEPERATOR')"> <template v-else-if="Object.is(item.itemType, 'SEPERATOR')">
<span class='separator'>|</span> <span class='separator'>|</span>
</template> </template>
...@@ -92,9 +92,9 @@ const itemClick = (item: IParam) => { ...@@ -92,9 +92,9 @@ const itemClick = (item: IParam) => {
@click="itemClick(item)" @click="itemClick(item)"
> >
<AppIconText <AppIconText
:text="item.showCaption && item.caption" :text="item.showCaption ? item.caption : undefined"
:iconClass="item.showIcon && item.iconClass" :iconClass="item.showIcon ? item.iconClass : undefined"
:imgPath="item.showIcon && item.imgPath"/> :imgPath="item.showIcon ? item.imgPath : undefined"/>
</a-button> </a-button>
</template> </template>
</a-space> </a-space>
......
...@@ -78,7 +78,6 @@ const dropdownList = [ ...@@ -78,7 +78,6 @@ const dropdownList = [
<a-dropdown> <a-dropdown>
<a-avatar size="large" :src="user.avatar" @click.prevent> <a-avatar size="large" :src="user.avatar" @click.prevent>
<template #icon><AppIconText iconClass="fa fa-user-o"></AppIconText></template> <template #icon><AppIconText iconClass="fa fa-user-o"></AppIconText></template>
<DownOutlined />
</a-avatar> </a-avatar>
<template #overlay> <template #overlay>
<a-menu @click="dropdownClick"> <a-menu @click="dropdownClick">
......
...@@ -63,14 +63,14 @@ export class UIBase { ...@@ -63,14 +63,14 @@ export class UIBase {
* @param {Record<any, any>} props * @param {Record<any, any>} props
*/ */
public static useContextParams(props: Record<any, any>) { public static useContextParams(props: Record<any, any>) {
const { contextProp, viewParamsProp } = toRefs(props); const { context, viewParams } = toRefs(props);
// 维护上下文并监控其变化 // 维护上下文并监控其变化
const context: Ref<IContext> = ref({}); const _context: Ref<IContext> = ref({});
watch( watch(
contextProp, context,
(newVal: any, oldVal: any) => { (newVal: any, oldVal: any) => {
context.value = deepCopy(newVal || {}); _context.value = deepCopy(newVal || {});
}, },
{ {
immediate: true, immediate: true,
...@@ -79,17 +79,17 @@ export class UIBase { ...@@ -79,17 +79,17 @@ export class UIBase {
); );
// 维护视图参数并监控其变化 // 维护视图参数并监控其变化
const viewParams: Ref<IParam> = ref({}); const _viewParams: Ref<IParam> = ref({});
watch( watch(
viewParamsProp, viewParams,
(newVal: any, oldVal: any) => { (newVal: any, oldVal: any) => {
viewParams.value = deepCopy(newVal || {}); _viewParams.value = deepCopy(newVal || {});
}, },
{ {
immediate: true, immediate: true,
deep: true, deep: true,
} }
); );
return { context, viewParams }; return { context: _context, viewParams: _viewParams };
} }
} }
\ No newline at end of file
...@@ -178,7 +178,7 @@ export class GridControl extends MDControl { ...@@ -178,7 +178,7 @@ export class GridControl extends MDControl {
* @memberof GridControl * @memberof GridControl
*/ */
public handleDefaultSelect() { public handleDefaultSelect() {
const { selectedData, isSelectDefault, controlName, items } = this.state; const { selectedData, selectFirstDefault, controlName, items } = this.state;
const { selectedRowKeys } = toRefs(this.state); const { selectedRowKeys } = toRefs(this.state);
if (selectedData?.length > 0) { if (selectedData?.length > 0) {
const _selectedRowKeys: string[] = []; const _selectedRowKeys: string[] = [];
...@@ -188,7 +188,7 @@ export class GridControl extends MDControl { ...@@ -188,7 +188,7 @@ export class GridControl extends MDControl {
} }
}); });
selectedRowKeys.value = _selectedRowKeys; selectedRowKeys.value = _selectedRowKeys;
} else if (isSelectDefault) { } else if (selectFirstDefault) {
if (items && items.length > 0) { if (items && items.length > 0) {
this.emit("ctrlEvent", { this.emit("ctrlEvent", {
tag: this.props.name, tag: this.props.name,
......
...@@ -41,5 +41,5 @@ export interface MDControlProps extends MainControlProps { ...@@ -41,5 +41,5 @@ export interface MDControlProps extends MainControlProps {
* @type {boolean} * @type {boolean}
* @memberof MDControlProps * @memberof MDControlProps
*/ */
isSelectDefault: boolean; selectFirstDefault: boolean;
} }
\ No newline at end of file
...@@ -55,7 +55,7 @@ export interface MDControlState extends MainControlState { ...@@ -55,7 +55,7 @@ export interface MDControlState extends MainControlState {
* @type {boolean} * @type {boolean}
* @memberof MDControlState * @memberof MDControlState
*/ */
isSelectDefault: boolean; selectFirstDefault: boolean;
/** /**
* @description 是否单选 * @description 是否单选
......
...@@ -25,7 +25,7 @@ export class MDControl extends MainControl { ...@@ -25,7 +25,7 @@ export class MDControl extends MainControl {
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;
this.state.selectedData = toRef(this.props, 'selectedData') as any; this.state.selectedData = toRef(this.props, 'selectedData') as any;
this.state.isSelectDefault = toRef(this.props, 'isSelectDefault') as any; this.state.selectFirstDefault = toRef(this.props, 'selectFirstDefault') as any;
} }
/** /**
......
...@@ -20,7 +20,7 @@ export interface MenuControlProps extends ControlPropsBase { ...@@ -20,7 +20,7 @@ export interface MenuControlProps extends ControlPropsBase {
* @type {string} * @type {string}
* @memberof MenuControlProps * @memberof MenuControlProps
*/ */
defaultView: string; defaultView?: string;
/** /**
* @description 菜单收缩状态 * @description 菜单收缩状态
......
...@@ -48,7 +48,7 @@ export interface MenuControlState extends ControlStateBase { ...@@ -48,7 +48,7 @@ export interface MenuControlState extends ControlStateBase {
* @type {string} * @type {string}
* @memberof MenuControlState * @memberof MenuControlState
*/ */
defaultView: string; defaultView?: string;
/** /**
* @description 菜单方向 * @description 菜单方向
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
MenuFoldOutlined MenuFoldOutlined
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -10,7 +10,7 @@ import { {{codeName}}Form } from '@widgets/{{spinalCase appEntity.codeName}}/{{s ...@@ -10,7 +10,7 @@ import { {{codeName}}Form } from '@widgets/{{spinalCase appEntity.codeName}}/{{s
// props声明和默认值处理 // props声明和默认值处理
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -20,7 +20,7 @@ import { {{codeName}}SearchBar } from '@widgets/{{spinalCase appEntity.codeName} ...@@ -20,7 +20,7 @@ import { {{codeName}}SearchBar } from '@widgets/{{spinalCase appEntity.codeName}
// props声明和默认值处理 // props声明和默认值处理
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -13,7 +13,7 @@ import { {{control.codeName}}Grid } from '@widgets/{{spinalCase appEntity.codeNa ...@@ -13,7 +13,7 @@ import { {{control.codeName}}Grid } from '@widgets/{{spinalCase appEntity.codeNa
// props声明和默认值处理 // props声明和默认值处理
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -9,7 +9,7 @@ import { {{codeName}}PickUpViewPanel } from '@widgets/{{spinalCase appEntity.cod ...@@ -9,7 +9,7 @@ import { {{codeName}}PickUpViewPanel } from '@widgets/{{spinalCase appEntity.cod
{{/page.ctrls}} {{/page.ctrls}}
// props声明和默认值处理 // props声明和默认值处理
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -8,7 +8,7 @@ import { {{codeName}}TreeExpBar } from '@widgets/{{spinalCase appEntity.codeName ...@@ -8,7 +8,7 @@ import { {{codeName}}TreeExpBar } from '@widgets/{{spinalCase appEntity.codeName
{{/eq}} {{/eq}}
{{/page.ctrls}} {{/page.ctrls}}
interface Props { interface Props {
context: IContext; context?: IContext;
viewParams?: IParam; viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED"; openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>; viewSubject?: Subject<IActionParam>;
......
...@@ -4,7 +4,7 @@ import { ctrlState } from "./{{spinalCase ctrl.codeName}}-menu-state"; ...@@ -4,7 +4,7 @@ import { ctrlState } from "./{{spinalCase ctrl.codeName}}-menu-state";
import { IParam, IActionParam, MenuControl, IContext } from "@core"; import { IParam, IActionParam, MenuControl, IContext } from "@core";
interface Props { interface Props {
context: IContext; context: IContext;
defaultView: string; defaultView?: string;
collapsed: boolean; collapsed: boolean;
menuAlign: "LEFT" | "TOP" | "CENTER" | "TABEXP_LEFT" | "TABEXP_TOP" | "TABEXP_RIGHT" | "TABEXP_BOTTOM" | "NONE"; menuAlign: "LEFT" | "TOP" | "CENTER" | "TABEXP_LEFT" | "TABEXP_TOP" | "TABEXP_RIGHT" | "TABEXP_BOTTOM" | "NONE";
viewParams?: IParam; viewParams?: IParam;
......
...@@ -7,13 +7,13 @@ import { GridControl, IActionParam, IParam, IContext, ControlAction, deepCopy } ...@@ -7,13 +7,13 @@ import { GridControl, IActionParam, IParam, IContext, ControlAction, deepCopy }
interface Props { interface Props {
context: IContext; context: IContext;
viewParams: IParam; viewParams: IParam;
multiple: boolean; multiple?: boolean;
rowEditState: boolean; rowEditState?: boolean;
rowActiveMode: 0 | 1 | 2; rowActiveMode?: 0 | 1 | 2;
selectedData?: IParam[]; selectedData?: IParam[];
isSelectDefault?: boolean; selectFirstDefault?: boolean;
controlAction: ControlAction; controlAction: ControlAction;
showBusyIndicator: boolean; showBusyIndicator?: boolean;
viewSubject: Subject<IActionParam>; viewSubject: Subject<IActionParam>;
} }
...@@ -48,7 +48,7 @@ defineExpose({ state, name: '{{ctrl.name}}' }); ...@@ -48,7 +48,7 @@ defineExpose({ state, name: '{{ctrl.name}}' });
class="app-grid{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}" class="app-grid{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
:rowKey="useRowKey" :rowKey="useRowKey"
:showHeader="true" :showHeader="true"
:scroll="scrollOption" :scroll="useScrollOption"
:sortDirections="['ascend', 'descend']" :sortDirections="['ascend', 'descend']"
:data-source="state.items" :data-source="state.items"
:row-selection="useRowSelectionOption" :row-selection="useRowSelectionOption"
......
...@@ -32,10 +32,10 @@ export class ControlVO extends ControlVOBase implements TreeControlVO { ...@@ -32,10 +32,10 @@ export class ControlVO extends ControlVOBase implements TreeControlVO {
appDeDataSet: { codeName: '{{treeNode.psAppDEDataSet.codeName}}' }, appDeDataSet: { codeName: '{{treeNode.psAppDEDataSet.codeName}}' },
{{/if}} {{/if}}
appendPNodeId: {{treeNode.appendPNodeId}}, appendPNodeId: {{treeNode.appendPNodeId}},
{{#if treeNode.psCodeList}} {{#if treeNode.psAppCodeList}}
codeList: { codeList: {
codeName: '{{treeNode.psCodeList.codeName}}', codeName: '{{treeNode.psAppCodeList.codeName}}',
type: '{{treeNode.psCodeList.codeListType}}' type: '{{treeNode.psAppCodeList.codeListType}}'
}, },
{{/if}} {{/if}}
counterId: '{{treeNode.counterId}}', counterId: '{{treeNode.counterId}}',
......
...@@ -7,8 +7,8 @@ interface Props { ...@@ -7,8 +7,8 @@ interface Props {
context: IContext; context: IContext;
multiple: boolean; multiple: boolean;
selectedData: IParam[]; selectedData: IParam[];
selectFirstDefault: boolean; selectFirstDefault?: boolean;
isBranchAvailable: boolean; isBranchAvailable?: boolean;
viewParams?: IParam; viewParams?: IParam;
controlAction: ControlAction; controlAction: ControlAction;
showBusyIndicator?: boolean; showBusyIndicator?: boolean;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册