This commit is contained in:
oneao committed 2026-04-28 17:29:53 +08:00
1 parent ae6ccad238
commit b2d113db38
17 files changed
+3087 -1630

No files matched your search

+21 -11
View File
@@ -5,8 +5,10 @@
<title>文件预览测试</title>
<script type="text/javascript" src="./js/jquery-easyui-1.4/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery-easyui-1.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="./custom-file/index.js"></script>
<link rel="stylesheet" href="./custom-file/index.css" />
<script type="text/javascript" src="./g3-file/index.js"></script>
<script type="text/javascript" src="./g3-file/libs/FileSaver.min.js"></script>
<script type="text/javascript" src="./g3-file/libs/jszip.min.js"></script>
<link rel="stylesheet" href="./g3-file/index.css" />
<style>
* {
@@ -14,18 +16,24 @@
padding: 0;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
#app {
width: 100%;
height: 100%;
background: #f5f7fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.button-group {
margin-bottom: 20px;
padding: 10px 20px;
background: #ffffff;
border-bottom: 1px solid #eef0f2;
display: flex;
gap: 10px;
}
@@ -43,6 +51,11 @@
.button-group button:hover {
background: #4a6fcf;
}
#fileContainer {
flex: 1;
min-height: 0;
}
</style>
</head>
@@ -57,7 +70,7 @@
<button id="destroyBtn">销毁组件</button>
</div>
<div style="height: 600px;width: 500px;">
<div style="height: 600px;width: 800px;">
<div id="fileContainer"></div>
</div>
</div>
@@ -100,8 +113,9 @@
fetchPermissions().then(() => {
const file = $('#fileContainer').G3File({
language: 'zh-CN',
previewUrl:'https://sxox.g3soft.cn:8012/onlinePreview?url=',
data: [
{ name: 'test.jar', size: 1024000, uploadDate: '2024-01-15T10:30:00', url: 'http://118.89.70.199:9000/test/XI26033384.rar' },
{ name: 'logo.png', size: 1024000, uploadDate: '2024-01-15T10:30:00', url: 'https://g3hdzjsj.oss-cn-hangzhou.aliyuncs.com/g3hd/2026/04/28/ccb964f4-124d-4169-8981-20333bea2587.docx' },
],
uploadConfig: {
aliyun: {
@@ -169,10 +183,6 @@
callback(false);
}
},
onPreview: function (files) {
console.log('预览文件:', files);
alert('预览文件: ' + files[0].name);
},
onSelect: function (files) {
console.log('选择文件:', files);
},