This commit is contained in:
huoshicang 2025-07-31 20:37:03 +03:00 committed by GitHub
commit f4e85f55e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 8 deletions

View File

@ -2,15 +2,10 @@
<template>
<div class="JPopup components-input-demo-presuffix" v-if="avalid">
<!--输入框-->
<a-input @click="handleOpen" :value="innerShowText || showText" :placeholder="placeholder" readOnly v-bind="attrs">
<a-input @click="handleOpen" v-model:value="showText" :placeholder="placeholder" v-bind="attrs" allow-clear @change="handleEmpty">
<template #prefix>
<Icon icon="ant-design:cluster-outlined"></Icon>
</template>
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 -->
<!-- <template #suffix>
<Icon icon="ant-design:close-circle-outlined" @click="handleEmpty" title="清空" v-if="showText"></Icon>
</template>-->
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 -->
</a-input>
<!-- update-begin--author:liaozhiyang---date:20240515---forQQYUN-9260必填模式下会影响到弹窗内antd组件的样式 -->
<a-form-item>
@ -116,8 +111,25 @@
/**
* TODO 清空
*/
function handleEmpty() {
showText.value = '';
function handleEmpty(e) {
// showText.value = '';
// update-begin--author:huoshicang---date:20250716
if (!e.target.value) {
// popup
let { fieldConfig } = props;
//
let values = {};
for (let item of fieldConfig) {
item.target.split(',').forEach((target) => {
//
values[target] = '';
});
}
props.formElRef && props.formElRef.setFieldsValue(values);
props.setFieldsValue && props.setFieldsValue(values);
emit('popUpChange', values);
}
// update-end--author:huoshicang---date:20250716
}
/**