src/Topxia/AdminBundle/Resources/public/js/controller/user/import-modal.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
define(function(require, exports, module) {
var Widget = require('widget');
exports.run = function() {
var progressBar = new ProgressBar({
element: '#user-import-progress'
});
var $updateBtn = $("#begin-update");
var importUrl = $("#user-import").data('import-url');
var finishedUrl = $("#user-import").data('finished-url');
var checkType = $("#user-import").data('check-type');
var datas = $.parseJSON($("input[name='data']").val());
var progress = $.parseJSON($("input[name='progress']").val());
var steps = new Array();
var progressNum = 0;
$.each(datas, function(i, item) {
steps.push({
title: Translator.trans('admin.user.import_progress_hint',{progressNum:progressNum}),
url: importUrl,
data:{'data': JSON.stringify(item),'checkType':checkType},
progressRange: [i*100/progress.length, (i+1)*100/progress.length]
});
progressNum += progress[i];
});
$.each(steps, function(i, step) {
$(document).queue('update_step_queue', function() {
exec(step.title, step.url, step.data, progressBar, step.progressRange[0], step.progressRange[1]);
});
});
progressBar.on('completed', function() {
progressBar.deactive();
progressBar.text(Translator.trans('admin.user.import_finish_hint'));
$("#updating-hint").hide();
$("#finish-import-btn").show();
});
$updateBtn.hide();
$("#updating-hint").show();
progressBar.show();
$(document).dequeue('update_step_queue');
$("#finish-import-btn").click(function() {
$(this).button('loading').addClass('disabled');
setTimeout(function(){
window.location.href = finishedUrl;
}, 1000);
});
};
function exec(title, url, data, progressBar, startProgress, endProgress) {
progressBar.setProgress(startProgress, title);
$.ajax(url, {
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。