From 81eef127a7d920fa60e36a516b647a76fc4d94d6 Mon Sep 17 00:00:00 2001
From: yangjun <1173114630@qq.com>
Date: Mon, 9 Dec 2024 08:24:29 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=EF=BC=8C=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=9B=9B=E5=88=86=E5=B1=8F=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../KcExportConfigTpkwcqkjzglxPzList.vue | 2 +-
src/views/kc/jiaoshi/index.vue | 8 +-
src/views/kc/ketang/KcKetangbiao.data.ts | 5 +
.../components/WjxWjxxTmlbDjV2Form.vue | 58 +--
src/views/site/common/footer.vue | 17 +-
.../common/video/videojs/viewPage_old.vue | 2 +-
.../site/common/video/videojs/viewPagenew.vue | 2 +-
.../checkKecheng/dqxqkcMenu.vue | 4 +-
src/views/zy/sysZy/kczygl/CccssyslList.vue | 59 +++
.../zy/sysZy/kczygl/KczyglStaticList.vue | 4 +
src/views/zy/sysZy/kczygl/ZyKctjList.vue | 9 +
src/views/zy/zyInfo/ZyInfo.data.ts | 11 +-
src/views/zy/zyInfo/ZyInfoKhclList.vue | 230 +++++++++
src/views/zy/zyInfo/ZyInfoQimoV2List.vue | 4 +-
src/views/zy/zyInfo/ZyInfoV2List.vue | 2 +-
.../components/ZyInfoDetailForm copy.vue | 485 ++++++++++++++++++
.../zy/zyInfo/components/ZyInfoDetailForm.vue | 54 +-
.../components/wpsApi/index.d.ts | 415 +++++++++++++++
.../web-office-sdk-solution-v2.0.7.cjs.js | 1 +
.../web-office-sdk-solution-v2.0.7.es.js | 1 +
.../web-office-sdk-solution-v2.0.7.umd.js | 1 +
21 files changed, 1317 insertions(+), 57 deletions(-)
create mode 100644 src/views/zy/sysZy/kczygl/CccssyslList.vue
create mode 100644 src/views/zy/zyInfo/ZyInfoKhclList.vue
create mode 100644 src/views/zy/zyInfo/components/ZyInfoDetailForm copy.vue
create mode 100644 src/views/zy/zyInfoStudent/components/wpsApi/index.d.ts
create mode 100644 src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.cjs.js
create mode 100644 src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.es.js
create mode 100644 src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.umd.js
diff --git a/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue b/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue
index e08a62c..ac02ff3 100644
--- a/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue
+++ b/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue
@@ -40,7 +40,7 @@
-
+
-
+
单选题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
+ 题目分值: {{ item.wjScore }} 分
-
+
@@ -44,15 +46,12 @@
判断题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
-
-
- 题目分值: {{ item.wjScore }} 分
+ 题目分值: {{ item.wjScore }} 分
@@ -68,15 +67,12 @@
多选题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
-
-
- 题目分值: {{ item.wjScore }} 分
+ 题目分值: {{ item.wjScore }} 分
@@ -94,16 +90,12 @@
填空题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
-
-
- 题目分值: {{ item.wjScore }} 分
+ 题目分值: {{ item.wjScore }} 分
@@ -123,16 +115,12 @@
简答题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
-
-
- 题目分值: {{ item.wjScore }} 分
+ 题目分值: {{ item.wjScore }} 分
@@ -152,16 +140,12 @@
文件题
- {{ index + 1 }}、
+
+ {{ index + 1 }}、
-
-
- 题目分值: {{ item.wjScore }} 分
+ 题目分值: {{ item.wjScore }} 分
diff --git a/src/views/site/common/footer.vue b/src/views/site/common/footer.vue
index c216f37..e65a232 100644
--- a/src/views/site/common/footer.vue
+++ b/src/views/site/common/footer.vue
@@ -1,8 +1,14 @@
-
-
-
-
+
+
+
+
@@ -11,15 +17,12 @@
.footerLeft{
font-size: 16px;
font-weight: 700;
- float:left;
}
.footerRight{
font-size: 16px;
font-weight: 700;
- float: right;
}
.ant-layout-footer{
- line-height: 0;
background: #FFF;
}
\ No newline at end of file
diff --git a/src/views/site/common/video/videojs/viewPage_old.vue b/src/views/site/common/video/videojs/viewPage_old.vue
index 4e84709..4002428 100644
--- a/src/views/site/common/video/videojs/viewPage_old.vue
+++ b/src/views/site/common/video/videojs/viewPage_old.vue
@@ -39,7 +39,7 @@
- 平台分别在三个时间节点(上课后10分钟,课中50分钟,下课前10分钟)抓取学生全景图片进行AI人流量识别,当前显示的人数为最近一个时间的人数识别
+ 平台分别在三个时间节点(上课后10分钟,课中50分钟,下课前10分钟)抓取学生全景图片进行AI人流量识别,当前显示的人数为最近一个时间的人数识别,目前部分教室摄像头拍摄画面广角待更新,AI识别出勤人数仅供参考
?
diff --git a/src/views/site/common/video/videojs/viewPagenew.vue b/src/views/site/common/video/videojs/viewPagenew.vue
index 055b065..7af28d1 100644
--- a/src/views/site/common/video/videojs/viewPagenew.vue
+++ b/src/views/site/common/video/videojs/viewPagenew.vue
@@ -32,7 +32,7 @@
- 平台分别在三个时间节点(上课后10分钟,课中50分钟,下课前10分钟)抓取学生全景图片进行AI人流量识别,当前显示的人数为最近一个时间的人数识别
+ 平台分别在三个时间节点(上课后10分钟,课中50分钟,下课前10分钟)抓取学生全景图片进行AI人流量识别,当前显示的人数为最近一个时间的人数识别,目前部分教室摄像头拍摄画面广角待更新,AI识别出勤人数仅供参考
?
diff --git a/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue b/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue
index 0b51269..38be83a 100644
--- a/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue
+++ b/src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue
@@ -49,10 +49,10 @@
课程资源
-
+
@@ -31,6 +34,7 @@
import TjsjList from '/@/views/zy/sysZy/kczygl/TjsjList.vue';
import ZyKctjList from '/@/views/zy/sysZy/kczygl/ZyKctjList.vue';
import CyKctjList from '/@/views/zy/sysZy/kczygl/CyKctjList.vue';
+ import CccssyslList from '/@/views/zy/sysZy/kczygl/CccssyslList.vue';
const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl;
diff --git a/src/views/zy/sysZy/kczygl/ZyKctjList.vue b/src/views/zy/sysZy/kczygl/ZyKctjList.vue
index 95b56a2..6e8175f 100644
--- a/src/views/zy/sysZy/kczygl/ZyKctjList.vue
+++ b/src/views/zy/sysZy/kczygl/ZyKctjList.vue
@@ -38,6 +38,7 @@
查询
导出
+ 修复次数不足的问题
@@ -68,6 +69,7 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { useGlobSetting } from '/@/hooks/setting';
+import { defHttp } from '/@/utils/http/axios';
const globSetting = useGlobSetting();
@@ -154,6 +156,13 @@
createMessage.warning("正在向文件服务器进行传输,请稍等10秒刷新后进行预览")
}
}
+
+ //修改因检测次数不足的导致查重结果出不来的问题
+ function handleCsbz(){
+ defHttp.post({url:'/zyInfoStudent/zyInfoStudent/cxtjByJccsbz'}).then(res=>{
+
+ })
+ }
/**
* 详情
diff --git a/src/views/zy/zyInfo/ZyInfo.data.ts b/src/views/zy/zyInfo/ZyInfo.data.ts
index 4d54dd2..1e422ec 100644
--- a/src/views/zy/zyInfo/ZyInfo.data.ts
+++ b/src/views/zy/zyInfo/ZyInfo.data.ts
@@ -164,9 +164,16 @@ export const columnsKhcl: BasicColumn[] = [
},
},
{
- title: '状态',
+ title: '是否全部完成',
align: "center",
- dataIndex: 'zyStatus_dictText'
+ dataIndex: 'zyStatus',
+ customRender:({text}) =>{
+ var rt = "未完成";
+ if(text=='2'){
+ rt = "已完成";
+ }
+ return rt;
+ },
},
{
title: '学年学期',
diff --git a/src/views/zy/zyInfo/ZyInfoKhclList.vue b/src/views/zy/zyInfo/ZyInfoKhclList.vue
new file mode 100644
index 0000000..25e5bd2
--- /dev/null
+++ b/src/views/zy/zyInfo/ZyInfoKhclList.vue
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+ 上传考核材料
+
+
+
+
+
+
+
+
+
+
+
+
+ 无文件
+ 下载
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/zy/zyInfo/ZyInfoQimoV2List.vue b/src/views/zy/zyInfo/ZyInfoQimoV2List.vue
index fbf1862..b97a010 100644
--- a/src/views/zy/zyInfo/ZyInfoQimoV2List.vue
+++ b/src/views/zy/zyInfo/ZyInfoQimoV2List.vue
@@ -380,9 +380,7 @@
重置
导出
发布成绩
- 上传考核材料
+
温馨提示:考试完成后,请及时发布评分
diff --git a/src/views/zy/zyInfo/ZyInfoV2List.vue b/src/views/zy/zyInfo/ZyInfoV2List.vue
index 85ab5b9..f3a5764 100644
--- a/src/views/zy/zyInfo/ZyInfoV2List.vue
+++ b/src/views/zy/zyInfo/ZyInfoV2List.vue
@@ -380,7 +380,7 @@
重置
导出
发布成绩
- 上传考核材料
+
温馨提示:作业完成后,请及时发布评分
diff --git a/src/views/zy/zyInfo/components/ZyInfoDetailForm copy.vue b/src/views/zy/zyInfo/components/ZyInfoDetailForm copy.vue
new file mode 100644
index 0000000..a5ebcf9
--- /dev/null
+++ b/src/views/zy/zyInfo/components/ZyInfoDetailForm copy.vue
@@ -0,0 +1,485 @@
+
+
+
+
+
+
+
+
+
基本信息
+
+
+ {{ formData.title }}
+
+
+
+
+
+
+
+
+
+ {{ formData.endTime }}
+
+
+
+
+ {{ formData.startTime }}
+
+
+
+
+
+
+
+
+
+ {{ lastString(formData.filePath) }}
+ 下载
+
+
+
+
+
+
+
+
+
+
+ 查重设置
+
+
+
+
+ %
+
+
+
+ 维普
+
+
+ 维普资源库查重:
+ 中文科技期刊数据库、硕博学位论文库、高校特色论文库、互联网数据资源/互联网文档资源
+
+
+ 学校作业库查重:
+ 历届学生提供的作业库内查重
+
+
+ 本次作业查重:
+ 本次学生提交的作业间查重
+
+
+ AIGC
+
+
+ AIGC查重:
+ 检测作业是否部分或全部由AI模型生成
+
+
+
+
+
+
+
+
+
批阅信息
+
+
+
+
+
+
+
+
+ {{ lastString(formData.pyFilePath) }}
+ 下载
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/zy/zyInfo/components/ZyInfoDetailForm.vue b/src/views/zy/zyInfo/components/ZyInfoDetailForm.vue
index c9b2771..eb41743 100644
--- a/src/views/zy/zyInfo/components/ZyInfoDetailForm.vue
+++ b/src/views/zy/zyInfo/components/ZyInfoDetailForm.vue
@@ -81,7 +81,7 @@
-
+
批阅信息
@@ -96,6 +96,9 @@
下载
+
+
+
@@ -155,6 +158,7 @@ import { useRouter } from 'vue-router';
import dayjs, { Dayjs } from 'dayjs';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
+import WebOfficeSDK from '/@/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.es'
import { downloadFile } from '/@/utils/common/renderUtils';
//当前路由信息
@@ -166,6 +170,7 @@ const props = defineProps({
formData: { type: Object, default: () => {} },
formBpm: { type: Boolean, default: true },
});
+const showType = ref('0');
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
@@ -283,11 +288,58 @@ function add() {
* 编辑
*/
function edit(record) {
+ console.log("🚀 ~ edit ~ record:", record)
nextTick(() => {
resetFields();
//赋值
Object.assign(formData, record);
handleKcnr(formData.kcnr);
+
+
+ // const parts = record.stuFilePath.split('.');
+ // const filetype = parts[parts.length - 1];
+ // console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
+ // let wpsType = "w";
+ // if(filetype=='doc' || filetype=='docx'){
+ // showType.value = '1';
+ // wpsType = "w";
+ // }else if(filetype=='pdf'){
+ // showType.value = '1';
+ // wpsType = "f";
+ // }else if(filetype=='ppt' || filetype=='pptx' ){
+ // showType.value = '1';
+ // wpsType = "p";
+ // }else if(filetype=='xls' || filetype=='xlsx' ){
+ // showType.value = '1';
+ // wpsType = "s";
+ // }
+
+ // if(showType.value == '1'){
+ // const element = document.getElementById('wpsiframeid');
+ // // 清空内容
+ // element.innerHTML = '';
+ // const jssdk = WebOfficeSDK.init({
+ // officeType: wpsType,
+ // appId: 'SX20241118WSUGQN',
+ // fileId: formData.stuId,
+ // mount:document.querySelector('.wps-iframe'),
+ // commonOptions: {
+ // isShowDocMap: false, //是否开启目录功能,默认开启
+ // isShowTopArea: false, // 隐藏顶部区域(头部和工具栏)
+ // isShowHeader: false, // 隐藏头部区域
+ // isBrowserViewFullscreen: true, // 是否在浏览器区域全屏
+ // isIframeViewFullscreen: true, // 是否在 iframe 区域内全屏
+ // acceptVisualViewportResizeEvent: true // 控制 WebOffice 是否接受外部的 VisualViewport
+ // },
+ // wordOptions: {
+ // isShowDocMap: false, // 是否开启目录功能,默认开启
+ // isBestScale: true, // 打开文档时,默认以最佳比例显示
+ // isShowBottomStatusBar: false, // 是否展示底部状态栏
+ // }
+ // //token: getToken()
+ // })
+ // }
+
});
}
diff --git a/src/views/zy/zyInfoStudent/components/wpsApi/index.d.ts b/src/views/zy/zyInfoStudent/components/wpsApi/index.d.ts
new file mode 100644
index 0000000..c161531
--- /dev/null
+++ b/src/views/zy/zyInfoStudent/components/wpsApi/index.d.ts
@@ -0,0 +1,415 @@
+/**
+ * 定义用户头部其它按钮菜单
+ */
+interface IUserHeaderSubItemsConf {
+ /**
+ * 类型
+ */
+ type: 'export_img' | 'split_line' | 'custom';
+ /**
+ * 文本
+ */
+ text?: string;
+ /**
+ * 事件订阅
+ */
+ subscribe?: ((arg0?: any) => any) | string;
+}
+
+/**
+ * 定义用户头部按钮配置
+ */
+interface IUserHeaderButtonConf {
+ /**
+ * 提示
+ */
+ tooltip?: string;
+ /**
+ * 事件订阅
+ */
+ subscribe?: ((arg0?: any) => any) | string;
+
+ /**
+ * 菜单项
+ */
+ items?: IUserHeaderSubItemsConf[];
+}
+
+/**
+ * 用于保存iframe原始尺寸
+ */
+interface IIframeWH {
+ width: string;
+ height: string;
+}
+
+/**
+ * 定义用户头部配置
+ */
+interface IUserHeadersConf {
+ /**
+ * 返回按钮
+ */
+ backBtn?: IUserHeaderButtonConf;
+ /**
+ * 分享按钮
+ */
+ shareBtn?: IUserHeaderButtonConf;
+ /**
+ * 其他按钮
+ */
+ otherMenuBtn?: IUserHeaderButtonConf;
+}
+interface ICommonOptions {
+ /**
+ * 是否显示顶部区域,头部和工具栏
+ */
+ isShowTopArea: boolean;
+ /**
+ * 是否显示头部
+ */
+ isShowHeader: boolean;
+ /**
+ * 是否需要父级全屏
+ */
+ isParentFullscreen: boolean;
+ /**
+ * 是否在iframe区域内全屏
+ */
+ isIframeViewFullscreen: boolean;
+ /**
+ * 是否在浏览器区域内全屏
+ */
+ isBrowserViewFullscreen: boolean;
+}
+/**
+ * 文字自定义配置
+ */
+interface IWpsOptions {
+ /**
+ * 是否显示目录
+ */
+ isShowDocMap?: boolean;
+ /**
+ * 默认以最佳显示比例打开
+ */
+ isBestScale?: boolean;
+ /**
+ * pc-是否展示底部状态栏
+ */
+ isShowBottomStatusBar?: boolean;
+}
+
+/**
+ * 表格自定义配置
+ */
+interface IEtOptions {
+ /**
+ * pc-是否展示底部状态栏
+ */
+ isShowBottomStatusBar?: boolean;
+}
+
+/**
+ * pdf自定义配置
+ */
+interface IPDFOptions {
+ isShowComment?: boolean;
+ isInSafeMode?: boolean;
+ /**
+ * pc-是否展示底部状态栏
+ */
+ isShowBottomStatusBar?: boolean;
+}
+
+/**
+ * 演示自定义配置
+ */
+interface IWppOptions {
+ /**
+ * pc-是否展示底部状态栏
+ */
+ isShowBottomStatusBar?: boolean;
+}
+
+/**
+ * 数据表自定义配置
+ */
+ interface IDBOptions {
+ /**
+ * 是否显示使用反馈按钮
+ */
+ isShowFeedback?: boolean
+}
+
+/**
+ * 定义用户通用事件订阅
+ */
+interface ISubscriptionsConf {
+ [key: string]: any;
+ /**
+ * 导航事件
+ */
+ navigate: (arg0?: any) => any;
+ /**
+ * WPSWEB ready 事件
+ */
+ ready: (arg0?: any) => any;
+ /**
+ * 打印事件
+ */
+ print?: {
+ custom?: boolean,
+ subscribe: (arg0?: any) => any,
+ };
+ /**
+ * 导出 PDF 事件
+ */
+ exportPdf?: (arg0?: any) => any;
+}
+
+interface ITokenData {
+ token: string;
+ timeout: number;
+}
+
+interface IClipboardData {
+ text: string;
+ html: string;
+}
+
+/**
+ * 用户配置
+ */
+interface IConfig {
+ /**
+ * WPSWEB iframe 挂载点
+ */
+ mount?: HTMLElement;
+ /**
+ * url参数
+ */
+ url?: string;
+ wpsUrl?: string; // 即将废弃
+ /**
+ * 头部
+ */
+ headers?: IUserHeadersConf;
+ /**
+ * 头部
+ */
+ mode?: 'nomal' | 'simple';
+ /**
+ * 通用配置
+ */
+ commonOptions?: ICommonOptions;
+ /**
+ * 文字自定义配置
+ */
+ wpsOptions?: IWpsOptions;
+ wordOptions?: IWppOptions;
+ /**
+ * 表格自定义配置
+ */
+ etOptions?: IEtOptions;
+ excelOptions?: IEtOptions;
+ /**
+ * 演示自定义配置
+ */
+ wppOptions?: IWppOptions;
+ pptOptions?: IWppOptions;
+ /**
+ * pdf自定义配置
+ */
+ pdfOptions?: IPDFOptions;
+ /**
+ * db自定义配置
+ */
+ dbOptions?: IDBOptions;
+ /**
+ * 事件订阅
+ */
+ subscriptions?: ISubscriptionsConf;
+ // 调试模式
+ debug?: boolean;
+ commandBars?: IWpsCommandBars[];
+ print?: {
+ custom?: boolean,
+ callback?: string,
+ };
+
+ exportPdf?: {
+ callback?: string,
+ };
+
+ // 获取token
+ refreshToken?: TRefreshToken;
+
+ cooperUserAttribute?: {
+ isCooperUsersAvatarVisible?: boolean,
+ cooperUsersColor?: [{
+ userId: string | number,
+ color: string,
+ }],
+ };
+}
+
+// type eventConfig = {
+// eventName: cbEventNames,
+// }
+
+/** ============================= */
+interface IMessage {
+ eventName: string;
+ msgId?: string;
+ callbackId?: number;
+ data?: any;
+ url?: any;
+ result?: any;
+ error?: any;
+ _self?: boolean;
+ sdkInstanceId?: number
+}
+
+/**
+ * WPSWEBAPI
+ */
+interface IWpsWebApi {
+ WpsApplication?: () => any;
+}
+
+/**
+ * 工具栏
+ */
+interface IWpsCommandBars {
+ cmbId: string;
+ attributes: IWpsCommandBarAttr[] | IWpsCommandBarObjectAttr;
+}
+
+/**
+ * 工具栏属性
+ */
+interface IWpsCommandBarAttr {
+ name: string;
+ value: any;
+}
+/**
+ * 工具栏属性
+ */
+interface IWpsCommandBarObjectAttr {
+ [propName: string]: any;
+}
+
+/**
+ * D.IWPS 定义
+ */
+
+interface IWps extends IWpsCompatible {
+ version: string;
+ url: string;
+ iframe: any;
+ Enum? : any; // 即将废弃
+ Events?: any; // 即将废弃
+ Props?: string;
+ advancedApiReady: () => Promise;
+ /**
+ * 兼容1.x用法
+ */
+ ready?:() => Promise;
+ destroy: () => Promise;
+ WpsApplication?: () => any;
+ WordApplication?: () => any;
+ EtApplication?: () => any;
+ ExcelApplication?: () => any;
+ WppApplication?: () => any;
+ PPTApplication?: () => any;
+ PDFApplication?: () => any;
+ Application?: any;
+ CommonApi?: any;
+ commonApiReady: () => Promise;
+ setToken: (tokenData: {
+ token: string, timeout?: number, hasRefreshTokenConfig: boolean,
+ }) => Promise;
+ tokenData?: { token: string } | null;
+ commandBars?: IWpsCommandBars[] | null;
+ iframeReady?: boolean;
+ on: (eventName: string, handle: (event?: any) => void) => void;
+ off: (eventName: string, handle: (event?: any) => void) => void;
+ Stack?: any;
+ Free?: (objId: any) => Promise;
+}
+
+/**
+ * 兼容1.x用法
+ */
+interface IWpsCompatible {
+ tabs?: {
+ getTabs: () => Promise>
+ switchTab: (tabKey: number) => Promise,
+ }
+ setCommandBars?: (args: Array) => Promise;
+ save?: () => Promise;
+ ApiEvent?: {
+ AddApiEventListener: (eventName: string, handle: (event?: any) => void) => void
+ RemoveApiEventListener: (eventName: string, handle: (event?: any) => void) => void
+ }
+ executeCommandBar?: (id: string) => void
+}
+
+interface IFlag {
+ advancedApiReadySended: boolean;
+ advancedApiReadySendedJust: boolean;
+ commonApiReadySended: boolean;
+ commonApiReadySendedJust: boolean;
+}
+
+interface ICbEvent {
+ refreshToken?: TRefreshToken;
+}
+
+interface IWebOfficeSDK {
+ config: (conf: IConfig) => IWps | undefined;
+ init: (conf: IAppConfig) => IWps | undefined;
+ OfficeType: OfficeType;
+}
+
+interface IReadyEvent {
+ event: string;
+ callback?: (...args: any) => void;
+ after?: boolean;
+}
+
+type TRefreshToken = () => ITokenData | Promise;
+
+type sendMsgToWps = (msg: IMessage) => void;
+type getId = () => string;
+
+interface IAppConfig extends IConfig {
+ appId: string;
+ fileId: string | number;
+ officeType: string;
+ /**
+ * @deprecated use token instead
+ */
+ fileToken?: string | ITokenData;
+ token?: string | ITokenData;
+ endpoint?: string;
+ customArgs?: Record;
+ /**
+ * @deprecated A config item for WebOfficeSDK.config
+ */
+ url?: string;
+ mount?: any;
+ attrAllow: string | string[];
+ isListenResize?: boolean; // sdk内部是否监听resize变化,默认监听
+}
+
+type OfficeType = {
+ Spreadsheet: string,
+ Writer: string,
+ Presentation: string,
+ Pdf: string,
+ Otl: string
+}
+
+export { IAppConfig, ICbEvent, IClipboardData, ICommonOptions, IConfig, IDBOptions, IEtOptions, IFlag, IIframeWH, IMessage, IPDFOptions, IReadyEvent, ISubscriptionsConf, ITokenData, IUserHeaderButtonConf, IUserHeaderSubItemsConf, IUserHeadersConf, IWebOfficeSDK, IWppOptions, IWps, IWpsCommandBarAttr, IWpsCommandBarObjectAttr, IWpsCommandBars, IWpsCompatible, IWpsOptions, IWpsWebApi, OfficeType, TRefreshToken, getId, sendMsgToWps };
diff --git a/src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.cjs.js b/src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.cjs.js
new file mode 100644
index 0000000..6956b81
--- /dev/null
+++ b/src/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.cjs.js
@@ -0,0 +1 @@
+"use strict";var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ECbConfigEventNames,EOfficeTypes,EModeTypes,EFullScreenStatus,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&s[s.length-1])&&(6===r[0]||2===r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]=0&&this.HANDLE_LIST.splice(t,1),window.removeEventListener("message",e,!1)},e.prototype.empty=function(){for(;this.HANDLE_LIST.length;){var e=this.HANDLE_LIST.shift();window.removeEventListener("message",e,!1)}},e.prototype.parse=function(e){try{return"object"==typeof e?e:e?JSON.parse(e):e}catch(t){return e}},e}(),Base=function(){function e(e,t){var n=this;this.collectObjIdHandlers=new Set,this.polyfillApi=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"],this.getId=function(){return""},this.setterCallbacks={idMap:{}},this.sendMsgToWps=function(){},this.objId=0,this.origin="",this.apiChannel=function(e,t,i,s){return __awaiter(n,void 0,void 0,function(){var n,r,o,a,c,l,u,d,f,p=this;return __generator(this,function(h){switch(h.label){case 0:return n=this.getId(),a=new Promise(function(e,t){r=e,o=t}),c={},t.args?[4,this.reduceArgs(t.args)]:[3,2];case 1:l=h.sent(),u=l[0],d=l[1],t.args=u,c=d,h.label=2;case 2:return e!==this.prefix+"setter"?[3,4]:[4,this.handleApiSetter(t)];case 3:h.sent(),h.label=4;case 4:return f=function(){var t=function(a){return __awaiter(p,void 0,void 0,function(){var l,u,d;return __generator(this,function(f){switch(f.label){case 0:return this.instance.originWhiteList.includes(a.origin)||this.origin===a.origin?(l=this.message.parse(a.data)).eventName===this.prefix+"callback"&&l.callbackId&&c[l.callbackId]?[4,c[l.callbackId].apply(c,l.data.args)]:[3,2]:[2];case 1:u=f.sent(),this.sendMsgToWps({result:u,eventName:this.prefix+"callback.reply",callbackId:l.callbackId}),f.label=2;case 2:return l.eventName===e+".reply"&&l.msgId===n&&(l.error?((d=new Error("")).stack=l.error+"\n"+i,s&&s(),o(d)):r(l.result),this.message.remove(t)),[2]}})})};return p.message.add(t),a},this.handleSendApiChannel([{eventName:e,data:t,msgId:n},f]),[2,a]}})})},this.handleApiSetter=function(e){return __awaiter(n,void 0,void 0,function(){var t,n,i,s,r,o,a,c,l,u,d=this;return __generator(this,function(f){switch(f.label){case 0:return t=function(){return Object.keys(d.setterCallbacks.idMap).find(function(e){return d.setterCallbacks.idMap[e]===i+":"+n})},n=e.prop,i=e.parentObjId,s=e.value,[4,this.reduceArgs([s])];case 1:return r=f.sent(),o=r[0],a=r[1],e.value=o[0],c=Object.keys(a)[0],l=this.setterCallbacks[i],null===s&&l&&l[n]&&((u=t())&&delete this.setterCallbacks.idMap[u],delete l[n],Object.keys(l).length||delete this.setterCallbacks[i],Object.keys(this.setterCallbacks.idMap).length||this.message.remove(this.setterCallbackSubscribe.bind(this))),c&&(Object.keys(this.setterCallbacks.idMap).length||this.message.add(this.setterCallbackSubscribe.bind(this)),this.setterCallbacks[i]||(this.setterCallbacks[i]={}),this.setterCallbacks[i][n]={callbackId:c,callback:a[c]},(u=t())&&delete this.setterCallbacks.idMap[u],this.setterCallbacks.idMap[c]=i+":"+n),[2]}})})},this.prefix=t,this.origin=e.origin,this.sendMsgToWps=e.sendMsgToWps.bind(e),this.getId=e.getId.bind(e),this.message=e.message,this.sdkInstanceId=e.instanceId,this.instance=e}return e.prototype.destroyApplication=function(){this.collectObjIdHandlers=new Set,this.objId=0},e.prototype.subEventHandle=function(e,t){var n=this,i={};this.message.add(function(e){return __awaiter(n,void 0,void 0,function(){var t,n,s,r,o,a;return __generator(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.sdkInstanceId,t.eventName===this.prefix+"event"&&Number(n)===this.sdkInstanceId&&t.data?(s=t.data,r=s.eventName,o=s.data,(a=i[r])?[4,a(o)]:[3,2]):[3,2]):[2];case 1:c.sent(),c.label=2;case 2:return[2]}})})});var s=function(s){var r=t[s];Object.defineProperty(e,r,{set:function(e){i[r]=e,n.sendMsgToWps({eventName:n.prefix+"event.register",data:{eventName:r,register:!!e,objId:n.objId+=1},sdkInstanceId:n.sdkInstanceId})}})};for(var r in t)s(r)},e.prototype.mixinProto=function(e,t){Object.assign(e,t)},e.prototype.makeCollectObjIdHandle=function(e){var t=this;return function(){var n=[],i=function(e){n.push(e)};return t.collectObjIdHandlers.add(i),{End:function(){e(n),t.collectObjIdHandlers.delete(i)}}}},e.prototype.assign=function(e,t,n){for(var i=this,s=t.slice(0),r=function(){var t=s.shift();!t.alias&&~o.polyfillApi.indexOf(t.prop)&&s.push(__assign(__assign({},t),{alias:t.prop+"Async"})),Object.defineProperty(e,t.alias||t.prop,{get:function(){var s=1===t.cache,r=s&&e["__"+t.prop+"CacheValue"];if(!r){var o=i.getError(),a=i.createObjId(s),c=function(){for(var s,r=[],a=0;a=0?(t.then=null,t.catch=null,c.then(function(){e(t)}).catch(function(e){return n(e)})):c.then(e,n)},t.catch=function(e){return c.catch(e)},t.Destroy=function(){return this.apiChannel(this.prefix+"free",{objId:t.objId},"")}},e.prototype.handleSendApiChannel=function(e){var t=e[0],n=e[1];"function"==typeof(t=__assign({},t)).data&&(t.data=t.data()),n(),this.sendMsgToWps(t)},e.prototype.setterCallbackSubscribe=function(e){return __awaiter(this,void 0,void 0,function(){var t,n,i,s,r,o,a,c,l,u;return __generator(this,function(d){switch(d.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.eventName,i=t.callbackId,s=t.data,i&&(r=this.setterCallbacks.idMap[i])?(o=r.split(":"),a=o[0],c=o[1],n===this.prefix+"callback"&&this.setterCallbacks[a]&&this.setterCallbacks[a][c]?[4,(u=this.setterCallbacks[a][c]).callback.apply(u,s.args)]:[3,2]):[3,2]):[2];case 1:l=d.sent(),this.sendMsgToWps({result:l,callbackId:i,eventName:this.prefix+"callback.reply"}),d.label=2;case 2:return[2]}})})},e.prototype.reduceArgs=function(e){return __awaiter(this,void 0,void 0,function(){var t,n,i,s,r,o,a,c,l,u,d;return __generator(this,function(f){switch(f.label){case 0:t={},n=[],i=e.slice(0),f.label=1;case 1:return i.length?(s=void 0,[4,i.shift()]):[3,13];case 2:return(r=f.sent())&&r.done?[4,r.done()]:[3,4];case 3:f.sent(),f.label=4;case 4:if(!isPlainObject(s))return[3,11];for(a in s={},o=[],r)o.push(a);c=0,f.label=5;case 5:return c>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var WebOfficeSDK=function(){function e(t){var n=this;this.id=0,this.origin="",this.originWhiteList=[],this.realOrigin="",this.iframeWH=null,this.cbConfigsSub={},this.readyEventNames=[{event:"ready",callback:function(){n.handleBaseReady()},after:!0},{event:"open.result"},{event:"api.ready",callback:function(){for(var e=[],t=0;t=0?"&":"?")+c.join("&")),l},e.prototype.handleCommandBarsConfig=function(e,t){void 0===t&&(t=!0);var n=e.map(function(e){var t=e.attributes;if(!Array.isArray(t)){var n=[];for(var i in t)if(t.hasOwnProperty(i)){var s={name:i,value:t[i]};n.push(s)}e.attributes=n}return e});return t&&this.sendMsgToWps({data:n,eventName:"setCommandBars"}),n},e.prototype.sendMsgToWps=function(e){var t,n,i=__assign(__assign({},e),{sdkInstanceId:this.instanceId});null===(n=null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)||void 0===n||n.postMessage(JSON.stringify(i),this.realOrigin)},e.prototype.makeReady=function(e){var t=this,n=e.event,i=e.callback,s=e.after;return new Promise(function(e){var r=function(o){if(t.realOrigin=o.origin,t.originWhiteList.includes(o.origin)||t.origin===o.origin){var a=t.message.parse(o.data),c=a.eventName,l=a.data,u=a.sdkInstanceId;if(!t.isOtherEvent(u)&&c===n){var d=void 0;!s&&i&&(d=i(l)),e(d),s&&i&&i(l),"ready"!==n&&t.message.remove(r)}}};t.message.add(r)})},e.prototype.getId=function(){return this.id+=1,this.instanceId+"-"+this.id},e.instanceId=1,e}(),CommonApiMaps={executeCommandBar:"ExecuteCommandBar",off:"Off",save:"Save",setCommandBars:"SetCommandBars",setCooperUserColor:"SetCooperUserColor",tabs:"Tabs",Stack:"Stack",WhenStacksEmpty:"WhenStacksEmpty"};function ProxyTabs(e){var t=this;return{switchTab:function(n){return __awaiter(t,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.SwitchTab(n.tabKey)];case 2:return[2,t.sent()]}})})},getTabs:function(){return __awaiter(t,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.GetTabs()];case 2:return[2,t.sent()]}})})}}}function CompatibleProxy(e,t){var n=this;return void 0===t&&(t={}),new Proxy(e,__assign(__assign({},{get:function(e,t){if(Object.keys(CommonApiMaps).includes(t)){var i=CommonApiMaps[t];return"Tabs"===i?ProxyTabs(e):e.CommonApi?Reflect.get(e.CommonApi,i):function(){return __awaiter(n,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:return[4,e.commonApiReady()];case 1:return n.sent(),[4,e.commonApiPromise];case 2:return n.sent(),"function"!=typeof e.CommonApi[i]?[3,4]:[4,e.CommonApi[i]()];case 3:return t=n.sent(),[3,5];case 4:t=e.CommonApi[i],n.label=5;case 5:return[2,t]}})})}}return Reflect.get(e,t)},set:function(e,t,n){return!!Reflect.has(e,t)&&Reflect.set(e,t,n)}}),t))}function addHooksFun(e,t){return __awaiter(this,void 0,void 0,function(){var n,i,s,r;return __generator(this,function(o){switch(o.label){case 0:return[4,e.commonApiReady()];case 1:for(i in o.sent(),n=[],t)n.push(i);s=0,o.label=2;case 2:if(!(s0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0&&this.HANDLE_LIST.splice(t,1),window.removeEventListener("message",e,!1)},e.prototype.empty=function(){for(;this.HANDLE_LIST.length;){var e=this.HANDLE_LIST.shift();window.removeEventListener("message",e,!1)}},e.prototype.parse=function(e){try{return"object"==typeof e?e:e?JSON.parse(e):e}catch(t){return e}},e}(),p=function(){function e(e,t){var n=this;this.collectObjIdHandlers=new Set,this.polyfillApi=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"],this.getId=function(){return""},this.setterCallbacks={idMap:{}},this.sendMsgToWps=function(){},this.objId=0,this.origin="",this.apiChannel=function(e,t,i,r){return a(n,void 0,void 0,function(){var n,s,o,l,u,d,h,f,p,m=this;return c(this,function(v){switch(v.label){case 0:return n=this.getId(),l=new Promise(function(e,t){s=e,o=t}),u={},t.args?[4,this.reduceArgs(t.args)]:[3,2];case 1:d=v.sent(),h=d[0],f=d[1],t.args=h,u=f,v.label=2;case 2:return e!==this.prefix+"setter"?[3,4]:[4,this.handleApiSetter(t)];case 3:v.sent(),v.label=4;case 4:return p=function(){var t=function(l){return a(m,void 0,void 0,function(){var a,d,h;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(l.origin)||this.origin===l.origin?(a=this.message.parse(l.data)).eventName===this.prefix+"callback"&&a.callbackId&&u[a.callbackId]?[4,u[a.callbackId].apply(u,a.data.args)]:[3,2]:[2];case 1:d=c.sent(),this.sendMsgToWps({result:d,eventName:this.prefix+"callback.reply",callbackId:a.callbackId}),c.label=2;case 2:return a.eventName===e+".reply"&&a.msgId===n&&(a.error?((h=new Error("")).stack=a.error+"\n"+i,r&&r(),o(h)):s(a.result),this.message.remove(t)),[2]}})})};return m.message.add(t),l},this.handleSendApiChannel([{eventName:e,data:t,msgId:n},p]),[2,l]}})})},this.handleApiSetter=function(e){return a(n,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,d,h=this;return c(this,function(c){switch(c.label){case 0:return t=function(){return Object.keys(h.setterCallbacks.idMap).find(function(e){return h.setterCallbacks.idMap[e]===i+":"+n})},n=e.prop,i=e.parentObjId,r=e.value,[4,this.reduceArgs([r])];case 1:return s=c.sent(),o=s[0],a=s[1],e.value=o[0],l=Object.keys(a)[0],u=this.setterCallbacks[i],null===r&&u&&u[n]&&((d=t())&&delete this.setterCallbacks.idMap[d],delete u[n],Object.keys(u).length||delete this.setterCallbacks[i],Object.keys(this.setterCallbacks.idMap).length||this.message.remove(this.setterCallbackSubscribe.bind(this))),l&&(Object.keys(this.setterCallbacks.idMap).length||this.message.add(this.setterCallbackSubscribe.bind(this)),this.setterCallbacks[i]||(this.setterCallbacks[i]={}),this.setterCallbacks[i][n]={callbackId:l,callback:a[l]},(d=t())&&delete this.setterCallbacks.idMap[d],this.setterCallbacks.idMap[l]=i+":"+n),[2]}})})},this.prefix=t,this.origin=e.origin,this.sendMsgToWps=e.sendMsgToWps.bind(e),this.getId=e.getId.bind(e),this.message=e.message,this.sdkInstanceId=e.instanceId,this.instance=e}return e.prototype.destroyApplication=function(){this.collectObjIdHandlers=new Set,this.objId=0},e.prototype.subEventHandle=function(e,t){var n=this,i={};this.message.add(function(e){return a(n,void 0,void 0,function(){var t,n,r,s,o,a;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.sdkInstanceId,t.eventName===this.prefix+"event"&&Number(n)===this.sdkInstanceId&&t.data?(r=t.data,s=r.eventName,o=r.data,(a=i[s])?[4,a(o)]:[3,2]):[3,2]):[2];case 1:c.sent(),c.label=2;case 2:return[2]}})})});var r=function(r){var s=t[r];Object.defineProperty(e,s,{set:function(e){i[s]=e,n.sendMsgToWps({eventName:n.prefix+"event.register",data:{eventName:s,register:!!e,objId:n.objId+=1},sdkInstanceId:n.sdkInstanceId})}})};for(var s in t)r(s)},e.prototype.mixinProto=function(e,t){Object.assign(e,t)},e.prototype.makeCollectObjIdHandle=function(e){var t=this;return function(){var n=[],i=function(e){n.push(e)};return t.collectObjIdHandlers.add(i),{End:function(){e(n),t.collectObjIdHandlers.delete(i)}}}},e.prototype.assign=function(e,t,n){for(var i=this,r=t.slice(0),s=function(){var t=r.shift();!t.alias&&~a.polyfillApi.indexOf(t.prop)&&r.push(o(o({},t),{alias:t.prop+"Async"})),Object.defineProperty(e,t.alias||t.prop,{get:function(){var r=1===t.cache,s=r&&e["__"+t.prop+"CacheValue"];if(!s){var o=i.getError(),a=i.createObjId(r),c=function(){for(var r,s=[],a=0;a=0?(t.then=null,t.catch=null,c.then(function(){e(t)}).catch(function(e){return n(e)})):c.then(e,n)},t.catch=function(e){return c.catch(e)},t.Destroy=function(){return this.apiChannel(this.prefix+"free",{objId:t.objId},"")}},e.prototype.handleSendApiChannel=function(e){var t=e[0],n=e[1];"function"==typeof(t=o({},t)).data&&(t.data=t.data()),n(),this.sendMsgToWps(t)},e.prototype.setterCallbackSubscribe=function(e){return a(this,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,d;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.eventName,i=t.callbackId,r=t.data,i&&(s=this.setterCallbacks.idMap[i])?(o=s.split(":"),a=o[0],l=o[1],n===this.prefix+"callback"&&this.setterCallbacks[a]&&this.setterCallbacks[a][l]?[4,(d=this.setterCallbacks[a][l]).callback.apply(d,r.args)]:[3,2]):[3,2]):[2];case 1:u=c.sent(),this.sendMsgToWps({result:u,callbackId:i,eventName:this.prefix+"callback.reply"}),c.label=2;case 2:return[2]}})})},e.prototype.reduceArgs=function(e){return a(this,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,h,f;return c(this,function(c){switch(c.label){case 0:t={},n=[],i=e.slice(0),c.label=1;case 1:return i.length?(r=void 0,[4,i.shift()]):[3,13];case 2:return(s=c.sent())&&s.done?[4,s.done()]:[3,4];case 3:c.sent(),c.label=4;case 4:if(!d(r))return[3,11];for(a in r={},o=[],s)o.push(a);l=0,c.label=5;case 5:return l>>0,1)},emit:function(e,t){(n[e]||[]).slice().map(function(e){e(t)}),(n["*"]||[]).slice().map(function(n){n(e,t)})}}),this.handleConfig(t)}return e.config=function(t){return void 0===t&&(t={}),e.singleInstance||(e.singleInstance=new e(t)),e.singleInstance},e.prototype.setToken=function(e){return a(this,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,this.basicReady()];case 1:return t.sent(),this.tokenData=e,this.sendMsgToWps({eventName:"setToken",data:e}),[2]}})})},e.prototype.advancedApiReady=function(){return a(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.flag.advancedApiReadySendedJust?[3,2]:(this.flag.advancedApiReadySendedJust=!0,[4,this.fileOpenPromise]);case 1:e.sent(),this.flag.advancedApiReadySended||(this.flag.advancedApiReadySended=!0,this.sendMsgToWps({eventName:"api.ready"})),e.label=2;case 2:return[4,this.advancedReadyPromise];case 3:return[2,e.sent()]}})})},e.prototype.commonApiReady=function(){return a(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.flag.commonApiReadySendedJust?[3,2]:(this.flag.commonApiReadySendedJust=!0,[4,this.basicReady()]);case 1:e.sent(),this.flag.commonApiReadySended||(this.flag.commonApiReadySended=!0,this.sendMsgToWps({eventName:"commonApi.ready"})),e.label=2;case 2:return[4,this.commonApiPromise];case 3:return[2,e.sent()]}})})},e.prototype.destroy=function(){this.iframeInstance.destroy(),this.message.empty(),this.destroyApplication&&this.destroyApplication(),this.destroyCommonApp&&this.destroyCommonApp(),this.removeFullscreenEventListener()},e.prototype.on=function(e,t){return a(this,void 0,void 0,function(){var n;return c(this,function(i){switch(i.label){case 0:return[4,this.basicReady()];case 1:return i.sent(),n=e,"fullscreenChange"===e&&(n="fullscreenchange"),this.handleBasicEvent(n,"on"),this.mittInstance.on(e,t),[2]}})})},e.prototype.off=function(e,t){return a(this,void 0,void 0,function(){return c(this,function(n){switch(n.label){case 0:return[4,this.basicReady()];case 1:return n.sent(),this.handleBasicEvent(e,"off"),this.mittInstance.off(e,t),[2]}})})},e.prototype.handleConfig=function(e){var t,n=this;void 0===e&&(e={});try{var i=this.userConfHandler(e),r=i.subscriptions,s=void 0===r?{}:r,o=i.mount,a=void 0===o?null:o,c=i.url,l=i.originWhiteList;this.origin=(c.match(/https*:\/\/[^\/]+/g)||[])[0],this.originWhiteList=l||[];var u=this.readyEventNames.map(function(e){return n.makeReady(e)}),d=u[0],f=u[1],p=u[2],m=u[3];this.baseReadyPromise=d,this.fileOpenPromise=f,this.advancedReadyPromise=p,this.commonApiPromise=m,this.iframeWH=a?{width:a.clientWidth+"px",height:a.clientHeight+"px"}:{width:"100vw",height:"100vh"},delete i.mount,c&&delete i.url,this.url=c,delete i.subscriptions,this.sdkConfig=i,this.iframeInstance=new h(this,this.instanceId,c,a,null===(t=i.isListenResize)||void 0===t||t,!1,{allow:i.attrAllow}),this.iframe=this.iframeInstance.iframe,this.listener(s)}catch(e){return console.error(e),null}},e.prototype.listener=function(e){var t=this;this.message.add(function(n){return a(t,void 0,void 0,function(){var t,i,r,s,o,a,l,u,d;return c(this,function(c){return t=this.message.parse(n.data),i=t.eventName,r=void 0===i?"":i,s=t.data,o=void 0===s?null:s,a=t.url,l=void 0===a?null:a,u=t.sdkInstanceId,this.isOtherEvent(u)?[2]:-1!==["wps.jssdk.api"].indexOf(r)?[2]:((d=this.handleListenEvent(r,o))?d():Object.keys(this.onEventNames).includes(r)&&("open.result"===r&&(this.officeType=o.fileInfo.officeType),this.mittInstance.emit(this.onEventNames[r],o)),"function"==typeof e[r]&&e[r](this,l||o),[2])})})})},e.prototype.handleListenEvent=function(e,t){var i,r=this;return((i={"api.scroll":function(){return window.scrollTo(t.x,t.y)},"event.callback":function(){return a(r,void 0,void 0,function(){var e,n,i,r,s,o,a;return c(this,function(c){return e=t.eventName,n=t.data,i=e,"fullScreenChange"===e&&(i="fullscreenChange"),((null===(o=this.sdkConfig.commonOptions)||void 0===o?void 0:o.isBrowserViewFullscreen)||(null===(a=this.sdkConfig.commonOptions)||void 0===a?void 0:a.isParentFullscreen))&&"fullscreenchange"===i&&(r=n.status,s=n.isDispatchEvent,this.sdkConfig.commonOptions.isBrowserViewFullscreen?this.iframeWH&&function(e,t,n,i){0===e?t.style="position: static; width: "+n.width+"; height: "+n.height:1===e&&(t.style="position: absolute; width: 100%; height: 100%"),i&&function(e){["fullscreen","fullscreenElement"].forEach(function(t){Object.defineProperty(document,t,{get:function(){return!!e.status},configurable:!0})});var t=new CustomEvent("fullscreenchange");document.dispatchEvent(t)}({status:e})}(r,this.iframe,this.iframeWH,s):this.sdkConfig.commonOptions.isParentFullscreen&&function(e,t){if(0===e){var n=document,i=n.exitFullscreen||n.mozCancelFullScreen||n.msExitFullscreen||n.webkitCancelFullScreen||n.webkitExitFullscreen;i.call(document)}else if(1===e){var r=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen;r.call(t)}}(r,this.iframe)),this.mittInstance.emit(i,n),[2]})})}})[n.refreshToken]=function(){return a(r,void 0,void 0,function(){var t,n;return c(this,function(i){switch(i.label){case 0:t={token:!1},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.cbConfigsSub.refreshToken()];case 2:return t=i.sent(),[3,4];case 3:return n=i.sent(),console.error("refreshToken: "+(n||"fail to get")),[3,4];case 4:return this.sendMsgToWps({eventName:e+".reply",data:t}),[2]}})})},i)[e]},e.prototype.basicReady=function(){return this.baseReadyPromise},e.prototype.userConfHandler=function(e,t){var i=this;void 0===t&&(t=!0);var s=o({},e),a=s.headers,c=void 0===a?{}:a,l=s.subscriptions,u=void 0===l?{}:l,d=s.commonOptions,h=s.url,f=void 0===h?"":h,p=s.wpsUrl,m=void 0===p?"":p,v=s.mode,b=void 0===v?r.nomal:v,g=s.debug,y=s.disablePlugins,w=s.hideGuide,k=s.readOnly;return Object.assign(s,this.handleHeadersAndSubscriptionsConfig(c,u,t)),s.url=this.handleUrlConfig(d,b,g,f,m,y,w,k),d&&(d.isParentFullscreen||d.isBrowserViewFullscreen)&&document.addEventListener("fullscreenchange",this.handleFullscreenChange),this.polyfillConfigName.map(function(e){var t=e[0],n=e[1];s[n]&&(s[t]=s[n])}),this.cbConfigs.map(function(e){var t,r,o=s[e];o&&(t=o,r="Function",{}.toString.call(t)==="[object "+r+"]")&&(i.cbConfigsSub[e]=o,s[e]={eventName:n[e]})}),s.commandBars&&this.handleCommandBarsConfig(s.commandBars,!1),o({},s)},e.prototype.handleBasicEvent=function(e,t){if(!["error","fileOpen"].includes(e)){var n={eventName:"basic.event",data:{eventName:e,action:t}};this.sendMsgToWps(n)}},e.prototype.removeFullscreenEventListener=function(){document.removeEventListener("fullscreenchange",this.handleFullscreenChange)},e.prototype.handleHeadersAndSubscriptionsConfig=function(e,t,n){var i=e.backBtn,r=void 0===i?{}:i,s=e.shareBtn,o=void 0===s?{}:s,a=e.otherMenuBtn,c=void 0===a?{}:a,l=[["wpsconfig_back_btn",r],["wpsconfig_share_btn",o],["wpsconfig_other_menu_btn",c]],u=[];return c.items&&Array.isArray(c.items)&&c.items.forEach(function(e,t){void 0===e&&(e={}),"custom"===e.type&&u.push(["wpsconfig_other_menu_btn_"+t,e])}),l.concat(u).forEach(function(e){var i,r;i=e[1],r=e[0],i.subscribe&&"function"==typeof i.subscribe&&(i.callback=r,t[r]=i.subscribe,n&&delete i.subscribe)}),{}},e.prototype.handleUrlConfig=function(e,t,n,i,s,o,a,c){var l=[];l.push("sdkId="+this.instanceId),t===r.simple||e&&!1===e.isShowTopArea?l.push("simple","hidecmb"):t===r.embed&&l.push("simple=1","hidecmb=1","embed=1"),o&&l.push("disablePlugins"),a&&l.push("hideguide"),c&&l.push("readonly"),n&&l.push("debugger");var u=i||s;return u&&l.length&&(u=u+(u.indexOf("?")>=0?"&":"?")+l.join("&")),u},e.prototype.handleCommandBarsConfig=function(e,t){void 0===t&&(t=!0);var n=e.map(function(e){var t=e.attributes;if(!Array.isArray(t)){var n=[];for(var i in t)if(t.hasOwnProperty(i)){var r={name:i,value:t[i]};n.push(r)}e.attributes=n}return e});return t&&this.sendMsgToWps({data:n,eventName:"setCommandBars"}),n},e.prototype.sendMsgToWps=function(e){var t,n,i=o(o({},e),{sdkInstanceId:this.instanceId});null===(n=null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)||void 0===n||n.postMessage(JSON.stringify(i),this.realOrigin)},e.prototype.makeReady=function(e){var t=this,n=e.event,i=e.callback,r=e.after;return new Promise(function(e){var s=function(o){if(t.realOrigin=o.origin,t.originWhiteList.includes(o.origin)||t.origin===o.origin){var a=t.message.parse(o.data),c=a.eventName,l=a.data,u=a.sdkInstanceId;if(!t.isOtherEvent(u)&&c===n){var d=void 0;!r&&i&&(d=i(l)),e(d),r&&i&&i(l),"ready"!==n&&t.message.remove(s)}}};t.message.add(s)})},e.prototype.getId=function(){return this.id+=1,this.instanceId+"-"+this.id},e.instanceId=1,e}(),g={executeCommandBar:"ExecuteCommandBar",off:"Off",save:"Save",setCommandBars:"SetCommandBars",setCooperUserColor:"SetCooperUserColor",tabs:"Tabs",Stack:"Stack",WhenStacksEmpty:"WhenStacksEmpty"};function y(e,t){var n=this;return void 0===t&&(t={}),new Proxy(e,o(o({},{get:function(e,t){if(Object.keys(g).includes(t)){var i=g[t];return"Tabs"===i?function(e){var t=this;return{switchTab:function(n){return a(t,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.SwitchTab(n.tabKey)];case 2:return[2,t.sent()]}})})},getTabs:function(){return a(t,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.GetTabs()];case 2:return[2,t.sent()]}})})}}}(e):e.CommonApi?Reflect.get(e.CommonApi,i):function(){return a(n,void 0,void 0,function(){var t;return c(this,function(n){switch(n.label){case 0:return[4,e.commonApiReady()];case 1:return n.sent(),[4,e.commonApiPromise];case 2:return n.sent(),"function"!=typeof e.CommonApi[i]?[3,4]:[4,e.CommonApi[i]()];case 3:return t=n.sent(),[3,5];case 4:t=e.CommonApi[i],n.label=5;case 5:return[2,t]}})})}}return Reflect.get(e,t)},set:function(e,t,n){return!!Reflect.has(e,t)&&Reflect.set(e,t,n)}}),t))}var w;!function(e){e.Spreadsheet="s",e.Writer="w",e.Presentation="p",e.Pdf="f",e.Otl="o",e.Dbt="d",e.KSheet="k"}(w||(w={}));var k=function(e){function n(t){var n=e.call(this,t)||this;return t.token&&(d(t.token)?n.setToken(o({},t.token)):n.setToken({token:t.token})),n.ApiEvent={AddApiEventListener:function(e,t){n.on(e,t)},RemoveApiEventListener:function(e,t){n.off(e,t)}},n}return t(n,e),n.init=function(e){var t=o({},e);if(t.endpoint=t.endpoint||"https://o.wpsgo.com","string"==typeof t.mount){var i=document.querySelector(t.mount);i?t.mount=i:(console.warn("[WebOfficeSDK.init] mount挂载节点未找到"),delete t.mount)}if(t.url)throw Error("[WebOfficeSDK.init] 不支持传递url,请使用appId、fileId、officeType、token等参数初始化!");if(!t.appId||!t.fileId||!t.officeType)throw Error("[WebOfficeSDK.init] appId、fileId、officeType为必选项!");if("string"!=typeof t.endpoint)throw Error("[WebOfficeSDK.init] endpoint期望为字符串");if(t.endpoint&&!t.endpoint.startsWith("http"))throw Error("[WebOfficeSDK.init] endpoint仅支持http、https的地址");var r=new n(function(e){var t=o({},e);t.token=t.token||t.fileToken;var n=t.appId,i=t.fileId,r=t.officeType,s=t.token,a=t.endpoint,c=t.customArgs,l=void 0===c?"":c;if(!Object.values(w).includes(r))throw Error("[WebOfficeSDK.init] officeType属性值错误,可选值参考WebOfficeSDK.OfficeType: "+JSON.stringify(w));var u=s?1:0,h={token:""};if("string"==typeof s?h.token=s:d(s)&&(h=o({tokenData:h},s)),u&&!h.token)return console.error("[WebOfficeSDK.init] token设置无效"),t;if(t.url=a+"/office/"+r+"/"+i+"?_w_appid="+n+"&_w_tokentype="+u,d(l)){var f=Object.entries(l).map(function(e){var t=e[0],n=e[1];return t+"="+encodeURIComponent(n)}).join("&");t.url=t.url+"&"+f}return o({},t)}(t));return function(e,t){a(this,void 0,void 0,function(){var n,i,r,s;return c(this,function(o){switch(o.label){case 0:return[4,e.commonApiReady()];case 1:for(i in o.sent(),n=[],t)n.push(i);r=0,o.label=2;case 2:if(!(r0&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0&&this.HANDLE_LIST.splice(t,1),window.removeEventListener("message",e,!1)},e.prototype.empty=function(){for(;this.HANDLE_LIST.length;){var e=this.HANDLE_LIST.shift();window.removeEventListener("message",e,!1)}},e.prototype.parse=function(e){try{return"object"==typeof e?e:e?JSON.parse(e):e}catch(t){return e}},e}(),p=function(){function e(e,t){var n=this;this.collectObjIdHandlers=new Set,this.polyfillApi=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"],this.getId=function(){return""},this.setterCallbacks={idMap:{}},this.sendMsgToWps=function(){},this.objId=0,this.origin="",this.apiChannel=function(e,t,i,r){return a(n,void 0,void 0,function(){var n,s,o,l,u,d,h,f,p,m=this;return c(this,function(v){switch(v.label){case 0:return n=this.getId(),l=new Promise(function(e,t){s=e,o=t}),u={},t.args?[4,this.reduceArgs(t.args)]:[3,2];case 1:d=v.sent(),h=d[0],f=d[1],t.args=h,u=f,v.label=2;case 2:return e!==this.prefix+"setter"?[3,4]:[4,this.handleApiSetter(t)];case 3:v.sent(),v.label=4;case 4:return p=function(){var t=function(l){return a(m,void 0,void 0,function(){var a,d,h;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(l.origin)||this.origin===l.origin?(a=this.message.parse(l.data)).eventName===this.prefix+"callback"&&a.callbackId&&u[a.callbackId]?[4,u[a.callbackId].apply(u,a.data.args)]:[3,2]:[2];case 1:d=c.sent(),this.sendMsgToWps({result:d,eventName:this.prefix+"callback.reply",callbackId:a.callbackId}),c.label=2;case 2:return a.eventName===e+".reply"&&a.msgId===n&&(a.error?((h=new Error("")).stack=a.error+"\n"+i,r&&r(),o(h)):s(a.result),this.message.remove(t)),[2]}})})};return m.message.add(t),l},this.handleSendApiChannel([{eventName:e,data:t,msgId:n},p]),[2,l]}})})},this.handleApiSetter=function(e){return a(n,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,d,h=this;return c(this,function(c){switch(c.label){case 0:return t=function(){return Object.keys(h.setterCallbacks.idMap).find(function(e){return h.setterCallbacks.idMap[e]===i+":"+n})},n=e.prop,i=e.parentObjId,r=e.value,[4,this.reduceArgs([r])];case 1:return s=c.sent(),o=s[0],a=s[1],e.value=o[0],l=Object.keys(a)[0],u=this.setterCallbacks[i],null===r&&u&&u[n]&&((d=t())&&delete this.setterCallbacks.idMap[d],delete u[n],Object.keys(u).length||delete this.setterCallbacks[i],Object.keys(this.setterCallbacks.idMap).length||this.message.remove(this.setterCallbackSubscribe.bind(this))),l&&(Object.keys(this.setterCallbacks.idMap).length||this.message.add(this.setterCallbackSubscribe.bind(this)),this.setterCallbacks[i]||(this.setterCallbacks[i]={}),this.setterCallbacks[i][n]={callbackId:l,callback:a[l]},(d=t())&&delete this.setterCallbacks.idMap[d],this.setterCallbacks.idMap[l]=i+":"+n),[2]}})})},this.prefix=t,this.origin=e.origin,this.sendMsgToWps=e.sendMsgToWps.bind(e),this.getId=e.getId.bind(e),this.message=e.message,this.sdkInstanceId=e.instanceId,this.instance=e}return e.prototype.destroyApplication=function(){this.collectObjIdHandlers=new Set,this.objId=0},e.prototype.subEventHandle=function(e,t){var n=this,i={};this.message.add(function(e){return a(n,void 0,void 0,function(){var t,n,r,s,o,a;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.sdkInstanceId,t.eventName===this.prefix+"event"&&Number(n)===this.sdkInstanceId&&t.data?(r=t.data,s=r.eventName,o=r.data,(a=i[s])?[4,a(o)]:[3,2]):[3,2]):[2];case 1:c.sent(),c.label=2;case 2:return[2]}})})});var r=function(r){var s=t[r];Object.defineProperty(e,s,{set:function(e){i[s]=e,n.sendMsgToWps({eventName:n.prefix+"event.register",data:{eventName:s,register:!!e,objId:n.objId+=1},sdkInstanceId:n.sdkInstanceId})}})};for(var s in t)r(s)},e.prototype.mixinProto=function(e,t){Object.assign(e,t)},e.prototype.makeCollectObjIdHandle=function(e){var t=this;return function(){var n=[],i=function(e){n.push(e)};return t.collectObjIdHandlers.add(i),{End:function(){e(n),t.collectObjIdHandlers.delete(i)}}}},e.prototype.assign=function(e,t,n){for(var i=this,r=t.slice(0),s=function(){var t=r.shift();!t.alias&&~a.polyfillApi.indexOf(t.prop)&&r.push(o(o({},t),{alias:t.prop+"Async"})),Object.defineProperty(e,t.alias||t.prop,{get:function(){var r=1===t.cache,s=r&&e["__"+t.prop+"CacheValue"];if(!s){var o=i.getError(),a=i.createObjId(r),c=function(){for(var r,s=[],a=0;a=0?(t.then=null,t.catch=null,c.then(function(){e(t)}).catch(function(e){return n(e)})):c.then(e,n)},t.catch=function(e){return c.catch(e)},t.Destroy=function(){return this.apiChannel(this.prefix+"free",{objId:t.objId},"")}},e.prototype.handleSendApiChannel=function(e){var t=e[0],n=e[1];"function"==typeof(t=o({},t)).data&&(t.data=t.data()),n(),this.sendMsgToWps(t)},e.prototype.setterCallbackSubscribe=function(e){return a(this,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,d;return c(this,function(c){switch(c.label){case 0:return this.instance.originWhiteList.includes(e.origin)||this.origin===e.origin?(t=this.message.parse(e.data),n=t.eventName,i=t.callbackId,r=t.data,i&&(s=this.setterCallbacks.idMap[i])?(o=s.split(":"),a=o[0],l=o[1],n===this.prefix+"callback"&&this.setterCallbacks[a]&&this.setterCallbacks[a][l]?[4,(d=this.setterCallbacks[a][l]).callback.apply(d,r.args)]:[3,2]):[3,2]):[2];case 1:u=c.sent(),this.sendMsgToWps({result:u,callbackId:i,eventName:this.prefix+"callback.reply"}),c.label=2;case 2:return[2]}})})},e.prototype.reduceArgs=function(e){return a(this,void 0,void 0,function(){var t,n,i,r,s,o,a,l,u,h,f;return c(this,function(c){switch(c.label){case 0:t={},n=[],i=e.slice(0),c.label=1;case 1:return i.length?(r=void 0,[4,i.shift()]):[3,13];case 2:return(s=c.sent())&&s.done?[4,s.done()]:[3,4];case 3:c.sent(),c.label=4;case 4:if(!d(r))return[3,11];for(a in r={},o=[],s)o.push(a);l=0,c.label=5;case 5:return l>>0,1)},emit:function(e,t){(n[e]||[]).slice().map(function(e){e(t)}),(n["*"]||[]).slice().map(function(n){n(e,t)})}}),this.handleConfig(t)}return e.config=function(t){return void 0===t&&(t={}),e.singleInstance||(e.singleInstance=new e(t)),e.singleInstance},e.prototype.setToken=function(e){return a(this,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,this.basicReady()];case 1:return t.sent(),this.tokenData=e,this.sendMsgToWps({eventName:"setToken",data:e}),[2]}})})},e.prototype.advancedApiReady=function(){return a(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.flag.advancedApiReadySendedJust?[3,2]:(this.flag.advancedApiReadySendedJust=!0,[4,this.fileOpenPromise]);case 1:e.sent(),this.flag.advancedApiReadySended||(this.flag.advancedApiReadySended=!0,this.sendMsgToWps({eventName:"api.ready"})),e.label=2;case 2:return[4,this.advancedReadyPromise];case 3:return[2,e.sent()]}})})},e.prototype.commonApiReady=function(){return a(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.flag.commonApiReadySendedJust?[3,2]:(this.flag.commonApiReadySendedJust=!0,[4,this.basicReady()]);case 1:e.sent(),this.flag.commonApiReadySended||(this.flag.commonApiReadySended=!0,this.sendMsgToWps({eventName:"commonApi.ready"})),e.label=2;case 2:return[4,this.commonApiPromise];case 3:return[2,e.sent()]}})})},e.prototype.destroy=function(){this.iframeInstance.destroy(),this.message.empty(),this.destroyApplication&&this.destroyApplication(),this.destroyCommonApp&&this.destroyCommonApp(),this.removeFullscreenEventListener()},e.prototype.on=function(e,t){return a(this,void 0,void 0,function(){var n;return c(this,function(i){switch(i.label){case 0:return[4,this.basicReady()];case 1:return i.sent(),n=e,"fullscreenChange"===e&&(n="fullscreenchange"),this.handleBasicEvent(n,"on"),this.mittInstance.on(e,t),[2]}})})},e.prototype.off=function(e,t){return a(this,void 0,void 0,function(){return c(this,function(n){switch(n.label){case 0:return[4,this.basicReady()];case 1:return n.sent(),this.handleBasicEvent(e,"off"),this.mittInstance.off(e,t),[2]}})})},e.prototype.handleConfig=function(e){var t,n=this;void 0===e&&(e={});try{var i=this.userConfHandler(e),r=i.subscriptions,s=void 0===r?{}:r,o=i.mount,a=void 0===o?null:o,c=i.url,l=i.originWhiteList;this.origin=(c.match(/https*:\/\/[^\/]+/g)||[])[0],this.originWhiteList=l||[];var u=this.readyEventNames.map(function(e){return n.makeReady(e)}),d=u[0],f=u[1],p=u[2],m=u[3];this.baseReadyPromise=d,this.fileOpenPromise=f,this.advancedReadyPromise=p,this.commonApiPromise=m,this.iframeWH=a?{width:a.clientWidth+"px",height:a.clientHeight+"px"}:{width:"100vw",height:"100vh"},delete i.mount,c&&delete i.url,this.url=c,delete i.subscriptions,this.sdkConfig=i,this.iframeInstance=new h(this,this.instanceId,c,a,null===(t=i.isListenResize)||void 0===t||t,!1,{allow:i.attrAllow}),this.iframe=this.iframeInstance.iframe,this.listener(s)}catch(e){return console.error(e),null}},e.prototype.listener=function(e){var t=this;this.message.add(function(n){return a(t,void 0,void 0,function(){var t,i,r,s,o,a,l,u,d;return c(this,function(c){return t=this.message.parse(n.data),i=t.eventName,r=void 0===i?"":i,s=t.data,o=void 0===s?null:s,a=t.url,l=void 0===a?null:a,u=t.sdkInstanceId,this.isOtherEvent(u)?[2]:-1!==["wps.jssdk.api"].indexOf(r)?[2]:((d=this.handleListenEvent(r,o))?d():Object.keys(this.onEventNames).includes(r)&&("open.result"===r&&(this.officeType=o.fileInfo.officeType),this.mittInstance.emit(this.onEventNames[r],o)),"function"==typeof e[r]&&e[r](this,l||o),[2])})})})},e.prototype.handleListenEvent=function(e,t){var i,r=this;return((i={"api.scroll":function(){return window.scrollTo(t.x,t.y)},"event.callback":function(){return a(r,void 0,void 0,function(){var e,n,i,r,s,o,a;return c(this,function(c){return e=t.eventName,n=t.data,i=e,"fullScreenChange"===e&&(i="fullscreenChange"),((null===(o=this.sdkConfig.commonOptions)||void 0===o?void 0:o.isBrowserViewFullscreen)||(null===(a=this.sdkConfig.commonOptions)||void 0===a?void 0:a.isParentFullscreen))&&"fullscreenchange"===i&&(r=n.status,s=n.isDispatchEvent,this.sdkConfig.commonOptions.isBrowserViewFullscreen?this.iframeWH&&function(e,t,n,i){0===e?t.style="position: static; width: "+n.width+"; height: "+n.height:1===e&&(t.style="position: absolute; width: 100%; height: 100%"),i&&function(e){["fullscreen","fullscreenElement"].forEach(function(t){Object.defineProperty(document,t,{get:function(){return!!e.status},configurable:!0})});var t=new CustomEvent("fullscreenchange");document.dispatchEvent(t)}({status:e})}(r,this.iframe,this.iframeWH,s):this.sdkConfig.commonOptions.isParentFullscreen&&function(e,t){if(0===e){var n=document,i=n.exitFullscreen||n.mozCancelFullScreen||n.msExitFullscreen||n.webkitCancelFullScreen||n.webkitExitFullscreen;i.call(document)}else if(1===e){var r=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen;r.call(t)}}(r,this.iframe)),this.mittInstance.emit(i,n),[2]})})}})[n.refreshToken]=function(){return a(r,void 0,void 0,function(){var t,n;return c(this,function(i){switch(i.label){case 0:t={token:!1},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.cbConfigsSub.refreshToken()];case 2:return t=i.sent(),[3,4];case 3:return n=i.sent(),console.error("refreshToken: "+(n||"fail to get")),[3,4];case 4:return this.sendMsgToWps({eventName:e+".reply",data:t}),[2]}})})},i)[e]},e.prototype.basicReady=function(){return this.baseReadyPromise},e.prototype.userConfHandler=function(e,t){var i=this;void 0===t&&(t=!0);var s=o({},e),a=s.headers,c=void 0===a?{}:a,l=s.subscriptions,u=void 0===l?{}:l,d=s.commonOptions,h=s.url,f=void 0===h?"":h,p=s.wpsUrl,m=void 0===p?"":p,v=s.mode,b=void 0===v?r.nomal:v,g=s.debug,y=s.disablePlugins,w=s.hideGuide,k=s.readOnly;return Object.assign(s,this.handleHeadersAndSubscriptionsConfig(c,u,t)),s.url=this.handleUrlConfig(d,b,g,f,m,y,w,k),d&&(d.isParentFullscreen||d.isBrowserViewFullscreen)&&document.addEventListener("fullscreenchange",this.handleFullscreenChange),this.polyfillConfigName.map(function(e){var t=e[0],n=e[1];s[n]&&(s[t]=s[n])}),this.cbConfigs.map(function(e){var t,r,o=s[e];o&&(t=o,r="Function",{}.toString.call(t)==="[object "+r+"]")&&(i.cbConfigsSub[e]=o,s[e]={eventName:n[e]})}),s.commandBars&&this.handleCommandBarsConfig(s.commandBars,!1),o({},s)},e.prototype.handleBasicEvent=function(e,t){if(!["error","fileOpen"].includes(e)){var n={eventName:"basic.event",data:{eventName:e,action:t}};this.sendMsgToWps(n)}},e.prototype.removeFullscreenEventListener=function(){document.removeEventListener("fullscreenchange",this.handleFullscreenChange)},e.prototype.handleHeadersAndSubscriptionsConfig=function(e,t,n){var i=e.backBtn,r=void 0===i?{}:i,s=e.shareBtn,o=void 0===s?{}:s,a=e.otherMenuBtn,c=void 0===a?{}:a,l=[["wpsconfig_back_btn",r],["wpsconfig_share_btn",o],["wpsconfig_other_menu_btn",c]],u=[];return c.items&&Array.isArray(c.items)&&c.items.forEach(function(e,t){void 0===e&&(e={}),"custom"===e.type&&u.push(["wpsconfig_other_menu_btn_"+t,e])}),l.concat(u).forEach(function(e){var i,r;i=e[1],r=e[0],i.subscribe&&"function"==typeof i.subscribe&&(i.callback=r,t[r]=i.subscribe,n&&delete i.subscribe)}),{}},e.prototype.handleUrlConfig=function(e,t,n,i,s,o,a,c){var l=[];l.push("sdkId="+this.instanceId),t===r.simple||e&&!1===e.isShowTopArea?l.push("simple","hidecmb"):t===r.embed&&l.push("simple=1","hidecmb=1","embed=1"),o&&l.push("disablePlugins"),a&&l.push("hideguide"),c&&l.push("readonly"),n&&l.push("debugger");var u=i||s;return u&&l.length&&(u=u+(u.indexOf("?")>=0?"&":"?")+l.join("&")),u},e.prototype.handleCommandBarsConfig=function(e,t){void 0===t&&(t=!0);var n=e.map(function(e){var t=e.attributes;if(!Array.isArray(t)){var n=[];for(var i in t)if(t.hasOwnProperty(i)){var r={name:i,value:t[i]};n.push(r)}e.attributes=n}return e});return t&&this.sendMsgToWps({data:n,eventName:"setCommandBars"}),n},e.prototype.sendMsgToWps=function(e){var t,n,i=o(o({},e),{sdkInstanceId:this.instanceId});null===(n=null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)||void 0===n||n.postMessage(JSON.stringify(i),this.realOrigin)},e.prototype.makeReady=function(e){var t=this,n=e.event,i=e.callback,r=e.after;return new Promise(function(e){var s=function(o){if(t.realOrigin=o.origin,t.originWhiteList.includes(o.origin)||t.origin===o.origin){var a=t.message.parse(o.data),c=a.eventName,l=a.data,u=a.sdkInstanceId;if(!t.isOtherEvent(u)&&c===n){var d=void 0;!r&&i&&(d=i(l)),e(d),r&&i&&i(l),"ready"!==n&&t.message.remove(s)}}};t.message.add(s)})},e.prototype.getId=function(){return this.id+=1,this.instanceId+"-"+this.id},e.instanceId=1,e}(),g={executeCommandBar:"ExecuteCommandBar",off:"Off",save:"Save",setCommandBars:"SetCommandBars",setCooperUserColor:"SetCooperUserColor",tabs:"Tabs",Stack:"Stack",WhenStacksEmpty:"WhenStacksEmpty"};function y(e,t){var n=this;return void 0===t&&(t={}),new Proxy(e,o(o({},{get:function(e,t){if(Object.keys(g).includes(t)){var i=g[t];return"Tabs"===i?function(e){var t=this;return{switchTab:function(n){return a(t,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.SwitchTab(n.tabKey)];case 2:return[2,t.sent()]}})})},getTabs:function(){return a(t,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,e.commonApiReady()];case 1:return t.sent(),[4,e.CommonApi.Tabs.GetTabs()];case 2:return[2,t.sent()]}})})}}}(e):e.CommonApi?Reflect.get(e.CommonApi,i):function(){return a(n,void 0,void 0,function(){var t;return c(this,function(n){switch(n.label){case 0:return[4,e.commonApiReady()];case 1:return n.sent(),[4,e.commonApiPromise];case 2:return n.sent(),"function"!=typeof e.CommonApi[i]?[3,4]:[4,e.CommonApi[i]()];case 3:return t=n.sent(),[3,5];case 4:t=e.CommonApi[i],n.label=5;case 5:return[2,t]}})})}}return Reflect.get(e,t)},set:function(e,t,n){return!!Reflect.has(e,t)&&Reflect.set(e,t,n)}}),t))}var w;!function(e){e.Spreadsheet="s",e.Writer="w",e.Presentation="p",e.Pdf="f",e.Otl="o",e.Dbt="d",e.KSheet="k"}(w||(w={}));var k=function(e){function n(t){var n=e.call(this,t)||this;return t.token&&(d(t.token)?n.setToken(o({},t.token)):n.setToken({token:t.token})),n.ApiEvent={AddApiEventListener:function(e,t){n.on(e,t)},RemoveApiEventListener:function(e,t){n.off(e,t)}},n}return t(n,e),n.init=function(e){var t=o({},e);if(t.endpoint=t.endpoint||"https://o.wpsgo.com","string"==typeof t.mount){var i=document.querySelector(t.mount);i?t.mount=i:(console.warn("[WebOfficeSDK.init] mount挂载节点未找到"),delete t.mount)}if(t.url)throw Error("[WebOfficeSDK.init] 不支持传递url,请使用appId、fileId、officeType、token等参数初始化!");if(!t.appId||!t.fileId||!t.officeType)throw Error("[WebOfficeSDK.init] appId、fileId、officeType为必选项!");if("string"!=typeof t.endpoint)throw Error("[WebOfficeSDK.init] endpoint期望为字符串");if(t.endpoint&&!t.endpoint.startsWith("http"))throw Error("[WebOfficeSDK.init] endpoint仅支持http、https的地址");var r=new n(function(e){var t=o({},e);t.token=t.token||t.fileToken;var n=t.appId,i=t.fileId,r=t.officeType,s=t.token,a=t.endpoint,c=t.customArgs,l=void 0===c?"":c;if(!Object.values(w).includes(r))throw Error("[WebOfficeSDK.init] officeType属性值错误,可选值参考WebOfficeSDK.OfficeType: "+JSON.stringify(w));var u=s?1:0,h={token:""};if("string"==typeof s?h.token=s:d(s)&&(h=o({tokenData:h},s)),u&&!h.token)return console.error("[WebOfficeSDK.init] token设置无效"),t;if(t.url=a+"/office/"+r+"/"+i+"?_w_appid="+n+"&_w_tokentype="+u,d(l)){var f=Object.entries(l).map(function(e){var t=e[0],n=e[1];return t+"="+encodeURIComponent(n)}).join("&");t.url=t.url+"&"+f}return o({},t)}(t));return function(e,t){a(this,void 0,void 0,function(){var n,i,r,s;return c(this,function(o){switch(o.label){case 0:return[4,e.commonApiReady()];case 1:for(i in o.sent(),n=[],t)n.push(i);r=0,o.label=2;case 2:if(!(r