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

update: 报错修复

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