Всем доброго времени суток!
Стоит задача настройки сортировки очереди не по существующему приоритету, а по числовому - http://prntscr.com/mf7dc3
Подскажите в какой схеме происходит сортировка что бы поправить на кастомную.
Заранее благодарен.
Нравится
2 комментария
1 февраля 2019 18:19
Галка «Сортировать по приоритету» добавляется в схеме страницы QueueItemSection:
{
"operation": "insert",
"name": "AgentViewMode",
"parentName": "LeftGridUtilsContainer",
"index": 0,
"propertyName": "items",
"values": {
"checked": {"bindTo": "UseAgentViewSorting"},
"visible": {"bindTo": "getAreFixedFilterCheckboxesVisible"},
"caption": {"bindTo": "Resources.Strings.AgentViewCheckboxCaption"},
"labelButtonClick": {"bindTo": "onUseAgentViewLabelButtonClick"},
"generator": "QueueItemSectionViewHelper.getFixedFilterCheckboxGenerator"
}
},Её значение UseAgentViewSorting учитывает логика:
/**
* @inheritdoc Terrasoft.GridUtilities#initQueryColumns
* @overridden
*/
initQueryColumns: function(esq) {
this.mixins.GridUtilities.initQueryColumns.apply(this, arguments);
if (this.get("UseAgentViewSorting")) {
this.addQueueSortColumns(esq, this.get("QueueColumnsSortConfig"));
}
},
/**
* @inheritdoc Terrasoft.GridUtilities#initQuerySorting
* @overridden
*/
initQuerySorting: function(esq) {
this.mixins.GridUtilities.initQuerySorting.apply(this, arguments);
if (this.get("UseAgentViewSorting")) {
this.initQueueQuerySorting(esq, this.get("QueueColumnsSortConfig"));
}
},QueueColumnsSortConfig берётся:
/**
* Initializes sorting options.
* @param {Function} callback The callback function.
* @protected
*/
initQueueSortingConfig: function(callback) {
this.queryColumnsSortConfig({
callback: function(sortConfig) {
this.set("QueueColumnsSortConfig", sortConfig);
callback();
}.bind(this)
});
},А вот и сортировка, но по имени:
/**
* @inheritdoc Terrasoft.QueueSortUtilities#getInitialQueueSortConfig
* @overridden
*/
getInitialQueueSortConfig: function() {
var sortConfig = this.mixins.QueueSortUtilities.getInitialQueueSortConfig.apply(this, arguments);
sortConfig.push({
"name": "Queue.QueueEntitySchema.Name",
"orderPosition": 4,
"orderDirection": Terrasoft.OrderDirection.ASC
});
return sortConfig;
},Логика включения-выключения галки:
/**
* Handles Agent view Label 'click' event.
* @protected
*/
onUseAgentViewLabelButtonClick: function() {
this.set("UseAgentViewSorting", !this.get("UseAgentViewSorting"));
},
/**
* Handles UseAgentView attribute value changed.
* @param {Backbone.Model} model The model.
* @param {Boolean} useAgentView The new attribute value.
*/
onUseAgentViewChanged: function(model, useAgentView) {
if (useAgentView) {
this.set("SortColumnIndex", -1);
this.reloadGridData();
}
this.set("IsSortMenuVisible", !useAgentView);
this.saveCheckboxAttributeInProfile("UseAgentViewSorting", useAgentView);
},
Показать все комментарии
Войдите или зарегистрируйтесь, что бы комментировать