|
|
@@ -89,12 +89,15 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { computed, unref, inject, reactive, ref, watch, onMounted } from 'vue';
|
|
|
+ import { message } from 'ant-design-vue';
|
|
|
import NormalHisTable from '../comment/NormalHisTable.vue';
|
|
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
import { reportList, hisList, hisdownload } from '../reportManager.api';
|
|
|
import { columnsHis } from '../reportManager.data';
|
|
|
+ // [perf-base-v1] 卡1: OnlyOffice api.js 改为打开编辑器时按需加载
|
|
|
+ import { loadDocsApi } from '/@/utils/onlyOffice';
|
|
|
|
|
|
let props = defineProps({
|
|
|
addOredit: {
|
|
|
@@ -172,6 +175,17 @@
|
|
|
//重置表单
|
|
|
setModalProps({ confirmLoading: false });
|
|
|
// Object.assign(deviceData, data.record);
|
|
|
+ // [perf-base-v1] 卡1: 先按需加载 OnlyOffice api.js,成功后再初始化编辑器
|
|
|
+ setModalProps({ loading: true, loadingTip: '文档编辑器加载中...' });
|
|
|
+ try {
|
|
|
+ await loadDocsApi();
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e);
|
|
|
+ message.error('文档编辑器加载失败,请检查 OnlyOffice 服务后重试');
|
|
|
+ return;
|
|
|
+ } finally {
|
|
|
+ setModalProps({ loading: false });
|
|
|
+ }
|
|
|
new DocsAPI.DocEditor(
|
|
|
'fileEdit', // 元素id
|
|
|
{
|