【issues/675】子表字段Popup弹框数据不更新

pull/755/head
zhangdaiscott 2023-08-11 15:35:11 +08:00
parent a5ed3ef9c4
commit 63cea84cfc
3 changed files with 29 additions and 8 deletions

View File

@ -101,7 +101,11 @@
const toggleSearchStatus = ref(false);
const attrs = useAttrs();
const tableScroll = ref({ x: true });
const getBindValue = Object.assign({}, unref(props), unref(attrs));
// update-begin--author:liaozhiyang---date:20230811---forissues/675Popup
const getBindValue = computed(() => {
return Object.assign({}, unref(props), unref(attrs));
});
// update-end--author:liaozhiyang---date:20230811---forissues/675Popup
const [
{
visibleChange,

View File

@ -1,8 +1,8 @@
<template>
<JPopup v-bind="popupProps" />
<JPopup v-bind="popupProps" @focus="handleFocus" />
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue';
import { computed, defineComponent, ref } from 'vue';
import { JPopup } from '/@/components/Form';
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
@ -15,7 +15,7 @@
props: useJVxeCompProps(),
setup(props: JVxeComponent.Props) {
const { innerValue, row, originColumn, cellProps, handleChangeCommon } = useJVxeComponent(props);
const groupId = ref<string>('j-vxe-popup');
const popupProps = computed(() => {
return {
...cellProps,
@ -25,7 +25,7 @@
fieldConfig: originColumn.value.fieldConfig,
// orgFields: originColumn.value.orgFields,
// destFields: originColumn.value.destFields,
groupId: 'j-vxe-popup',
groupId: groupId.value,
param: originColumn.value.params,
sorter: originColumn.value.sorter,
setFieldsValue: (values) => {
@ -45,8 +45,13 @@
},
};
});
// update-begin--author:liaozhiyang---date:20230811---forissues/675Popup
const handleFocus = () => {
groupId.value = '';
};
// update-end--author:liaozhiyang---date:20230811---forissues/675Popup
return {
handleFocus,
popupProps,
};
},

View File

@ -1,4 +1,4 @@
import { reactive, ref, unref, defineAsyncComponent, toRaw, markRaw } from 'vue';
import { reactive, ref, unref, defineAsyncComponent, toRaw, markRaw, isRef, watch, onUnmounted } from 'vue';
import { httpGroupRequest } from '/@/components/Form/src/utils/GroupRequest';
import { defHttp } from '/@/utils/http/axios';
import { filterMultiDictText } from '/@/utils/dict/JDictSelectUtil.js';
@ -9,7 +9,19 @@ import { useRouter, useRoute } from 'vue-router';
import { useMethods } from '/@/hooks/system/useMethods';
import { importViewsFile } from '/@/utils';
export function usePopBiz(props, tableRef?) {
export function usePopBiz(ob, tableRef?) {
// update-begin--author:liaozhiyang---date:20230811---for【issues/675】子表字段Popup弹框数据不更新
let props: any;
if (isRef(ob)) {
props = ob.value;
const stopWatch = watch(ob, (newVal) => {
props = newVal;
});
onUnmounted(() => stopWatch());
} else {
props = ob;
}
// update-end--author:liaozhiyang---date:20230811---for【issues/675】子表字段Popup弹框数据不更新
const { createMessage } = useMessage();
//弹窗可视状态
const visible = ref(false);