diff --git a/openhis-ui-vue3/src/main.js b/openhis-ui-vue3/src/main.js index 1e446913d..5e288b493 100755 --- a/openhis-ui-vue3/src/main.js +++ b/openhis-ui-vue3/src/main.js @@ -1,4 +1,4 @@ -import {createApp} from 'vue'; +import {createApp, nextTick} from 'vue'; import VxeUIAll from 'vxe-table'; import 'vxe-table/lib/style.css'; @@ -104,8 +104,8 @@ console.error = (...args) => { _origError.apply(console, args); }; - const app = createApp(App); + // 全局方法挂载 app.config.globalProperties.useDict = useDict; app.config.globalProperties.download = download; @@ -167,7 +167,8 @@ window.addEventListener("error", (e) => { }, true); // 应用启动后初始化公告弹窗功能 -import { nextTick } from 'vue' nextTick(() => { initNoticePopupAfterLogin() }) + +app.mount('#app') diff --git a/openhis-ui-vue3/src/patches/el-form-nan-plugin.js b/openhis-ui-vue3/src/patches/el-form-nan-plugin.js index 126e872e9..0fd5e61e4 100644 --- a/openhis-ui-vue3/src/patches/el-form-nan-plugin.js +++ b/openhis-ui-vue3/src/patches/el-form-nan-plugin.js @@ -20,9 +20,11 @@ export default function patchElFormNan() { .replace('const updateLabelWidth = (action = \"update\") => {', 'let _isMounted = true;\n\tconst updateLabelWidth = (action = \"update\") => {') .replace('nextTick(() => {', - 'nextTick(() => {\n\t\t\t\tif (!_isMounted) return;\n\t\t\t\ttry {') + 'nextTick(() => {\n\t\t\t\tif (!_isMounted) return;') + .replace('if (slots.default && props.isAutoWidth) {', + 'try {\n\t\t\t\tif (slots.default && props.isAutoWidth) {') .replace('else if (action === \"remove\") formContext?.deregisterLabelWidth(computedWidth.value);', - 'else if (action === \"remove\") formContext?.deregisterLabelWidth(computedWidth.value);\n\t\t\t\t} catch (e) { /* teardown race */ }') + 'else if (action === \"remove\") formContext?.deregisterLabelWidth(computedWidth.value);\n\t\t\t\t}\n\t\t\t} catch (e) { /* teardown race */ }') .replace('onBeforeUnmount(() => {', 'onBeforeUnmount(() => {\n\t\t\t_isMounted = false;') .replace('onUpdated(() => updateLabelWidthFn())', 'onUpdated(() => { if (_isMounted) updateLabelWidthFn(); })') .replace('if (props.updateAll) formContext?.registerLabelWidth(val, oldVal);', diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue index e7b32fd5b..2138c01c2 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue @@ -1,6 +1,7 @@