define('base/1.0.0/unit/utils/utils-1.0.0',
function(require, exports, module) {
// 全部选中效果
exports.hqySelectRow = function(tableId, css) {
"use strict";
(function ($) {
var $table = $('#' + tableId), $el,
toggle = function($el, all) {
var $row = (all === true) ?
$table.find(".hqy-row-select").parents("tr") :
$el.parents("tr:first");
if ($el.is(':checked')) {
$row.removeClass(css).addClass(css);
if (all === true) {
$table.find("input[name='selection[]']").prop('checked', true);
}
} else {
$row.removeClass(css);
if (all === true) {
$table.find("input[name='selection[]']").prop('checked', false);
}
}
};
$table.find(".hqy-row-select input").on('change', function () {
toggle($(this));
}).each(function() {
toggle($(this));
});
$table.find(".hqy-all-select input").on('change', function () {
toggle($(this), true);
});
})(window.jQuery);
};
exports.titleChangeLength = function (id, num) {
var target = jQuery("#" + id);
var titleLength = target.val().length;
var h = "";
var after = target.parent().children("#titleChangelength");
if (after != undefined && after.length == 0) {
target.after(h);
after = target.parent().children("#titleChangelength");
}
if (titleLength <= num) {
var s = ' 还能输入' + (num - titleLength) + '字';
after.html(s);
} else {
var s = ' 已经超出' + (titleLength - num) + '字';
after.html(s);
}
}
});