【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 toggleSearchStatus = ref(false);
const attrs = useAttrs(); const attrs = useAttrs();
const tableScroll = ref({ x: true }); 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 [ const [
{ {
visibleChange, visibleChange,

View File

@ -1,8 +1,8 @@
<template> <template>
<JPopup v-bind="popupProps" /> <JPopup v-bind="popupProps" @focus="handleFocus" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent, ref } from 'vue';
import { JPopup } from '/@/components/Form'; import { JPopup } from '/@/components/Form';
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types'; import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks'; import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
@ -15,7 +15,7 @@
props: useJVxeCompProps(), props: useJVxeCompProps(),
setup(props: JVxeComponent.Props) { setup(props: JVxeComponent.Props) {
const { innerValue, row, originColumn, cellProps, handleChangeCommon } = useJVxeComponent(props); const { innerValue, row, originColumn, cellProps, handleChangeCommon } = useJVxeComponent(props);
const groupId = ref<string>('j-vxe-popup');
const popupProps = computed(() => { const popupProps = computed(() => {
return { return {
...cellProps, ...cellProps,
@ -25,7 +25,7 @@
fieldConfig: originColumn.value.fieldConfig, fieldConfig: originColumn.value.fieldConfig,
// orgFields: originColumn.value.orgFields, // orgFields: originColumn.value.orgFields,
// destFields: originColumn.value.destFields, // destFields: originColumn.value.destFields,
groupId: 'j-vxe-popup', groupId: groupId.value,
param: originColumn.value.params, param: originColumn.value.params,
sorter: originColumn.value.sorter, sorter: originColumn.value.sorter,
setFieldsValue: (values) => { 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 { return {
handleFocus,
popupProps, 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 { httpGroupRequest } from '/@/components/Form/src/utils/GroupRequest';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { filterMultiDictText } from '/@/utils/dict/JDictSelectUtil.js'; import { filterMultiDictText } from '/@/utils/dict/JDictSelectUtil.js';
@ -9,7 +9,19 @@ import { useRouter, useRoute } from 'vue-router';
import { useMethods } from '/@/hooks/system/useMethods'; import { useMethods } from '/@/hooks/system/useMethods';
import { importViewsFile } from '/@/utils'; 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 { createMessage } = useMessage();
//弹窗可视状态 //弹窗可视状态
const visible = ref(false); const visible = ref(false);