fix bug + thêm mẫu người mới trên thiết bị

This commit is contained in:
dongpd
2025-09-25 21:13:56 +07:00
parent 9960469007
commit aa28d09d93
5 changed files with 79 additions and 46 deletions

View File

@@ -1,7 +1,24 @@
$(function () {
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
common.dateTimePickerDay("birthday");
$("#Code").select2();
$("#Code").select2({
tags: true,
createTag: function (params) {
return {
id: params.term,
text: params.term,
newOption: true
};
},
templateResult: function (data) {
var $result = $("<span></span>");
$result.text(data.text);
if (data.newOption) {
$result.append(" <em>(Thêm mới)</em>");
}
return $result;
}
});
$("input[name='AllData']").change(function () {
if ($('input[name=AllData]').is(':checked')) {
window.location = $("input[name='URL']").val() + "?all=true" + "&from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val();
@@ -26,6 +43,12 @@ function _form(e) {
var confidence = JSON.parse($(e).attr("data-confidence"));
$("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg");
$("#closest-name").html(confidence.name + " [" + confidence.score + "]");
clearData();
}
function clearData() {
$('#Code').val("").trigger('change');
}
function _close() {