2018-10-15 09:43:57 +00:00
|
|
|
import ngModule from '../module';
|
2018-12-27 11:54:16 +00:00
|
|
|
import SearchPanel from 'core/components/searchbar/search-panel';
|
2018-10-15 09:43:57 +00:00
|
|
|
|
2020-09-08 08:11:22 +00:00
|
|
|
class Controller extends SearchPanel {
|
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
|
|
|
|
|
|
|
this.filter = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
get filter() {
|
|
|
|
return this.$.filter;
|
|
|
|
}
|
|
|
|
|
|
|
|
set filter(value) {
|
|
|
|
if (!value)
|
|
|
|
value = {};
|
2020-09-14 05:42:43 +00:00
|
|
|
if (!value.values)
|
|
|
|
value.values = [{}];
|
2020-09-08 08:11:22 +00:00
|
|
|
|
|
|
|
this.$.filter = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
getSourceTable(selection) {
|
2020-09-16 07:54:04 +00:00
|
|
|
if (!selection || selection.isFree == true)
|
2020-09-08 08:11:22 +00:00
|
|
|
return null;
|
|
|
|
|
|
|
|
if (selection.sourceTable) {
|
|
|
|
return ''
|
|
|
|
+ selection.sourceTable.charAt(0).toUpperCase()
|
|
|
|
+ selection.sourceTable.substring(1) + 's';
|
|
|
|
} else if (selection.sourceTable == null)
|
|
|
|
return `ItemTags/filterItemTags/${selection.id}`;
|
|
|
|
}
|
|
|
|
|
2020-09-14 05:42:43 +00:00
|
|
|
addValue() {
|
|
|
|
this.filter.values.push({});
|
|
|
|
setTimeout(() => this.popover.relocate());
|
|
|
|
}
|
|
|
|
|
|
|
|
changeTag() {
|
|
|
|
|
2020-09-08 08:11:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnOrderCatalogSearchPanel', {
|
2018-10-15 09:43:57 +00:00
|
|
|
template: require('./index.html'),
|
2020-09-08 08:11:22 +00:00
|
|
|
controller: Controller,
|
2019-10-28 16:31:33 +00:00
|
|
|
bindings: {
|
2020-09-08 08:11:22 +00:00
|
|
|
onSubmit: '&?',
|
2020-09-16 07:54:04 +00:00
|
|
|
popover: '<?',
|
|
|
|
resultTags: '<?'
|
2019-10-28 16:31:33 +00:00
|
|
|
}
|
2018-10-15 09:43:57 +00:00
|
|
|
});
|