Update JPopup.vue

让JPopup可以清空与fieldConfig相关的数据
pull/8599/head
huoshicang 2025-07-16 17:00:36 +08:00 committed by GitHub
parent 37c62c3962
commit c30e35c42d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 5 deletions

View File

@ -2,14 +2,14 @@
<template> <template>
<div class="JPopup components-input-demo-presuffix" v-if="avalid"> <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" :value="innerShowText || showText" :placeholder="placeholder" v-bind="attrs">
<template #prefix> <template #prefix>
<Icon icon="ant-design:cluster-outlined"></Icon> <Icon icon="ant-design:cluster-outlined"></Icon>
</template> </template>
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 --> <!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 -->
<!-- <template #suffix> <template #suffix>
<Icon icon="ant-design:close-circle-outlined" @click="handleEmpty" title="清空" v-if="showText"></Icon> <Icon icon="ant-design:close-circle-outlined" @click="handleEmpty" title="清空" v-if="showText"></Icon>
</template>--> </template>
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 --> <!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后有两个清除图标后边这个清除只是把输入框中数据清除实际值并没有清除 -->
</a-input> </a-input>
<!-- update-begin--author:liaozhiyang---date:20240515---forQQYUN-9260必填模式下会影响到弹窗内antd组件的样式 --> <!-- update-begin--author:liaozhiyang---date:20240515---forQQYUN-9260必填模式下会影响到弹窗内antd组件的样式 -->
@ -117,7 +117,22 @@
* TODO 清空 * TODO 清空
*/ */
function handleEmpty() { function handleEmpty() {
showText.value = ''; // showText.value = '';
// update-begin--author:huoshicang---date:20250716
// 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
} }
/** /**