提交 85348837 编写于 作者: 邱定凯's avatar 邱定凯

update:更新编辑器发布逻辑

上级 366b75a1
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
:disabled="state.detailsModel.{{item.name}}.disabled" :disabled="state.detailsModel.{{item.name}}.disabled"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readOnly="{{item.psEditor.readOnly}}"
{{/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}}"
......
...@@ -25,16 +25,20 @@ ...@@ -25,16 +25,20 @@
placeholder="{{item.psEditor.placeHolder}}" placeholder="{{item.psEditor.placeHolder}}"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readOnly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.maxValue}} {{#if item.psEditor.editorParams}}
:max="{{item.psEditor.maxValue}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if max}}
{{#if item.psEditor.minValue}} :max="{{max}}"
:min="{{item.psEditor.minValue}}" {{/if}}
{{/if}} {{#if min}}
{{#if item.psEditor.precision}} :min="{{min}}"
:precision="{{item.psEditor.precision}}" {{/if}}
{{#if precision}}
:precision="{{precision}}"
{{/if}}
{{/jsonParse}}
{{/if}} {{/if}}
{{#if item.psEditor.maxLength}} {{#if item.psEditor.maxLength}}
:maxLength="{{item.psEditor.maxLength}}" :maxLength="{{item.psEditor.maxLength}}"
......
...@@ -22,13 +22,17 @@ ...@@ -22,13 +22,17 @@
:disabled="state.detailsModel.{{item.name}}.disabled" :disabled="state.detailsModel.{{item.name}}.disabled"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readOnly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.maxValue}} {{#if item.psEditor.editorParams}}
:max="{{item.psEditor.editorParams.maxValue}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if max}}
{{#if item.psEditor.editorParams.allowHalf}} :max="{{max}}"
:allowHalf="{{item.psEditor.editorParams.allowHalf}}" {{/if}}
{{#if allowHalf}}
:allowHalf="{{allowHalf}}"
{{/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}}"
......
...@@ -23,16 +23,20 @@ ...@@ -23,16 +23,20 @@
:disabled="state.detailsModel.{{item.name}}.disabled" :disabled="state.detailsModel.{{item.name}}.disabled"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readOnly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.stepValue}} {{#if item.psEditor.editorParams}}
:step="{{item.psEditor.editorParams.stepValue}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if step}}
{{#if item.psEditor.editorParams.minValue}} :step="{{step}}"
:min="{{item.psEditor.editorParams.minValue}}" {{/if}}
{{/if}} {{#if min}}
{{#if item.psEditor.editorParams.maxValue}} :min="{{min}}"
:max="{{item.psEditor.editorParams.maxValue}}" {{/if}}
{{#if max}}
:max="{{max}}"
{{/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}}"
......
...@@ -28,19 +28,21 @@ ...@@ -28,19 +28,21 @@
{{#if item.dataType}} {{#if item.dataType}}
:dataType="{{item.dataType}}" :dataType="{{item.dataType}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.unitName}} {{#if item.psEditor.editorParams}}
unitName="{{item.psEditor.editorParams.unitName}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if unitName}}
{{#if item.psEditor.editorParams.valueFormat}} unitName="{{unitName}}"
valueFormat="{{item.psEditor.editorParams.valueFormat}}" {{/if}}
{{else if item.valueFormat}} {{#if precision}}
:precision="{{precision}}"
{{/if}}
{{/jsonParse}}
{{/if}}
{{#if item.valueFormat}}
valueFormat="{{item.valueFormat}}" valueFormat="{{item.valueFormat}}"
{{else if item.psAppDEField.valueFormat}} {{else if item.psAppDEField.valueFormat}}
valueFormat="{{item.psAppDEField.valueFormat}}" valueFormat="{{item.psAppDEField.valueFormat}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams.precision}}
:precision="{{item.psEditor.editorParams.precision}}"
{{/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}}"
{{/if}} {{/if}}
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
:disabled="state.detailsModel.{{item.name}}.disabled" :disabled="state.detailsModel.{{item.name}}.disabled"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readOnly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.editorParams}} {{#if item.psEditor.editorParams}}
{{#jsonParse item.psEditor.editorParams}} {{#jsonParse item.psEditor.editorParams}}
......
...@@ -21,11 +21,15 @@ ...@@ -21,11 +21,15 @@
{{else if (eq ctrlType 'panel')}} {{else if (eq ctrlType 'panel')}}
:disabled="state.detailsModel.{{item.name}}.disabled" :disabled="state.detailsModel.{{item.name}}.disabled"
{{/if}} {{/if}}
{{#if item.psEditor.readOnly}} {{#if}}
:readonly="{{item.psEditor.readOnly}}" {{#jsonParse item.psEditor.editorParams}}
{{#if size}}
:size="{{size}}"
{{/if}}
{{/jsonParse}}
{{/if}} {{/if}}
{{#if (and item.psEditor.editorParams item.psEditor.editorParams.size)}} {{#if item.psEditor.readOnly}}
size="{{item.psEditor.editorParams.size}}" :readOnly="{{item.psEditor.readOnly}}"
{{/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}}"
......
...@@ -8,17 +8,18 @@ ...@@ -8,17 +8,18 @@
{{#eq ctrlType 'form'}} {{#eq ctrlType 'form'}}
name="{{item.codeName}}" name="{{item.codeName}}"
{{/eq}} {{/eq}}
{{#if item.psEditor.editorParams.method}} {{#if item.psEditor.editorParams}}
method="{{item.psEditor.editorParams.method}}" {{#jsonParse item.psEditor.editorParams}}
{{/if}} {{#if method}}
{{#if item.psEditor.editorParams.multiple}} method="{{method}}"
multiple="{{item.psEditor.editorParams.multiple}}" {{/if}}
{{/if}} {{#if multiple}}
{{#if item.psEditor.editorParams.showUploadList}} multiple="{{multiple}}"
:showUploadList="{{item.psEditor.editorParams.showUploadList}}" {{/if}}
{{/if}} {{#if showUploadList}}
{{#if item.psEditor.editorParams.tooltip}} :showUploadList="{{showUploadList}}"
tooltip="{{item.psEditor.editorParams.tooltip}}" {{/if}}
{{/jsonParse}}
{{/if}} {{/if}}
{{#if (eq ctrlType 'form')}} {{#if (eq ctrlType 'form')}}
:disabled="state.detailsModel.{{item.codeName}}.disabled" :disabled="state.detailsModel.{{item.codeName}}.disabled"
...@@ -36,8 +37,13 @@ ...@@ -36,8 +37,13 @@
{{#if item.psEditor.readOnly}} {{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}" :readonly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#if item.psEditor.maxFileCount}} {{!-- TODO maxFileContent识别 --}}
:limit="{{item.psEditor.maxFileCount}}" {{#if item.psEditor.editorParams}}
{{#jsonParse item.psEditor.editorParams}}
{{#if limit}}
:limit="{{limit}}"
{{/if}}
{{/jsonParse}}
{{/if}} {{/if}}
{{#eq item.psEditor.editorType "PICTURE"}} {{#eq item.psEditor.editorType "PICTURE"}}
accept='image/*' accept='image/*'
......
...@@ -26,7 +26,7 @@ interface CheckboxProps { ...@@ -26,7 +26,7 @@ interface CheckboxProps {
* *
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readOnly?: boolean;
} }
interface EditorEmit { interface EditorEmit {
...@@ -35,7 +35,7 @@ interface EditorEmit { ...@@ -35,7 +35,7 @@ interface EditorEmit {
const props = withDefaults(defineProps<CheckboxProps>(), { const props = withDefaults(defineProps<CheckboxProps>(), {
disabled: false, disabled: false,
readonly: false, readOnly: false,
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const curValue: Ref<boolean> = computed(() => { const curValue: Ref<boolean> = computed(() => {
...@@ -61,7 +61,7 @@ const onChange = ($event: any) => { ...@@ -61,7 +61,7 @@ const onChange = ($event: any) => {
<a-checkbox <a-checkbox
@change="onChange" @change="onChange"
:checked="curValue" :checked="curValue"
:disabled="disabled || readonly" :disabled="disabled || readOnly"
></a-checkbox> ></a-checkbox>
</div> </div>
</template> </template>
......
...@@ -27,7 +27,7 @@ interface RatingProps { ...@@ -27,7 +27,7 @@ interface RatingProps {
* *
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readOnly?: boolean;
/** /**
* 下发数据 * 下发数据
...@@ -59,7 +59,7 @@ const props = withDefaults(defineProps<RatingProps>(), { ...@@ -59,7 +59,7 @@ const props = withDefaults(defineProps<RatingProps>(), {
max: 5, max: 5,
allowHalf: false, allowHalf: false,
disabled: false, disabled: false,
readonly: false, readOnly: false,
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
...@@ -78,7 +78,7 @@ const onChange = (value: number) => { ...@@ -78,7 +78,7 @@ const onChange = (value: number) => {
:value="value" :value="value"
:allowHalf="allowHalf" :allowHalf="allowHalf"
:count="max" :count="max"
:disabled="disabled || readonly" :disabled="disabled || readOnly"
@change="onChange" @change="onChange"
/> />
</div> </div>
......
...@@ -42,7 +42,7 @@ interface sliderProps { ...@@ -42,7 +42,7 @@ interface sliderProps {
* *
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readOnly?: boolean;
/** /**
* 是否禁用 * 是否禁用
...@@ -61,7 +61,7 @@ const props = withDefaults(defineProps<sliderProps>(), { ...@@ -61,7 +61,7 @@ const props = withDefaults(defineProps<sliderProps>(), {
max: 100, max: 100,
step: 1, step: 1,
disabled: false, disabled: false,
readonly: false, readOnly: false,
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
...@@ -81,7 +81,7 @@ const onChange = (value: number) => { ...@@ -81,7 +81,7 @@ const onChange = (value: number) => {
:min="min" :min="min"
:max="max" :max="max"
:step="step" :step="step"
:disabled="disabled || readonly" :disabled="disabled || readOnly"
@afterChange="onChange" @afterChange="onChange"
/> />
</div> </div>
......
<template> <template>
<div class="app-stepper"> <div class="app-stepper">
<a-input-number v-model:value="result" :min="min" :max="max" :step="step" :precision="precision" :disabled="disabled || readonly" :controls="false"> <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-number> </a-input-number>
</div> </div>
......
...@@ -31,7 +31,7 @@ interface SwitchProps { ...@@ -31,7 +31,7 @@ interface SwitchProps {
* *
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readOnly?: boolean;
/** /**
* 大小 * 大小
...@@ -47,7 +47,7 @@ interface EditorEmit { ...@@ -47,7 +47,7 @@ interface EditorEmit {
const props = withDefaults(defineProps<SwitchProps>(), { const props = withDefaults(defineProps<SwitchProps>(), {
disabled: false, disabled: false,
readonly: false, readOnly: false,
size: 'default', size: 'default',
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
...@@ -72,7 +72,7 @@ const onChange = (value: number) => { ...@@ -72,7 +72,7 @@ const onChange = (value: number) => {
<a-switch <a-switch
:checked="curValue" :checked="curValue"
:size="size" :size="size"
:disabled="disabled || readonly" :disabled="disabled || readOnly"
@change="onChange" @change="onChange"
/> />
</div> </div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册