Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zys-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
zys-ui
Commits
b03e1a2d
提交
b03e1a2d
authored
9月 19, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试wps
上级
20ffa9e7
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
37 行增加
和
31 行删除
+37
-31
web-office-sdk-v1.1.19.es.js
public/weboffice/web-office-sdk-v1.1.19.es.js
+0
-0
web-office-sdk19.es.js
public/weboffice/web-office-sdk19.es.js
+0
-0
file.js
src/libs/qiwen/globalFunction/file.js
+9
-11
index.vue
src/views/read/wpsReader/index.vue
+28
-20
没有找到文件。
public/weboffice/web-office-sdk-v1.1.19.es.js
deleted
100644 → 0
浏览文件 @
20ffa9e7
差异被折叠。
点击展开。
public/weboffice/web-office-sdk19.es.js
0 → 100644
浏览文件 @
b03e1a2d
差异被折叠。
点击展开。
src/libs/qiwen/globalFunction/file.js
浏览文件 @
b03e1a2d
...
@@ -314,8 +314,8 @@ const fileFunction = {
...
@@ -314,8 +314,8 @@ const fileFunction = {
const
WORD
=
[
'doc'
,
'docx'
]
const
WORD
=
[
'doc'
,
'docx'
]
const
PDF
=
[
'pdf'
]
const
PDF
=
[
'pdf'
]
// 若当前点击项是word
// 若当前点击项是word
let
exten
t
Name
=
row
.
extendName
||
row
.
suffix
||
row
.
showType
let
exten
d
Name
=
row
.
extendName
||
row
.
suffix
||
row
.
showType
if
(
WORD
.
includes
(
exten
t
Name
.
toLowerCase
()))
{
if
(
WORD
.
includes
(
exten
dName
.
toLowerCase
())
||
PDF
.
includes
(
extend
Name
.
toLowerCase
()))
{
let
flag
=
false
let
flag
=
false
const
{
fileId
,
userId
,
id
}
=
row
const
{
fileId
,
userId
,
id
}
=
row
// 根据当前文件的作者的userId进行判断,和本人一致则是可编辑
// 根据当前文件的作者的userId进行判断,和本人一致则是可编辑
...
@@ -353,8 +353,8 @@ const fileFunction = {
...
@@ -353,8 +353,8 @@ const fileFunction = {
query
:
{
query
:
{
wpsUrl
:
res
.
data
.
wpsUrl
,
wpsUrl
:
res
.
data
.
wpsUrl
,
token
:
res
.
data
.
token
,
token
:
res
.
data
.
token
,
fileId
fileId
,
extendName
}
}
})
})
window
.
open
(
resolve
.
href
,
'_blank'
)
window
.
open
(
resolve
.
href
,
'_blank'
)
...
@@ -362,14 +362,12 @@ const fileFunction = {
...
@@ -362,14 +362,12 @@ const fileFunction = {
})
})
return
false
return
false
// 实际实现逻辑---end
// 实际实现逻辑---end
}
// 若当前点击项是pdf
else
if
(
PDF
.
includes
(
extentName
.
toLowerCase
()))
{
router
.
push
(
'/pdfReader'
)
return
false
}
}
// // 若当前点击项是pdf
// else if (PDF.includes(extendName.toLowerCase())) {
// router.push('/pdfReader')
// return false
// }
}
}
},
},
/**
/**
...
...
src/views/read/wpsReader/index.vue
浏览文件 @
b03e1a2d
...
@@ -5,11 +5,7 @@
...
@@ -5,11 +5,7 @@
'sidebar-open': $store.state.app.sidebar.opened,
'sidebar-open': $store.state.app.sidebar.opened,
}"
}"
>
>
<div
<div
ref=
"myIframe"
id=
"wps-container"
class=
"wps-container"
></div>
ref=
"myIframe"
id=
"wps-container"
class=
"wps-container"
></div>
<RightPanel
<RightPanel
ref=
"RightPanel"
ref=
"RightPanel"
:class=
"[
:class=
"[
...
@@ -28,7 +24,8 @@
...
@@ -28,7 +24,8 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
WebOfficeSDK
from
"/public/weboffice/web-office-sdk-v1.1.19.es"
;
import
WebOfficeSDK
from
"/public/weboffice/web-office-sdk19.es"
;
// import WebOfficeSDK from "/public/weboffice/web-office-sdk-solution-v2.0.4.es";
import
RightPanel
from
"./component/rightPanel.vue"
;
import
RightPanel
from
"./component/rightPanel.vue"
;
import
AddOrUpdateNoteDialog
from
"./component/addOrUpdateNoteDialog.vue"
;
import
AddOrUpdateNoteDialog
from
"./component/addOrUpdateNoteDialog.vue"
;
import
{
addNearRead
}
from
"@/api/user"
;
import
{
addNearRead
}
from
"@/api/user"
;
...
@@ -59,23 +56,11 @@ export default {
...
@@ -59,23 +56,11 @@ export default {
return
this
.
$store
.
state
.
app
.
sidebar
.
opened
;
return
this
.
$store
.
state
.
app
.
sidebar
.
opened
;
},
},
},
},
watch
:
{
panelVisible
(
value
)
{
debugger
// 获取office-iframe的dom并修改宽度为100vw
const
officeIframe
=
document
.
getElementById
(
"office-iframe"
);
if
(
!
value
)
{
officeIframe
.
style
.
width
=
"100vw !important"
;
}
else
{
officeIframe
.
style
.
width
=
"100% !important"
;
}
},
},
mounted
()
{
mounted
()
{
const
{
wpsUrl
,
token
,
fileId
}
=
this
.
$route
.
query
;
const
{
wpsUrl
,
token
,
fileId
}
=
this
.
$route
.
query
;
this
.
routeParams
=
{
wpsUrl
,
token
,
fileId
};
this
.
routeParams
=
{
wpsUrl
,
token
,
fileId
};
this
.
form
.
docId
=
fileId
;
this
.
form
.
docId
=
fileId
;
this
.
initWps
(
wpsUrl
,
token
);
this
.
initWps
(
wpsUrl
,
token
,
fileId
);
},
},
destroyed
()
{
destroyed
()
{
this
.
removeSelectionChangeListener
();
this
.
removeSelectionChangeListener
();
...
@@ -101,14 +86,22 @@ export default {
...
@@ -101,14 +86,22 @@ export default {
}
}
},
},
// 初始化WPS
// 初始化WPS
async
initWps
(
wpsUrl
,
token
)
{
async
initWps
(
wpsUrl
,
token
,
fileId
)
{
this
.
wpsInstance
=
WebOfficeSDK
.
config
({
this
.
wpsInstance
=
WebOfficeSDK
.
config
({
wpsUrl
,
wpsUrl
,
mount
:
document
.
querySelector
(
"#wps-container"
),
mount
:
document
.
querySelector
(
"#wps-container"
),
});
});
this
.
wpsInstance
.
setToken
({
token
});
this
.
wpsInstance
.
setToken
({
token
});
this
.
wpsInstance
.
ApiEvent
.
AddApiEventListener
(
"fileOpen"
,
(
data
)
=>
{
console
.
log
(
"fileOpen: "
,
data
);
});
// 等待加载完毕
// 等待加载完毕
await
this
.
wpsInstance
.
ready
();
await
this
.
wpsInstance
.
ready
();
const
app
=
this
.
wpsInstance
.
Application
;
console
.
log
(
"app"
,
app
);
this
.
addSelectionListen
();
this
.
addSelectionListen
();
this
.
initAddNoteButton
();
this
.
initAddNoteButton
();
this
.
addViewRecord
();
this
.
addViewRecord
();
...
@@ -123,6 +116,21 @@ export default {
...
@@ -123,6 +116,21 @@ export default {
this
.
handleSelectionChange
(
data
);
this
.
handleSelectionChange
(
data
);
}
}
);
);
this
.
wpsInstance
.
ApiEvent
.
AddApiEventListener
(
"TextSelectChange"
,
async
(
data
)
=>
{
console
.
log
(
"TextSelectChange"
);
// 复制选中的批注文案
const
app
=
this
.
wpsInstance
.
Application
;
console
.
log
(
"app"
,
app
);
await
app
.
ActivePDF
.
AnnoAPI
.
SetSelectionAnno
({
type
:
app
.
Enum
.
AnnoType
.
Highlight
,
color
:
"rgba(0,0,0,1)"
,
});
}
);
},
},
// 初始化并监听新建笔记按钮
// 初始化并监听新建笔记按钮
async
initAddNoteButton
()
{
async
initAddNoteButton
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论