www_fpvone_cn/application/admin/view/cms/archives/uploadfile.html

140 lines
4.2 KiB
HTML

<link href="https://cdn.bootcdn.net/ajax/libs/layui/2.8.17/css/layui.min.css" rel="stylesheet">
<style>
.upload {
display: flex;
justify-content: center;
}
.layui-btn {
width: 95px;
}
</style>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="upload_player_list">选手名单上传</button>
<button type="button" class="layui-btn" id="fpvone_upload_player_list">开始上传</button>
</div>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose1">决出前32</button>
<button type="button" class="layui-btn" id="ID-upload-demo-action1">开始上传</button>
</div>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose2">32进16</button>
<button type="button" class="layui-btn" id="ID-upload-demo-action2">开始上传</button>
</div>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose3">16进8</button>
<button type="button" class="layui-btn" id="ID-upload-demo-action3">开始上传</button>
</div>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose4">8进4</button>
<button type="button" class="layui-btn" id="ID-upload-demo-action4">开始上传</button>
</div>
<div class="upload layui-btn-container">
<button type="button" lay-options="{
accept: 'file',
exts: 'xlsx|xls'
}" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose5">决赛</button>
<button type="button" class="layui-btn" id="ID-upload-demo-action5">开始上传</button>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.8.17/layui.js"></script>
<script>
layui.use(function(){
var upload = layui.upload;
// 渲染
upload.render({
elem: '#ID-upload-demo-choose1',
url: '{:url("cms/ranking/addRanking")}', // 此处配置你自己的上传接口即可
auto: false,
accept: 'file',
data:{'course':32},
// multiple: true,
bindAction: '#ID-upload-demo-action1',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
upload.render({
elem: '#ID-upload-demo-choose2',
url: '{:url("cms/ranking/addRanking")}', // 此处配置你自己的上传接口即可
auto: false,
accept: 'file',
data:{'course':16},
// multiple: true,
bindAction: '#ID-upload-demo-action2',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
upload.render({
elem: '#ID-upload-demo-choose3',
url: '{:url("cms/ranking/addRanking")}', // 此处配置你自己的上传接口即可
auto: false,
accept: 'file',
data:{'course':8},
// multiple: true,
bindAction: '#ID-upload-demo-action3',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
upload.render({
elem: '#ID-upload-demo-choose4',
url: '{:url("cms/ranking/addRanking")}', // 此处配置你自己的上传接口即可
auto: false,
data:{'course':4},
accept: 'file',
// multiple: true,
bindAction: '#ID-upload-demo-action4',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
upload.render({
elem: '#ID-upload-demo-choose5',
url: '', // 此处配置你自己的上传接口即可
auto: false,
accept: 'file',
// multiple: true,
bindAction: '#ID-upload-demo-action5',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
upload.render({
elem: '#upload_player_list',
url: '{:url("cms/ranking/addPlayerList")}',
auto: false,
accept: 'file',
// multiple: true,
bindAction: '#fpvone_upload_player_list',
done: function(res){
layer.msg('上传成功');
console.log(res)
}
});
});
</script>