Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xxx_phase2_web
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏敏伟
xxx_phase2_web
Commits
dc5b234a
Commit
dc5b234a
authored
Dec 07, 2023
by
以墨为白
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webpack调整
parent
e801de11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
66 deletions
+81
-66
onlyoffice.html
onlyoffice.html
+1
-56
src/onlyoffice.js
src/onlyoffice.js
+50
-0
webpack.config.js
webpack.config.js
+30
-10
No files found.
onlyoffice.html
View file @
dc5b234a
...
...
@@ -4,66 +4,11 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
文件预览
</title>
<script
src=
"http://192.168.168.213:9000/web-apps/apps/api/documents/api.js"
></script>
</head>
<body>
<div
id=
"placeholder"
></div>
<script
src=
"http://192.168.168.213:9000/web-apps/apps/api/documents/api.js"
></script>
<script>
var
getParameters
=
function
()
{
var
search
=
window
.
location
.
search
;
var
obj
=
{};
if
(
search
!=
''
)
{
// window.location.search '' or start with '?'
search
=
search
.
substring
(
1
);
var
keypairArray
=
search
.
split
(
'
&
'
);
for
(
i
in
keypairArray
)
{
keypair
=
keypairArray
[
i
];
partArray
=
keypair
.
split
(
'
=
'
);
if
(
partArray
.
length
==
2
)
{
obj
[
partArray
[
0
]]
=
partArray
[
1
];
}
}
}
return
obj
;
}
var
param
=
getParameters
();
var
docEditor
=
new
DocsAPI
.
DocEditor
(
"
placeholder
"
,
{
"
document
"
:
{
"
fileType
"
:
param
.
fileType
.
replace
(
"
.
"
,
""
),
"
permissions
"
:
{
"
edit
"
:
false
,
"
copy
"
:
false
,
"
download
"
:
false
,
"
print
"
:
false
,
"
chat
"
:
false
},
// "key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",
"
title
"
:
decodeURIComponent
(
param
.
filename
),
"
url
"
:
decodeURIComponent
(
param
.
url
),
},
"
height
"
:
"
1000px
"
,
"
width
"
:
"
100%
"
,
"
editorConfig
"
:
{
"
mode
"
:
'
view
'
,
"
customization
"
:
{
//是否显示插件
"
plugins
"
:
false
,
"
feedback
"
:
{
"
url
"
:
"
https://example.com
"
,
"
visible
"
:
false
},
"
help
"
:
false
},
about
:
false
,
}
});
</script>
</body>
</html>
\ No newline at end of file
src/onlyoffice.js
0 → 100644
View file @
dc5b234a
var
getParameters
=
function
()
{
var
search
=
window
.
location
.
search
;
var
obj
=
{};
if
(
search
!=
''
)
{
// window.location.search '' or start with '?'
search
=
search
.
substring
(
1
);
var
keypairArray
=
search
.
split
(
'
&
'
);
for
(
i
in
keypairArray
)
{
keypair
=
keypairArray
[
i
];
partArray
=
keypair
.
split
(
'
=
'
);
if
(
partArray
.
length
==
2
)
{
obj
[
partArray
[
0
]]
=
partArray
[
1
];
}
}
}
return
obj
;
}
var
param
=
getParameters
();
var
docEditor
=
new
DocsAPI
.
DocEditor
(
"
placeholder
"
,
{
"
document
"
:
{
"
fileType
"
:
param
.
fileType
.
replace
(
"
.
"
,
""
),
"
permissions
"
:
{
"
edit
"
:
false
,
"
copy
"
:
false
,
"
download
"
:
false
,
"
print
"
:
false
,
"
chat
"
:
false
},
// "key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",
"
title
"
:
decodeURIComponent
(
param
.
filename
),
"
url
"
:
decodeURIComponent
(
param
.
url
),
},
"
height
"
:
"
1000px
"
,
"
width
"
:
"
100%
"
,
"
editorConfig
"
:
{
"
mode
"
:
'
view
'
,
"
customization
"
:
{
//是否显示插件
"
plugins
"
:
false
,
"
feedback
"
:
{
"
url
"
:
"
https://example.com
"
,
"
visible
"
:
false
},
"
help
"
:
false
},
about
:
false
,
}
});
\ No newline at end of file
webpack.config.js
View file @
dc5b234a
...
...
@@ -8,29 +8,49 @@ const vueLoaderPlugin = require('vue-loader/lib/plugin')
module
.
exports
=
{
mode
:
'
development
'
,
// 开发模式
// mode: 'production',
entry
:
path
.
resolve
(
__dirname
,
'
./src/main.js
'
),
// 项目入口文件
entry
:
{
main
:
path
.
resolve
(
__dirname
,
'
./src/main.js
'
),
onlyoffice
:
path
.
resolve
(
__dirname
,
'
./src/onlyoffice.js
'
)
},
// 项目入口文件
output
:
{
filename
:
'
[name].[contenthash:8].js
'
,
path
:
path
.
resolve
(
__dirname
,
'
./web
'
)
// 打包后的目录
},
resolve
:{
alias
:{
'
@
'
:
path
.
join
(
__dirname
,
'
./src/
'
)
resolve
:
{
alias
:
{
'
@
'
:
path
.
join
(
__dirname
,
'
./src/
'
)
}
},
plugins
:
[
new
HtmlWebpackPlugin
({
template
:
path
.
resolve
(
__dirname
,
'
./index.html
'
),
filename
:
'
index.html
'
,
inject
:
true
,
chunks
:
[
'
main
'
],
favicon
:
path
.
join
(
'
static/img/favicon.ico
'
)
}),
new
CleanWebpackPlugin
(),
new
CopyWebpackPlugin
({
patterns
:
[
{
from
:
path
.
resolve
(
__dirname
,
'
./static
'
),
to
:
'
static
'
},
{
from
:
path
.
resolve
(
__dirname
,
'
./onlyoffice.html
'
),
to
:
'
onlyoffice.html
'
},
]
new
HtmlWebpackPlugin
({
template
:
path
.
resolve
(
__dirname
,
'
./onlyoffice.html
'
),
filename
:
'
onlyoffice.html
'
,
inject
:
'
body
'
,
chunks
:
[
'
onlyoffice
'
],
favicon
:
path
.
join
(
'
static/img/favicon.ico
'
),
// tags: {//webpack5.5以上才支持
// body: [{
// tagName: 'script',
// attributes: {
// src: 'https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js',
// },
// }]
// }
}),
new
CleanWebpackPlugin
(),
// new CopyWebpackPlugin({
// patterns: [
// { from: path.resolve(__dirname, './static'), to: 'static' },
// { from: path.resolve(__dirname, './onlyoffice.html'), to: 'onlyoffice.html' },
// ]
// }),
new
vueLoaderPlugin
()
],
devtool
:
'
eval
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment