|
|
@ -2,7 +2,11 @@ $(function () { |
|
|
var l = abp.localization.getResource('Docs'); |
|
|
var l = abp.localization.getResource('Docs'); |
|
|
var service = window.volo.docs.admin.documentsAdmin; |
|
|
var service = window.volo.docs.admin.documentsAdmin; |
|
|
|
|
|
|
|
|
moment.localeData().preparse = (s)=>s; |
|
|
var getFormattedDate = function ($datePicker) { |
|
|
|
|
|
return $datePicker.data('date'); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
moment.localeData().preparse = (s)=>s; |
|
|
moment.localeData().postformat = (s)=>s; |
|
|
moment.localeData().postformat = (s)=>s; |
|
|
|
|
|
|
|
|
var singleDatePicker = $('#DocumentsContainer .singledatepicker'); |
|
|
var singleDatePicker = $('#DocumentsContainer .singledatepicker'); |
|
|
@ -26,7 +30,7 @@ $(function () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var comboboxItems = []; |
|
|
var comboboxItems = []; |
|
|
|
|
|
|
|
|
service.getFilterItems() |
|
|
service.getFilterItems() |
|
|
.then(function (result) { |
|
|
.then(function (result) { |
|
|
comboboxItems = result; |
|
|
comboboxItems = result; |
|
|
@ -41,13 +45,13 @@ $(function () { |
|
|
$projectId.on('change', function () { |
|
|
$projectId.on('change', function () { |
|
|
fillOptions(); |
|
|
fillOptions(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var comboboxs = { |
|
|
var comboboxs = { |
|
|
version: $('#Version'), |
|
|
version: $('#Version'), |
|
|
languageCode: $('#LanguageCode'), |
|
|
languageCode: $('#LanguageCode'), |
|
|
format: $('#Format') |
|
|
format: $('#Format') |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
for (var key in comboboxs) { |
|
|
for (var key in comboboxs) { |
|
|
comboboxs[key].on('change', function () { |
|
|
comboboxs[key].on('change', function () { |
|
|
fillOptions(); |
|
|
fillOptions(); |
|
|
@ -62,7 +66,7 @@ $(function () { |
|
|
comboboxs[key].empty(); |
|
|
comboboxs[key].empty(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function getSelectedItem() { |
|
|
function getSelectedItem() { |
|
|
var item = {}; |
|
|
var item = {}; |
|
|
for (var key in comboboxs) { |
|
|
for (var key in comboboxs) { |
|
|
@ -70,13 +74,13 @@ $(function () { |
|
|
} |
|
|
} |
|
|
return item; |
|
|
return item; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function SetComboboxsValues(item) { |
|
|
function SetComboboxsValues(item) { |
|
|
for (var key in comboboxs) { |
|
|
for (var key in comboboxs) { |
|
|
comboboxs[key].val(item[key]); |
|
|
comboboxs[key].val(item[key]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function addComboboxsEmptyItem() { |
|
|
function addComboboxsEmptyItem() { |
|
|
for (var key in comboboxs) { |
|
|
for (var key in comboboxs) { |
|
|
comboboxs[key].append($('<option/>').val('').text('')); |
|
|
comboboxs[key].append($('<option/>').val('').text('')); |
|
|
@ -84,17 +88,17 @@ $(function () { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function fillOptions() { |
|
|
function fillOptions() { |
|
|
|
|
|
|
|
|
selectedItem = getSelectedItem(); |
|
|
selectedItem = getSelectedItem(); |
|
|
|
|
|
|
|
|
var selectedProjectId = $projectId.val(); |
|
|
var selectedProjectId = $projectId.val(); |
|
|
|
|
|
|
|
|
emptyComboboxs(); |
|
|
emptyComboboxs(); |
|
|
|
|
|
|
|
|
addComboboxsEmptyItem(); |
|
|
addComboboxsEmptyItem(); |
|
|
|
|
|
|
|
|
var selectedProjectItems = comboboxItems.filter((item) => !selectedProjectId || item.projectId === selectedProjectId); |
|
|
var selectedProjectItems = comboboxItems.filter((item) => !selectedProjectId || item.projectId === selectedProjectId); |
|
|
|
|
|
|
|
|
for (var key in selectedItem) { |
|
|
for (var key in selectedItem) { |
|
|
var item = selectedProjectItems.find((item) => item[key] === selectedItem[key]); |
|
|
var item = selectedProjectItems.find((item) => item[key] === selectedItem[key]); |
|
|
if (item) { |
|
|
if (item) { |
|
|
@ -103,14 +107,14 @@ $(function () { |
|
|
selectedItem[key] = ''; |
|
|
selectedItem[key] = ''; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedProjectItems.forEach(function (item) { |
|
|
selectedProjectItems.forEach(function (item) { |
|
|
for (var key in comboboxs) { |
|
|
for (var key in comboboxs) { |
|
|
appendComboboxItem(comboboxs[key], item, key); |
|
|
appendComboboxItem(comboboxs[key], item, key); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
SetComboboxsValues(selectedItem); |
|
|
SetComboboxsValues(selectedItem); |
|
|
} |
|
|
} |
|
|
function appendComboboxItem($combobox, item , key) { |
|
|
function appendComboboxItem($combobox, item , key) { |
|
|
@ -128,21 +132,20 @@ $(function () { |
|
|
|
|
|
|
|
|
var getFilter = function () { |
|
|
var getFilter = function () { |
|
|
$('#DocumentsContainer').handleDatepicker('.singledatepicker'); |
|
|
$('#DocumentsContainer').handleDatepicker('.singledatepicker'); |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
projectId: $('#ProjectId').val(), |
|
|
projectId: $('#ProjectId').val(), |
|
|
name: $('#Name').val(), |
|
|
name: $('#Name').val(), |
|
|
version: $('#Version').val(), |
|
|
version: $('#Version').val(), |
|
|
languageCode: $('#LanguageCode').val(), |
|
|
languageCode: $('#LanguageCode').val(), |
|
|
format: $('#Format').val(), |
|
|
format: $('#Format').val(), |
|
|
creationTimeMin: $('#DocumentsContainer').find('input[name="CreationTimeMin"'), |
|
|
creationTimeMin: getFormattedDate($('#DocumentsContainer').find('input[name="CreationTimeMin"]')), |
|
|
creationTimeMax: $('#DocumentsContainer').find('input[name="CreationTimeMax"'), |
|
|
creationTimeMax: getFormattedDate($('#DocumentsContainer').find('input[name="CreationTimeMax"]')), |
|
|
lastUpdatedTimeMin: $('#DocumentsContainer').find('input[name="LastUpdatedTimeMin"'), |
|
|
lastUpdatedTimeMin: getFormattedDate($('#DocumentsContainer').find('input[name="LastUpdatedTimeMin"]')), |
|
|
lastUpdatedTimeMax: $('#DocumentsContainer').find('input[name="LastUpdatedTimeMax"'), |
|
|
lastUpdatedTimeMax: getFormattedDate($('#DocumentsContainer').find('input[name="LastUpdatedTimeMax"]')), |
|
|
lastSignificantUpdateTimeMin: $('#DocumentsContainer').find('input[name="LastSignificantUpdateTimeMin"'), |
|
|
lastSignificantUpdateTimeMin: getFormattedDate($('#DocumentsContainer').find('input[name="LastSignificantUpdateTimeMin"]')), |
|
|
lastSignificantUpdateTimeMax: $('#DocumentsContainer').find('input[name="LastSignificantUpdateTimeMax"'), |
|
|
lastSignificantUpdateTimeMax: getFormattedDate($('#DocumentsContainer').find('input[name="LastSignificantUpdateTimeMax"]')), |
|
|
lastCachedTimeMin: $('#DocumentsContainer').find('input[name="LastCachedTimeMin"'), |
|
|
lastCachedTimeMin: getFormattedDate($('#DocumentsContainer').find('input[name="LastCachedTimeMin"]')), |
|
|
lastCachedTimeMax: $('#DocumentsContainer').find('input[name="LastCachedTimeMax"'), |
|
|
lastCachedTimeMax: getFormattedDate($('#DocumentsContainer').find('input[name="LastCachedTimeMax"]')), |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|